init.d/udev

Benoit Valiron bvali087 at uottawa.ca
Wed Nov 24 04:34:52 UTC 2004


Again about udev, I noticed that init.d/udev consider udev devices
installed in /udev. In particular, the script set udev_root just
after parsing /etc/udev/udev.conf, in which this variable is already
defined (in my case, as "/dev") :

----- quote from init.d/udev ---------------
. /etc/udev/udev.conf

prog=udev
sysfs_dir=/sys
bin=/sbin/udev
udevd=/sbin/udevd
udev_root=/udev
----- end of quote ------------------------

This causes problem during the creation of stdout, stdin and stderr,
which are then created in /udev instead of /dev.


I noticed on my box another problem, but maybe it's just me. When
halting the system, udev complains that "/dev/null" is missing.

I solved the problem with an horrible hack (please do not kill me yet,
I know, it's awful), by asking the script not to delete /dev/null in
the loop which remove each device.

--- /var/lib/lunar/moonbase/filesys/udev/udev   2004-11-08 04:55:52.000000000 -0+++ udev        2004-11-23 22:39:52.000000000 -0500
@@ -60,12 +60,16 @@
        # all other device classes
        for i in ${sysfs_dir}/class/*; do
                for j in $i/*; do
+                       if [ "$ACTION" == "remove" ] && [ ! -z $(echo "$j" | grep "null") ] ; then
+                               echo -n "[skip /dev/null]";
+                       else
                        if [ -f $j/dev ]; then
                                export DEVPATH=${j#${sysfs_dir}}
                                CLASS=`echo ${i#${sysfs_dir}} | \
                                        cut --delimiter='/' --fields=3-`
                                $bin $CLASS &
                        fi
+                       fi
                done
        done
        return 0
----- end of horrible hack --------------

I told you, it's awful.


-- 
Ben



More information about the Lunar mailing list