base/init: use "udevadm control --exit" and "udevadm info --cleanup-db"
authorHarald Hoyer <harald@redhat.com>
Thu, 14 Apr 2011 10:00:11 +0000 (12:00 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 14 Apr 2011 10:00:11 +0000 (12:00 +0200)
For udev >= 168 use the advanced udevadm features for shutting down udev.

Thanks Kay!!!

modules.d/99base/init

index 3569f0b..b7c2d1b 100755 (executable)
@@ -321,16 +321,23 @@ done
 
 getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
 
-# stop udev queue before killing it
-udevadm control --stop-exec-queue
 
-HARD=""
-while pidof udevd >/dev/null 2>&1; do 
-    for pid in $(pidof udevd); do
-        kill $HARD $pid >/dev/null 2>&1
+
+if [ $UDEVVERSION -lt 168 ]; then
+    # stop udev queue before killing it
+    udevadm control --stop-exec-queue
+
+    HARD=""
+    while pidof udevd >/dev/null 2>&1; do 
+        for pid in $(pidof udevd); do
+            kill $HARD $pid >/dev/null 2>&1
+        done
+        HARD="-9"
     done
-    HARD="-9"
-done
+else
+    udevadm control --exit
+    udevadm info --cleanup-db
+fi
 
 set +x # Turn off debugging for this section
 # Clean up the environment