From owner-freebsd-questions@FreeBSD.ORG Sat Feb 9 19:02:51 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 860BE16A417 for ; Sat, 9 Feb 2008 19:02:51 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from mail.bsdforen.de (bsdforen.de [212.204.60.79]) by mx1.freebsd.org (Postfix) with ESMTP id 3ECAE13C4D5 for ; Sat, 9 Feb 2008 19:02:51 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from mobileKamikaze.norad (nat-wh-1.rz.uni-karlsruhe.de [129.13.72.169]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bsdforen.de (Postfix) with ESMTP id 136CB405488; Sat, 9 Feb 2008 20:02:48 +0100 (CET) Message-ID: <47ADF8D8.8060306@bsdforen.de> Date: Sat, 09 Feb 2008 20:02:48 +0100 From: Dominic Fandrey User-Agent: Thunderbird 2.0.0.9 (X11/20080205) MIME-Version: 1.0 To: Matthew Seaman References: <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <47A9FB98.4020907@bsdforen.de> <1563a4fd0802070549r71731883t9d606a2e62f67d4d@mail.gmail.com> <20080209174516.7f82a967@gumby.homeunix.com.> <47ADEF6F.3050305@infracaninophile.co.uk> In-Reply-To: <47ADEF6F.3050305@infracaninophile.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: RW , 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 19:02:51 -0000 Matthew Seaman wrote: > -----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. Though undocumented, this statement is not valid for scripts in /usr/local/etc/rc.d. The scripts there are /always/ run in a sub-shell, no matter their ending.