From owner-acpi-jp@jp.FreeBSD.org Tue Dec 16 16:06:19 2003
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) id hBG76J186720;
	Tue, 16 Dec 2003 16:06:19 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from rootlabs.com (root.org [67.118.192.226])
	by castle.jp.FreeBSD.org (8.11.6p2+3.4W/8.11.3) with SMTP/inet id hBG76HM86715
	for <acpi-jp@jp.freebsd.org>; Tue, 16 Dec 2003 16:06:18 +0900 (JST)
	(envelope-from nate@rootlabs.com)
Received: (qmail 65350 invoked by uid 1000); 16 Dec 2003 07:06:13 -0000
From: Nate Lawson <nate@root.org>
To: Mike Makonnen <mtm@identd.net>
cc: arch@freebsd.org, acpi-jp@jp.FreeBSD.org
In-Reply-To: <20031215095238.GB840@mobile.acsolutions.com>
Message-ID: <20031215230535.S65338@root.org>
References: <20031213130351.N59162@root.org> <20031215095238.GB840@mobile.acsolutions.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
Date: Mon, 15 Dec 2003 23:06:13 -0800
X-Sequence: acpi-jp 2915
Subject: [acpi-jp 2915] Re: Power profile script
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: nate@root.org
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+031215

On Mon, 15 Dec 2003, Mike Makonnen wrote:
> On Sat, Dec 13, 2003 at 01:12:03PM -0800, Nate Lawson wrote:
> >
> > I'm mostly looking for style input on the /etc/power_profile script since
> > I'm not familiar with our scripting guidelines.  Note that it's called
> > from devd (or manually by the user) and is not an rc.d boot-time thing.
>
> /etc/rc.d is not just for boot time scripts. You can put 'nostart' in
> the script's KEYWORD section if you don't want it processed at boot time.
> My personal feeling is that if it is configured through rc.conf then it
> should go in /etc/rc.d, but I won't insist on it.
>
> > +
> > +# Pull in default values.
> > +if [ -r /etc/defaults/rc.conf ]; then
> > +	. /etc/defaults/rc.conf
> > +	source_rc_confs
> > +elif [ -r /etc/rc.conf ]; then
> > +	. /etc/rc.conf
> > +fi
>
> Please source /etc/rc.subr and use the load_rc_config() routine
> to do this. Usage: load_rc_config $command. If you don't want
> it to source a /etc/rc.conf.d/$command file, then just use 'XXX'
> as its argument.
>
> > +
> > +if [ $# -ne 1 ]; then
> > +	echo "Usage: $0 [0x00|0x01]"
> > +	exit 1
> > +fi
>
> There are also other convenience routines in that file
> that you may wish to use. For example the err() routine
> might be of use in the above situation.

Ok, thanks for the comments.  I'll address these and anything else I can
pull from rc.subr and then run it by you before committing.

-Nate
