pkgsrc/sysutils/ups-nut/files/upsd.sh
ghen 42a14ab556 rc.d scripts: upsmon does not require upsd <running on the same machine>, but
still, upsd should start before upsmon when they are running on the same
machine.  The current setup (where upsmon.sh has REQUIRE: upsd) results in
errors like "rcorder: requirement `upsd' in file `upsmon' has no providers."
when you don't copy the upsd script to /etc/rc.d and set upsd=NO in
/etc/rc.conf.

Hence, remove REQUIRE: upsd from upsmon.sh and add BEFORE: upsmon to upsd.sh,
as suggested by jnemeth on tech-userlevel@.  Bump PKGREVISION.
2006-08-15 12:07:15 +00:00

28 lines
486 B
Bash

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: upsd.sh,v 1.7 2006/08/15 12:07:15 ghen Exp $
#
# PROVIDE: upsd
# REQUIRE: upsdriver
# BEFORE: upsmon
# KEYWORD: shutdown
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="upsd"
rcvar=$name
command="@PREFIX@/sbin/${name}"
required_files="@NUT_CONFDIR@/${name}.conf"
pidfile="@NUT_STATEDIR@/${name}.pid"
if [ -f /etc/rc.subr ]
then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
${command} ${upsd_flags} ${command_args}
fi