From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Sat, 26 Feb 2005 00:46:23 +0000 Subject: Re: event sequencing Message-Id: <1109378783.7242.167.camel@localhost.localdomain> 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 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. >Is there a write up on how to use netlink in conjuntion with dbus somewhere? No, but HAL listens for that events, you may look there how device objects react to netlink events and send meaningful events to the system-wide bus. Kay ------------------------------------------------------- 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