Package: udev
Version: 0.114-2
Followup-For: Bug #457399

 init.d/udev sometimes sets UDEV_ROOT (when UDEV_DISABLED is set in
 /etc/udev/udev.conf) with the intention of passing the value to udevd.
 But it doesn't export the variable, so the daemon later does not see it
 in the environment when it starts up, and hence takes no notice of it.

Here is a patch to /etc/init.d/udev

 @@ -168,15 +178,17 @@
 # this is experimental and may not work well
 if [ "$UDEV_DISABLED" = "yes" ]; then
   udev_root=/etc/udev/.dev
-  UDEV_ROOT=$udev_root
+  # PTB adds 'export' so daemon sees it!
+  export UDEV_ROOT=$udev_root
 fi
 
Note

  1) the daemon is supposed to read /etc/udev/udev.conf and parse the
    lines it recognises, in particular udev_root=foobar. But in the case
    when UDEV_DISABLED is set in udev.conf, the udev_root=foobar line
    may still appear there, thus the daemon wil read and act on that instead
    of using the value set with UDEV_ROOT (intended for the env, but not
    passed to it) in the init.d/udev script in this case. 
    
    They may be the same values in some instances masking the problem.
    But then there would have been no need to set UDEV_ROOT at all in
    init.d/udev if the two were not potentially different as the dameon
    would always read udev_root from /etc/udev/udev/conf, and
    init.d/udev sets UDEV_ROOT from udev_root which it reads from
    /etc/udev/udev/conf.
    
    What happens if several values of udev_root appear in
    /etc/udev/udev.conf, for example, protected by shell constructs such
    as if ..  then ..  fi?  The shell script will get one value and the
    daemon will/may get another.

  2) if udev_root is not set in /etc/udev/udev.conf and UDEV_DISABLED
    is set there, then the daemon will not read the default set for
    udev_root in init.d/udev. because although UDEV_ROOT is set from it,
    it is not passed into the env for the daemon to read. I haven't
    checked to see if by good luck the daemon has a compiled-in default
    that coincides, thus masking the problem.

  3) in any case, it's absurd that the daemon should parse a config file
   to get its value of udev_root, or read an environment variable
   UDEV_ROOT (security!), when the order of precedence is not defined.
   It should leave parsing and environment variables well alone and
   observe an explicit --root= option passed to in on the command line
   from the /etc/init.d/udev scritpy, for which I will be glad to supply
   the patch, if you ask me for it.

  4) The /etc/init.d/udev script is careless in using defined values
   "/dev" almost everywhere instead of the correct value, "$udev_root".
   That's easy to correct.

  5) The udev script makes an incomplete attempt at what in any case
   is a faux-distinction between /dev and $udev_root simply because it
   wants to populate /dev with /dev/null in any case, so that the daemon
   can hush itself when starting up before syslog starts by reopening
   stderr and stdout as /dev/null.  It should simply hush itself in
   C code, with an int quiet=1 variable, until it can find a syslog
   socket to talk to, or other inode of its desires.  Then the
   init.d/udev script would uncomplicate itself, and everyone would know
   what was meant to be /dev and what was meant to be $udev_root in it -
   everything would be $udev_root - and the maintenance mess would
   disappear.
 



