Package: apcupsd
Version: 3.10.15-3
Severity: wishlist

Dear Maintainer,

It would be very useful to have next patch applied. It let me start 3
independent apcupsd to manage 3 attached (1 serial+2 usb) APCs with no
harm. Of cause they all should have separate configuration files
/etc/apcupsd/apcupsd*conf with different port numbers
assigned. Besides that it is very easy to setup and use.

Besides that it has a bit improved reporting of the problem if
start/stop failed

Here is the patch

--------------starts
--- apcupsd.dpkg-dist   2005-02-07 13:28:33.000000000 -0500
+++ apcupsd     2005-02-08 14:00:36.071268581 -0500
@@ -6,6 +6,8 @@
 
 DAEMON=/sbin/apcupsd
 CONFIG=/etc/default/apcupsd
+CONFIGFILES=/etc/apcupsd/apcupsd*.conf
+POWERFAIL=/var/spool/apcupsd/powerfail
 
 test -x $DAEMON || exit 0
 
@@ -25,23 +27,34 @@
 case "$1" in
        start)
                echo -n "Starting APC UPS power management: "
-               rm -f /var/spool/apcupsd/powerfail
-               if [ "`pidof apcupsd`" = "" ]
-               then
-                       start-stop-daemon --start --quiet --exec $DAEMON 
-                       echo "apcupsd."
-               else
-                       echo ""
-                       echo "A copy of the daemon is still running.  If you 
just stopped it,"
-                       echo "please wait about 5 seconds for it to shut down."
-                       exit 0
-               fi
+               rm -f $POWERFAIL
+               for f in $CONFIGFILES
+               do
+                  PIDFILE=`echo $f | sed 
's/.*apcupsd\([^.]*\).conf/\/var\/run\/apcupsd\1.pid/g'`
+                  echo -n "$PIDFILE "
+                  if [ ! -e /proc/`cat /var/run/apcupsd.pid` ]
+                  then
+                      start-stop-daemon --start --pidfile $PIDFILE --quiet 
--exec $DAEMON -- -f $f -P $PIDFILE \
+                          || echo -n "failed! "
+#                     sleep 2
+                  else
+                      echo ""
+                      echo "A copy of the daemon is still running.  If you 
just stopped it,"
+                      echo "please wait about 5 seconds for it to shut down."
+                      exit 0
+                  fi
+               done
+               echo ""
        ;;
        stop)
                echo -n "Stopping APC UPS power management: "
-               #start-stop-daemon --stop --quiet --exec $DAEMON
-               echo "apcupsd." 
-               start-stop-daemon --stop --pidfile /var/run/apcupsd.pid || echo 
"Not Running." 
+               for f in $CONFIGFILES
+               do
+                  PIDFILE=`echo $f | sed 
's/.*apcupsd\([^.]*\).conf/\/var\/run\/apcupsd\1.pid/g'`
+                  echo -n "$PIDFILE "
+                  start-stop-daemon --stop --pidfile $PIDFILE --quiet --exec 
$DAEMON \
+                    || echo -n "failed: not running? "
+               done
                echo ""
 
        ;;

--------------ends

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8.1
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R

Versions of packages apcupsd depends on:
ii  libc6                       2.3.2.ds1-18 GNU C Library: Shared libraries an
ii  libgd2-xpm                  2.0.28-2     GD Graphics Library version 2
ii  libncurses5                 5.4-4        Shared libraries for terminal hand
ii  libsnmp4.2                  4.2.5-3.5    NET SNMP (Simple Network Managemen
ii  libssl0.9.7                 0.9.7d-5     SSL shared libraries
ii  libwrap0                    7.6.dbs-6    Wietse Venema's TCP wrappers libra
ii  logrotate                   3.7-2        Log rotation utility

-- no debconf information


--Yarik


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

Reply via email to