3 PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
9 PID
=`pidof -o %PPID /usr/sbin/upsd`
11 # POWERDOWNFLAG *must* match that in upsmon.conf
12 # Loading POWERDOWNFLAG from /etc/sysconfig/ups
13 DRIVERPATH
=/usr
/lib
/nut
14 if [ -f /etc
/nut
/ups
]; then
17 POWERDOWNFLAG
=/etc
/killpower
20 UPSDCONF
=/etc
/nut
/upsd.conf
21 UPSCONF
=/etc
/nut
/ups.conf
23 # if there are no config file, bail out
24 [ -f $UPSDCONF ] && [ -f $UPSCONF ] ||
exit 0
29 if [ "$BOOTUP" = "color" ]; then
30 $
* && echo_success || echo_failure
37 # See how we are called.
40 # new style drivers uses 'upsdrvctl'
41 echo -n "NUT Starting UPS model drivers: "
42 # starting ase nut user
43 daemon
--user $NUTUSER `which upsdrvctl` start
46 echo -n "NUT Starting UPS daemon: "
47 # starting ase nut user
48 daemon upsd
-u $NUTUSER
50 touch /var
/lock
/subsys
/upsd
56 action
"NUT Stopping UPS daemon" \
58 # new style drivers uses 'upsdrvctl'
59 action
"NUT Stopping UPS model drivers" \
62 rm -f /var
/lock
/subsys
/upsd
67 runcmd
"NUT powerdown of attached UPS(es)" upsdrvctl shutdown
76 # reloading upsd config files
77 action
"NUT Reloading config files" \
83 action
"NUT: checking UPS model drivers" upsdrvctl status
88 echo "Usage: upsd {start|stop|powerdown|restart|reload|status}"