#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-power/nut/files/upsd.rc6,v 1.3 2007/10/09 00:42:45 robbat2 Exp $ opts="reload" pidfile=/var/lib/nut/upsd.pid depend() { need net upsdrv before upsmon } start() { ebegin "Starting upsd" # clean up first pkill -u root -x upsd sleep 1s rm -f ${pidfile} # now start up start-stop-daemon --start --quiet --exec /usr/sbin/upsd eend $? } stop() { ebegin "Stopping upsd" start-stop-daemon --stop --quiet --pidfile ${pidfile} eend $? } reload() { ebegin "Reloading upsd" start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile ${pidfile} eend $? }