Hi Joey, 2008/4/9, Joey Hess <[EMAIL PROTECTED]>: > Package: nut > Version: 2.2.1-2.1 > Severity: normal > > I installed debian, installed nut, configured it to use a USB ups, and > started the daemon. Which failed. I rebooted and it was working. > > The UPS was plugged in throughout this, so the part of the postinst that > tries to apply the USB rules to already plugged in devices must not be > working. > > I reproduced the scenario by moving 52_nut-usbups.rules away, restarting > udevd, and unplugging and replugging the UPS. This resulted in: > > Bus 001 Device 009: ID 051d:0002 American Power Conversion Uninterruptible > Power Supply > > crw-rw---- 1 root root 189, 8 Apr 9 15:49 /dev/bus/usb/001/009 > > Then I put the rules file back in places ran the postinst code manually: > > [EMAIL PROTECTED]:~>pidof udevd > 3930 > [EMAIL PROTECTED]:~>/usr/bin/stat -c %d/%i / > 769/2 > [EMAIL PROTECTED]:~>/usr/bin/stat -Lc %d/%i /proc/3930/root > 769/2 > [EMAIL PROTECTED]:~>/usr/sbin/invoke-rc.d udev restart > [EMAIL PROTECTED]:~>dir /dev/bus/usb/001 > total 0 > drwxr-xr-x 2 root root 140 Apr 9 15:49 ./ > drwxr-xr-x 3 root root 60 Apr 9 15:41 ../ > crw-rw-r-- 1 root root 189, 0 Apr 9 15:41 001 > crw-rw---- 1 lp scanner 189, 5 Apr 9 15:49 006 > crw-rw---- 1 root root 189, 6 Apr 9 15:49 007 > crw-rw---- 1 root root 189, 7 Apr 9 15:49 008 > crw-rw---- 1 root root 189, 8 Apr 9 15:49 009 > > Seems that restarting udevd does not cause device entries for already plugged > in devices to change.
well, this part of the postinst process is not that reliable. It sometimes failed to some udev glitch. I recently found the right way to restart only the usb subsystem, and this has been applied on the Ubuntu packages. So the solution is to run the following at postinst time: $ udevtrigger --subsystem-match=usb_device Since I'm preparing NUT 2.2.2 (I should release the final upstream this week), I'll also take care of this. thanks for the report, Arnaud -- Linux / Unix Expert R&D - MGE Office Protection Systems - http://www.mgeops.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://people.debian.org/~aquette/ Free Software Developer - http://arnaud.quette.free.fr/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

