/etc/init.d/apcupsd is in apcupsd 3.14.14-0.3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #!/bin/sh
### BEGIN INIT INFO
# Provides: apcupsd
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts apcupsd daemon
# Description: apcupsd provides UPS power management for APC products.
### END INIT INFO
test -f /lib/lsb/init-functions || exit 1
. /lib/lsb/init-functions
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/sbin/apcupsd
CONFIG=/etc/default/apcupsd
NAME=apcupsd
DESC="UPS power management"
APCACCESS=/sbin/apcaccess
test -x $DAEMON || exit 0
test -e $CONFIG || exit 0
set -e
. $CONFIG
if [ "x$ISCONFIGURED" != "xyes" ] ;
then
echo "Please check your configuration ISCONFIGURED in /etc/default/apcupsd"
exit 0
fi
case "$1" in
start)
echo -n "Starting $DESC: "
/lib/apcupsd/prestart
if [ "`pidof apcupsd`" = "" ]
then
start-stop-daemon --start --quiet --exec $DAEMON
echo "$NAME."
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
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --oknodo --pidfile /var/run/apcupsd.pid || echo "Not Running."
rm -f /var/run/apcupsd.pid
echo "$NAME."
;;
restart|force-reload)
$0 stop
sleep 10
$0 start
;;
status)
$APCACCESS status
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
|