[Nut-upsuser] Mustek PowerMust 600 USB configuration

Alexander I. Gordeev lasaine at lvk.cs.msu.su
Thu Nov 13 00:02:25 UTC 2008


On Wednesday 12 November 2008 23:35:25 you wrote:
> hey there,
>
> atm, the install fails due to the missing udevadm binary (part of the
> udev package).
> @Janeks: don't you have a udev installed on your box?
> @Alex: a possible enhancement for debian/nut.postinst is to test
> udevadm existance before firing it... ;-)

I just investigated a bit further. This is a diff of debian/nut.postinst
between trunk and lenny package source:

--- development/nut/trunk/debian/nut.postinst   2008-05-07 16:17:54.000000000 +0400
+++ tmp/nut/nut-2.2.2/debian/nut.postinst       2008-11-13 02:37:06.000000000 +0300
@@ -25,7 +25,7 @@
         if [ "$(/usr/bin/stat -c %d/%i /)" = "$(/usr/bin/stat -Lc %d/%i /proc/$udevd_pid/root 2>/dev/null)" ];
         then
             # coldplug replay on the USB bus only
-            /sbin/udevtrigger --subsystem-match=usb_device
+            /sbin/udevadm trigger --subsystem-match=usb_device
         fi
     fi
     ;;

Funny enough udevadm is missing in etch and udevtrigger is missing in
lenny :)
I think, if this is the only reason to have udev version >= 0.124-1 it's
much better to fix this by checking which binary is present. And remove
this explicit version dependency :)

P.S. Chacked the bug #489831. Seems it is indeed the only reason!
So I suggest this fix for lenny:

--- nut-2.2.2.orig/debian/nut.postinst  2008-11-13 02:37:06.000000000 +0300
+++ nut-2.2.2/debian/nut.postinst       2008-11-13 03:01:16.000000000 +0300
@@ -25,7 +25,11 @@
         if [ "$(/usr/bin/stat -c %d/%i /)" = "$(/usr/bin/stat -Lc %d/%i /proc/$udevd_pid/root 2>/dev/null)" ];
         then
             # coldplug replay on the USB bus only
-            /sbin/udevadm trigger --subsystem-match=usb_device
+            if [ -x /sbin/udevadm ]; then
+                /sbin/udevadm trigger --subsystem-match=usb_device
+            else
+                /sbin/udevtrigger --subsystem-match=usb_device
+            fi
         fi
     fi
     ;;


--
  Alexander



More information about the Nut-upsuser mailing list