-- Package-specific info:
-- /etc/udev/rules.d/:
/etc/udev/rules.d/:
total 14
lrwxrwxrwx 1 root root   20 Oct  7  2006 020_permissions.rules -> 
../permissions.rules
lrwxrwxrwx 1 root root   19 Oct  7  2006 025_libgphoto2.rules -> 
../libgphoto2.rules
lrwxrwxrwx 1 root root   16 Dec 30 16:06 025_libsane.rules -> ../libsane.rules
lrwxrwxrwx 1 root root   22 Oct  7  2006 025_logitechmouse.rules -> 
../logitechmouse.rules
lrwxrwxrwx 1 root root   16 Oct  9  2006 030_ifplugd.rules -> ../ifplugd.rules
lrwxrwxrwx 1 root root   13 Oct 12  2006 090_enbd.rules -> ../enbd.rules
-rw-r--r-- 1 root root  210 Dec  2 23:10 45-hplip.rules
-rw-r--r-- 1 root root  900 Dec  2 23:10 55-hpmud.rules
lrwxrwxrwx 1 root root   15 Oct  7  2006 85-pcmcia.rules -> ../pcmcia.rules
-rw-r--r-- 1 root root  100 Oct  9 10:31 enbd.rules
-rw-r--r-- 1 root root   86 Aug 16 21:52 nvram.rules
lrwxrwxrwx 1 root root   17 Oct  8  2006 thinkpad.rules -> ../thinkpad.rules
lrwxrwxrwx 1 root root   13 Oct  7  2006 udev.rules -> ../udev.rules
lrwxrwxrwx 1 root root   25 Oct  7  2006 z20_persistent-input.rules -> 
../persistent-input.rules
lrwxrwxrwx 1 root root   19 Oct  7  2006 z20_persistent.rules -> 
../persistent.rules
-rw-r--r-- 1 root root  580 Oct  9  2006 z25_persistent-net.rules
lrwxrwxrwx 1 root root   33 Oct  7  2006 z45_persistent-net-generator.rules -> 
../persistent-net-generator.rules
lrwxrwxrwx 1 root root   12 Oct  7  2006 z50_run.rules -> ../run.rules
lrwxrwxrwx 1 root root   16 Oct  7  2006 z55_hotplug.rules -> ../hotplug.rules
lrwxrwxrwx 1 root root   15 Oct  7  2006 z60_hdparm.rules -> ../hdparm.rules
-rw-r--r-- 1 root root 2589 Jun  3  2007 z60_libpisock9.rules
-rw-r--r-- 1 root root 5716 Jun  8  2007 z60_xserver-xorg-input-wacom.rules
lrwxrwxrwx 1 root root   29 Oct  7  2006 z75_cd-aliases-generator.rules -> 
../cd-aliases-generator.rules
lrwxrwxrwx 1 root root   12 Jan  5 21:19 z99_hal.rules -> ../hal.rules

-- /sys/:
/sys/block/fd0/dev
/sys/block/hda/dev
/sys/block/hda/hda1/dev
/sys/block/hda/hda10/dev
/sys/block/hda/hda11/dev
/sys/block/hda/hda12/dev
/sys/block/hda/hda13/dev
/sys/block/hda/hda14/dev
/sys/block/hda/hda15/dev
/sys/block/hda/hda16/dev
/sys/block/hda/hda17/dev
/sys/block/hda/hda18/dev
/sys/block/hda/hda19/dev
/sys/block/hda/hda2/dev
/sys/block/hda/hda20/dev
/sys/block/hda/hda21/dev
/sys/block/hda/hda22/dev
/sys/block/hda/hda23/dev
/sys/block/hda/hda24/dev
/sys/block/hda/hda25/dev
/sys/block/hda/hda3/dev
/sys/block/hda/hda4/dev
/sys/block/hda/hda5/dev
/sys/block/hda/hda6/dev
/sys/block/hda/hda7/dev
/sys/block/hda/hda8/dev
/sys/block/hda/hda9/dev
/sys/block/md0/dev
/sys/class/input/input0/event0/dev
/sys/class/input/input1/event1/dev
/sys/class/input/input2/event2/dev
/sys/class/input/input2/mouse0/dev
/sys/class/input/input2/ts0/dev
/sys/class/input/input3/event3/dev
/sys/class/input/input3/mouse1/dev
/sys/class/input/input3/ts1/dev
/sys/class/input/mice/dev
/sys/class/misc/agpgart/dev
/sys/class/misc/device-mapper/dev
/sys/class/misc/hw_random/dev
/sys/class/misc/nvram/dev
/sys/class/misc/psaux/dev
/sys/class/misc/rtc/dev
/sys/class/misc/snapshot/dev
/sys/class/printer/lp0/dev
/sys/class/sound/adsp/dev
/sys/class/sound/audio/dev
/sys/class/sound/controlC0/dev
/sys/class/sound/dsp/dev
/sys/class/sound/mixer/dev
/sys/class/sound/pcmC0D0c/dev
/sys/class/sound/pcmC0D0p/dev
/sys/class/sound/pcmC0D1c/dev
/sys/class/sound/timer/dev
/sys/class/usb_device/usbdev1.1/dev
/sys/class/usb_device/usbdev2.1/dev
/sys/class/usb_device/usbdev2.2/dev
/sys/class/usb_device/usbdev3.1/dev

-- Kernel configuration:
 isapnp_init not present.


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.17-2 (PREEMPT)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/bash

Versions of packages udev depends on:
ii  debconf [debconf-2.0]        1.5.17      Debian configuration management sy
ii  libc6                        2.7-5       GNU C Library: Shared libraries
ii  libselinux1                  2.0.15-2+b1 SELinux shared libraries
ii  libvolume-id0                0.114-2     libvolume_id shared library
ii  lsb-base                     3.1-24      Linux Standard Base 3.1 init scrip

udev recommends no packages.

-- debconf information:
  udev/new_kernel_needed: false
  udev/reboot_needed:



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to