Subject: Re: ups-nut rc.d scripts
To: Luke Mewburn <lukem@wasabisystems.com>
From: Johnny Lam <jlam@jgrind.org>
List: tech-pkg
Date: 11/20/2001 19:55:32
On Wed, Nov 21, 2001 at 12:38:24PM +1100, Luke Mewburn wrote:
>
> #!/bin/sh
> #
> # $Id: upsdriver,v 1.1 2001/11/19 02:42:30 lukem Exp $
> 
> # PROVIDE: upsdriver
> # REQUIRE: NETWORK syslogd mountcritremote
> 
> . /etc/rc.subr
> 
> #
> # XXX	need a way to easily determine the pidfile, which is of the form
> #		/var/db/nut/${updriver_type}-${tty}.pid
> #
> 
> name="upsdriver"
> rcvar=$name
> load_rc_config $name
> command="/usr/pkg/bin/${upsdriver_type}"
> run_rc_command "$1"

The ups-nut design has changed, and I think the recommended way to start
and stop the drivers now is through "upsdrvctl start|stop".  If we use
upsdrvctl, then we don't need to figure out the pidfile name as it's
taken care of by the program.  Using the argument as to why nmbd and smbd
in net/samba should be controlled by the same script, I argue that the the
UPS driver programs and upsd should be controlled by the same script: it
doesn't make sense to start one without the other.

> #!/bin/sh
> #
> # $Id: upsmon,v 1.1 2001/11/19 02:43:01 lukem Exp $
> 
> # PROVIDE: upsmon
> # REQUIRE: upsd

I don't think upsmon should require upsd.  According to the ups-nut design
document, upsmon is a client that may be run from anywhere.

> #!/bin/sh
> #
> # $Id: upslog,v 1.2 2001/11/19 02:42:48 lukem Exp $
> 
> # PROVIDE: upslog
> # REQUIRE: upsd
> 
> . /etc/rc.subr
> 
> name="upslog"
> rcvar=$name
> load_rc_config $name
> command="/usr/pkg/bin/${name}"
> pidfile="/var/run/${name}.pid"
> run_rc_command "$1"

This script looks good; I'll add it to the other changes I'm making to the
ups-nut package.

	Cheers,

	-- Johnny Lam <jlam@jgrind.org>