[MBT] new ticket for pkg nut "Starting script doesn't start ups driver (patch included)"

bugs at pld.org.pl bugs at pld.org.pl
Sun Oct 27 13:56:36 CET 2002


Date: 2002-10-27 13:56:36+01	Author: Łukasz Maśko (paranoid) <masko at ipipan.waw.pl> 
Title:         Starting script doesn't start ups driver (patch included)
Ticket ID:     #407
Ticket URL:    http://bugs.pld.org.pl/?bug=407
Package:       nut-1.0.0-3
Distribution:  PLD-1.0.devel.main
Category:      improve request
Current state: opened
Text:

The /etc/rc.d/init.d/ups script doesn't start the ups driver any more in the latest version (it worked in 1.0.0-1). The proper patch is included below:

--- ups.orig    Wed Oct  9 15:52:00 2002
+++ ups.new     Sun Oct 27 13:50:11 2002
@@ -27,10 +27,14 @@
   start)
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/ups ]; then
-               msg_starting "UPS network daemon"
-               daemon "upsd $OPTIONS"
-               RETVAL=$?
-               touch /var/lock/subsys/ups
+               show "Starting UPS drivers"
+               daemon /usr/lib/nut/upsdrvctl start
+               if [ $? -eq 0 ]; then
+                       msg_starting "UPS network daemon"
+                       daemon "upsd $OPTIONS"
+                       RETVAL=$?
+                       touch /var/lock/subsys/ups
+               fi
        else
                msg_Already_Running "UPS drivers and network daemon"
        fi
@@ -39,6 +43,8 @@
        if [ -f /var/lock/subsys/ups ]; then
                msg_stopping "UPS daemon"
                killproc upsd
+               show "Stopping UPS drivers"
+               daemon /usr/lib/nut/upsdrvctl stop
                RETVAL=$?
                rm -f /var/lock/subsys/ups
        else
@@ -50,6 +56,8 @@
        {TEXT} start
        ;;
   reload)
+       msg_reloading "UPS drivers"
+       daemon /usr/lib/nut/upsdrvctl reload
        msg_reloading "UPS network daemon"
        daemon upsd -c reload
        ;;





More information about the pld-bugs mailing list