* [PATCH] Give a hint when 'udevd' is ready to operate
@ 2006-04-29 9:08 Enrico Scholz
2006-04-29 12:46 ` Scott James Remnant
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Enrico Scholz @ 2006-04-29 9:08 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
Hello,
please apply the attached patch. It creates the '/dev/.udev' directory
when 'udevd' is ready to operate.
This helps init methods like 'initng' or 'minit' to stop future
processing (e.g. invoking 'udevtrigger') until 'udevd' is fully
initialized. Currently, there does not seem to exist a way to wait
for 'udevd' (resp. to check whether it is ready) and issued uevent's
may disappear silently.
With this patch, the init methods can test for /dev/.udev (e.g. waiting
actively or using inotify) after 'udevd' has been started.
Enrico
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: creates /dev/.udev upon startup --]
[-- Type: text/x-patch, Size: 283 bytes --]
--- udev-091/udevd.c.startup 2006-04-25 22:39:59.000000000 +0200
+++ udev-091/udevd.c 2006-04-28 10:00:48.000000000 +0200
@@ -946,6 +946,8 @@
chdir("/");
umask(022);
+ create_path(UDEV_ROOT);
+
/* become session leader */
sid = setsid();
dbg("our session is %d", sid);
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Give a hint when 'udevd' is ready to operate
2006-04-29 9:08 [PATCH] Give a hint when 'udevd' is ready to operate Enrico Scholz
@ 2006-04-29 12:46 ` Scott James Remnant
2006-04-29 12:58 ` Kay Sievers
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Scott James Remnant @ 2006-04-29 12:46 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
On Sat, 2006-04-29 at 11:08 +0200, Enrico Scholz wrote:
> please apply the attached patch. It creates the '/dev/.udev' directory
> when 'udevd' is ready to operate.
>
This isn't needed.
Start udevd with the --daemon argument, it won't go into the background
until it's ready to process events.
So the following code works:
udevd --daemon
udevtrigger
Scott
--
Scott James Remnant
scott@ubuntu.com
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Give a hint when 'udevd' is ready to operate
2006-04-29 9:08 [PATCH] Give a hint when 'udevd' is ready to operate Enrico Scholz
2006-04-29 12:46 ` Scott James Remnant
@ 2006-04-29 12:58 ` Kay Sievers
2006-04-29 13:12 ` Enrico Scholz
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2006-04-29 12:58 UTC (permalink / raw)
To: linux-hotplug
On Sat, Apr 29, 2006 at 01:46:20PM +0100, Scott James Remnant wrote:
> On Sat, 2006-04-29 at 11:08 +0200, Enrico Scholz wrote:
>
> > please apply the attached patch. It creates the '/dev/.udev' directory
> > when 'udevd' is ready to operate.
> >
> This isn't needed.
>
> Start udevd with the --daemon argument, it won't go into the background
> until it's ready to process events.
>
> So the following code works:
>
> udevd --daemon
> udevtrigger
Yeah, that is the usual way and udevd makes sure not to return before
it's fully initialized. Waiting for a file from a daemon, just because
the minit-like stuff tries to be smart (daemons don't detach) sounds
weird. Anyway, the current udevd exports the seqnum of the kernel, so
one can wait for that, even when it's a silly workaround a problem that
does not exist in reality.
Kay
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Give a hint when 'udevd' is ready to operate
2006-04-29 9:08 [PATCH] Give a hint when 'udevd' is ready to operate Enrico Scholz
2006-04-29 12:46 ` Scott James Remnant
2006-04-29 12:58 ` Kay Sievers
@ 2006-04-29 13:12 ` Enrico Scholz
2006-04-29 14:11 ` Enrico Scholz
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Enrico Scholz @ 2006-04-29 13:12 UTC (permalink / raw)
To: linux-hotplug
Scott James Remnant <scott@ubuntu.com> writes:
>> please apply the attached patch. It creates the '/dev/.udev' directory
>> when 'udevd' is ready to operate.
>>
> This isn't needed.
>
> Start udevd with the --daemon argument,
Does not work nice with modern init methods like 'initng' and 'minit'
because they want to avoid forking daemons. Keeping track of the status
of daemons (e.g. needed for the 'respawn' or 'send-signal-to-daemon'
feature) is more difficultly when daemon goes into background.
Enrico
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Give a hint when 'udevd' is ready to operate
2006-04-29 9:08 [PATCH] Give a hint when 'udevd' is ready to operate Enrico Scholz
` (2 preceding siblings ...)
2006-04-29 13:12 ` Enrico Scholz
@ 2006-04-29 14:11 ` Enrico Scholz
2006-04-29 14:44 ` David Gómez
2006-04-30 0:14 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: Enrico Scholz @ 2006-04-29 14:11 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 909 bytes --]
Kay Sievers <kay.sievers@vrfy.org> writes:
>> udevd --daemon
>> udevtrigger
>
> Yeah, that is the usual way and udevd makes sure not to return before
> it's fully initialized. Waiting for a file from a daemon, just because
> the minit-like stuff tries to be smart (daemons don't detach) sounds
> weird. Anyway, the current udevd exports the seqnum of the kernel, so
> one can wait for that,
Does not work; the first call to export_initial_seqnum() (before fork())
is a noop because
| strlcpy(filename, udev_root, sizeof(filename));
| strlcat(filename, "/" EVENT_SEQNUM, sizeof(filename));
| fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0644);
fails due to the non-existing '/dev/.udev' path. So, my patch should be
applied earlier
| udev_rules_init(&rules, 1);
|
| + create_path(udev_root);
| export_initial_seqnum();
|
| if (daemonize) {
Enrico
[-- Attachment #2: Type: application/pgp-signature, Size: 480 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Give a hint when 'udevd' is ready to operate
2006-04-29 9:08 [PATCH] Give a hint when 'udevd' is ready to operate Enrico Scholz
` (3 preceding siblings ...)
2006-04-29 14:11 ` Enrico Scholz
@ 2006-04-29 14:44 ` David Gómez
2006-04-30 0:14 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: David Gómez @ 2006-04-29 14:44 UTC (permalink / raw)
To: linux-hotplug
Hi Enrico,
On Apr 29 at 03:12:39, Enrico Scholz wrote:
> Does not work nice with modern init methods like 'initng' and 'minit'
> because they want to avoid forking daemons.
I think that "modern" approach it's not the right one. It shouldn't
be the init process the supervisor of the daemons launched at the
boot time...
cheers,
--
David Gómez Jabber ID: davidge@jabber.org
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Give a hint when 'udevd' is ready to operate
2006-04-29 9:08 [PATCH] Give a hint when 'udevd' is ready to operate Enrico Scholz
` (4 preceding siblings ...)
2006-04-29 14:44 ` David Gómez
@ 2006-04-30 0:14 ` Kay Sievers
5 siblings, 0 replies; 7+ messages in thread
From: Kay Sievers @ 2006-04-30 0:14 UTC (permalink / raw)
To: linux-hotplug
On Sat, Apr 29, 2006 at 04:11:34PM +0200, Enrico Scholz wrote:
> Kay Sievers <kay.sievers@vrfy.org> writes:
>
> >> udevd --daemon
> >> udevtrigger
> >
> > Yeah, that is the usual way and udevd makes sure not to return before
> > it's fully initialized. Waiting for a file from a daemon, just because
> > the minit-like stuff tries to be smart (daemons don't detach) sounds
> > weird. Anyway, the current udevd exports the seqnum of the kernel, so
> > one can wait for that,
>
> Does not work; the first call to export_initial_seqnum() (before fork())
> is a noop because
>
> | strlcpy(filename, udev_root, sizeof(filename));
> | strlcat(filename, "/" EVENT_SEQNUM, sizeof(filename));
> | fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0644);
>
> fails due to the non-existing '/dev/.udev' path. So, my patch should be
> applied earlier
Just create that directory yourself and wait for the seqnum file to
appear. In the devel tree it's already changed 3 days ago, but not in
a released version.
Kay
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x120709&bid&3057&dat\x121642
_______________________________________________
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-04-30 0:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-29 9:08 [PATCH] Give a hint when 'udevd' is ready to operate Enrico Scholz
2006-04-29 12:46 ` Scott James Remnant
2006-04-29 12:58 ` Kay Sievers
2006-04-29 13:12 ` Enrico Scholz
2006-04-29 14:11 ` Enrico Scholz
2006-04-29 14:44 ` David Gómez
2006-04-30 0:14 ` Kay Sievers
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).