From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jon Smirl Date: Sat, 26 Feb 2005 01:18:58 +0000 Subject: Re: event sequencing Message-Id: <9e47339105022517185bc2dfc7@mail.gmail.com> List-Id: References: <9e473391050225081838f673c7@mail.gmail.com> In-Reply-To: <9e473391050225081838f673c7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sat, 26 Feb 2005 01:46:23 +0100, Kay Sievers wrote: > On Fri, 2005-02-25 at 16:56 -0500, Jon Smirl wrote: > >On Fri, 25 Feb 2005 17:53:27 +0100, Kay Sievers 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_id396&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