#!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-power/nut/files/nut-2.2.2-init.d-upsd,v 1.2 2011/12/04 10:43:19 swegener Exp $ extra_started_commands="reload" pidfile=/var/lib/nut/upsd.pid bin=/usr/sbin/upsd depend() { need net before upsmon after upsdrv } start() { ebegin "Starting upsd" # clean up first pkill -u root,nut -x ${bin} sleep 1s rm -f ${pidfile} # now start up start-stop-daemon --start --quiet --exec ${bin} 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 $? }