linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Smirl <jonsmirl@gmail.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: event sequencing
Date: Sat, 26 Feb 2005 01:18:58 +0000	[thread overview]
Message-ID: <9e47339105022517185bc2dfc7@mail.gmail.com> (raw)
In-Reply-To: <9e473391050225081838f673c7@mail.gmail.com>

On Sat, 26 Feb 2005 01:46:23 +0100, Kay Sievers <kay.sievers@vrfy.org> wrote:
> On Fri, 2005-02-25 at 16:56 -0500, Jon Smirl wrote:
> >On Fri, 25 Feb 2005 17:53:27 +0100, Kay Sievers <kay.sievers@vrfy.org> wrote:
> >> >In my probe function I do a class_simple_device_add() to create the
> >> >class entry. Later in the probe function I do
> >> >kobject_hotplug(&info->class_device->kobj, KOBJ_MOUNT); to indicate a
> >> >monitor change.
> >>
> >> Don't use that function. It is only for the driver core. It will execute
> >> a usermode_helper which is not the way to do new stuff. Use the netlink
> >> events for that: If your application is some low-level stuff, listen
> >> directly to uevents:
> >>   http://www.kernel.org/pub/linux/utils/kernel/hotplug/uevent_listen.c
> >
> >What do I use instead of this to generate the netlink event?
> >kobject_hotplug(&info->class_device->kobj, KOBJ_MOUNT);
> 
> kobject_uevent()
> 
> >The user mode helper for monitor change needs to run as root. Do I use
> >the same /etc/hotplug.d directories for netlink?
> 
> No, uevents don't do anything by themselves, they are just sent from the
> kernel and something that listens to it, can do whatever is needed.
> You need your own listener for these events, or add that code to an
> existing system wide thing like HAL.

I'm not sure this is achieving what I need. There are two events

1) Hardware interrupt on monitor change
This event needs to cause a root priv executable to run
The executable may be specific to the device and it messes with the hardware.
This is not an event for system wide consumption
Code in this event converts the card specific data into a general form

2) A system wide event saying the the monitor has been changed. 
Runs after #1
This one fits into the netlink/hal/dbus model
A common data format is broadcast for all consumers

kobject_hotplug() did exactly what I needed for #1. In the netlink
model it looks like I have to have a daemon running listening for the
event. Most systems will never generate a monitor change interrupt
except at boot so I'd prefer not to keep a daemon running for this
event. Should I just switch #1 to directly use call_usermodehelper()?

-- 
Jon Smirl
jonsmirl@gmail.com


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2005-02-26  1:18 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-25 16:18 event sequencing Jon Smirl
2005-02-25 16:53 ` Kay Sievers
2005-02-25 21:56 ` Jon Smirl
2005-02-26  0:16 ` Jon Smirl
2005-02-26  0:46 ` Kay Sievers
2005-02-26  1:18 ` Jon Smirl [this message]
2005-02-26  3:27 ` Greg KH
2005-02-26  3:29 ` Greg KH
2005-02-26  3:43 ` Kay Sievers
2005-02-26  3:58 ` Greg KH
2005-02-26  5:08 ` Kay Sievers
2005-02-26  5:35 ` Greg KH
2005-02-26  6:25 ` Jon Smirl
2005-02-26 13:11 ` Kay Sievers
2005-02-26 14:00 ` Kay Sievers
2005-02-26 17:34 ` Jon Smirl
2005-02-26 17:37 ` Jon Smirl
2005-02-26 18:28 ` Kay Sievers
2005-02-26 19:17 ` Jon Smirl
2005-02-26 19:41 ` Kay Sievers
2005-02-27  0:27 ` Jon Smirl
2005-02-28  4:53 ` Jon Smirl
2005-02-28 11:25 ` Kay Sievers
2005-02-28 19:07 ` Jon Smirl
2005-02-28 19:51 ` Greg KH
2005-02-28 19:52 ` Greg KH
2005-02-28 19:56 ` Greg KH
2005-02-28 21:13 ` Jon Smirl
2005-03-01  8:01 ` Greg KH
2005-03-01  8:30 ` Jon Smirl
2005-03-01  8:41 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e47339105022517185bc2dfc7@mail.gmail.com \
    --to=jonsmirl@gmail.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).