From owner-freebsd-questions Thu Jul 19 19:34:45 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id 33FAF37B406 for ; Thu, 19 Jul 2001 19:34:41 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 57921 invoked by uid 100); 20 Jul 2001 02:34:40 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15191.39104.117314.161034@guru.mired.org> Date: Thu, 19 Jul 2001 21:34:40 -0500 To: Ronnie Clark Cc: questions@freebsd.org Subject: Re: startup script In-Reply-To: <104175447@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Ronnie Clark 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 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