From owner-freebsd-questions@FreeBSD.ORG Fri Jun 1 11:40:09 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EAD116A400 for ; Fri, 1 Jun 2007 11:40:09 +0000 (UTC) (envelope-from fbsd06@mlists.homeunix.com) Received: from mxout-03.mxes.net (mxout-03.mxes.net [216.86.168.178]) by mx1.freebsd.org (Postfix) with ESMTP id 294CA13C46C for ; Fri, 1 Jun 2007 11:40:09 +0000 (UTC) (envelope-from fbsd06@mlists.homeunix.com) Received: from gumby.homeunix.com. (unknown [87.81.140.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTP id 1241651925 for ; Fri, 1 Jun 2007 07:40:06 -0400 (EDT) Date: Fri, 1 Jun 2007 12:40:01 +0100 From: RW To: freebsd-questions@freebsd.org Message-ID: <20070601124001.7c02a4ce@gumby.homeunix.com.> In-Reply-To: <10902043.post@talk.nabble.com> References: <10902043.post@talk.nabble.com> X-Mailer: Claws Mail 2.9.2 (GTK+ 2.10.12; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: startup / shutdown script (rc.d) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2007 11:40:09 -0000 On Thu, 31 May 2007 14:06:45 -0700 (PDT) gmoniey wrote: > > Hi, > > I was wondering if there is a simple way to create 1 script that will > be called during startup and shutdown. Basically, I am looking for > something like this: > > if startup > run command 1 with params > run command 2 with params > run command 3 with params > > if shutdown > run command 4 with params > run command 5 with params > run command 6 with params > > i have tried lookin up rc.d documentation, but it very vague and > difficult to understand...thanks There are lots of existing scripts that do this kind of thing. A good example is /etc/rc.d/random which feeds entropy files to /dev/random on startup, and writes-out entropy on shutdown. It's pretty easy to see what's going-on.