From owner-freebsd-questions@FreeBSD.ORG Sat Feb 9 18:22:46 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 247AC16A418 for ; Sat, 9 Feb 2008 18:22:46 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id B2B2613C442 for ; Sat, 9 Feb 2008 18:22:44 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.14.2/8.14.2) with ESMTP id m19IMdpF062752; Sat, 9 Feb 2008 18:22:40 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.4.4 smtp.infracaninophile.co.uk m19IMdpF062752 Authentication-Results: smtp.infracaninophile.co.uk; dkim=hardfail (SSP) header.i=unknown Message-ID: <47ADEF6F.3050305@infracaninophile.co.uk> Date: Sat, 09 Feb 2008 18:22:39 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.9 (X11/20080209) MIME-Version: 1.0 To: RW References: <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <47A9FB98.4020907@bsdforen.de> <1563a4fd0802070549r71731883t9d606a2e62f67d4d@mail.gmail.com> <20080209174516.7f82a967@gumby.homeunix.com.> In-Reply-To: <20080209174516.7f82a967@gumby.homeunix.com.> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (smtp.infracaninophile.co.uk [IPv6:::1]); Sat, 09 Feb 2008 18:22:40 +0000 (GMT) X-Virus-Scanned: ClamAV 0.92/5760/Sat Feb 9 16:38:42 2008 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: script to be executed on system startup. 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: Sat, 09 Feb 2008 18:22:46 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 RW wrote: > On Thu, 7 Feb 2008 19:19:48 +0530 > "navneet Upadhyay" wrote: > >> Hi, >> After putting my script to /etc/rc.d , it gets executed at >> startup and the parameter passed to the script is *faststart .* >> *I want the same script to be executed when system shuts down , how >> can i do that.* > > Don't put it in /etc/rc.d/, give it a .sh extension and put it > in /usr/local/etc/rc.d/. It will then get stop/start arguments. No need to force it to have a .sh extension in /usr/local/etc/rc.d/ nowadays. In fact, rather the contrary as a .sh extension causes the script to be run in the context of the rc process rather than in a sub-shell. In FreeBSD 6.2+ /usr/local/etc/rc.d/ is totally integrated with /etc/rc.d and treated exactly the same. The system re-runs rcorder over both of those directories once it has got to the stage of mounting all the critical filesystems. So you can have 3rd party software and schedule it to be started up earlier than some components of the base system if necessary. Cheers, Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHre9u8Mjk52CukIwRCA8GAJwILJQ5CmouTDbcLL0aK6BQFza6BgCeNHMI ErzMpScJU0pMKJTNNdvzA2c= =BFq8 -----END PGP SIGNATURE-----