Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jul 2001 21:34:40 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Ronnie Clark <RClark@swst.com>
Cc:        questions@freebsd.org
Subject:   Re: startup script
Message-ID:  <15191.39104.117314.161034@guru.mired.org>
In-Reply-To: <104175447@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Ronnie Clark <RClark@swst.com> types:
> Where would I put a start up script in FreeBSD 4.2? I thought it was
> /etc/rc.local, but I don't seem to have that file.

It isn't used by the system, but will be run if it exists for
backwards compatabillity. Most things now go in /usr/local/etc/rc.d as
a script. It must be executable, and the name must end in .sh. It
should also check for the arguments "start" and "stop" so it can be
used at system startup and system shutdown time. Here's a trivial
example:

#!/bin/sh

MIXERSTATE=/var/db/mixer-state

case $1 in
start)
    [ -r $MIXERSTATE ] && /usr/sbin/mixer `cat $MIXERSTATE` > /dev/null
    ;;
stop)
    /usr/sbin/mixer -s > $MIXERSTATE
    ;;
*)
    echo "usage: `basename $0` {start|stop}" >&2
    exit 64
    ;;
esac

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15191.39104.117314.161034>