On Mon, May 02, 2011 at 03:16:56AM -0300, Gerardo Exequiel Pozzi wrote: > On 05/02/2011 01:22 AM, Dave Reisner wrote: > >On Mon, May 02, 2011 at 12:40:14AM -0300, Gerardo Exequiel Pozzi wrote: > >>On 05/02/2011 12:39 AM, Gerardo Exequiel Pozzi wrote: > >>>N0: udev>= 168 is needed. > >>>N1: I guess the order is correct (first cleanup then exit). > >>>N2: device-mapper/LVM udev rules must be parsed for initramfs creation > >>> to add OPTIONS+="db_persist" > >>> > >>>> From udev NEWS: > >>>The running udev daemon can now cleanly shut down with: > >>> udevadm control --exit > >>> > >>>Udev in initramfs should clean the state of the udev database > >>>with: udevadm info --cleanup-db which will remove all state left > >>>behind from events/rules in initramfs. If initramfs uses > >>>--cleanup-db and device-mapper/LVM, the rules in initramfs need > >>>to add OPTIONS+="db_persist" for all dm devices. This will > >>>prevent removal of the udev database for these devices. > >>> > >>>Signed-off-by: Gerardo Exequiel Pozzi<[email protected]> > >>>--- > >>> init | 12 ++++-------- > >>> 1 files changed, 4 insertions(+), 8 deletions(-) > >>> > >>>diff --git a/init b/init > >>>index 7b81a1a..f586220 100644 > >>>--- a/init > >>>+++ b/init > >>>@@ -118,15 +118,11 @@ elif [ ! -x "/new_root${init}" ]; then > >>> launch_interactive_shell --exec > >>> fi > >>> > >>>-#Special handling if udev is running > >>>-udevpid=$(/bin/pidof udevd) > >>>-if [ -n "${udevpid}" ]; then > >>>- # Settle pending uevents, then kill udev > >>>+# Stop udevd if is running > >>>+if [ "${udevd_running}" -eq 1 ]; then > >>> /sbin/udevadm settle > >>>- /bin/kill ${udevpid}> /dev/null 2>&1 > >>>- while /bin/pidof udevd>/dev/null; do > >>>- sleep 0.1 > >>>- done > >>>+ /sbin/udevadm info --cleanup-db > >>>+ /sbin/udevadm control --exit > >>> fi > >>> > >>> for d in proc sys dev run; do > >>This just keep settle command. > >> > >>-- > >>Gerardo Exequiel Pozzi > >>\cos^2\alpha + \sin^2\alpha = 1 > >> > >The settle is actually unnecessary here, as its called as part of the > >udev hook. I don't see a need to call it twice. On the other hand, I've > >notice that dracut makes the call 'udevadm control --stop-exec-queue' > >prior to shutting down udevd. Perhaps we should be using that instead? > > > >dave > > > sure? > > I think this: > > -------------------- > launch udevd --daemon > > [udev] > launch triggers > settle > [/udev] > > [other hooks] > other possible uevents > [/other hooks] > > at this point should wait for all uevents processed (settle) then > stop udev (control --exit) > ---------------- > > stop-exec-queue just ignore all events (stop process them) and queue > all incomming events. I think this is what do not want to do. >
Not sure I understand the logic here. By the time you're ready to shut down udev, your root is mounted and $init exists. Queued uevents are very likely for hardware that we don't currently have modules for. What other uevents would we be interested in at this point? dave
