Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 09 Feb 2008 18:22:39 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        RW <fbsd06@mlists.homeunix.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: script to be executed on system startup.
Message-ID:  <47ADEF6F.3050305@infracaninophile.co.uk>
In-Reply-To: <20080209174516.7f82a967@gumby.homeunix.com.>
References:  <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com>	<47A9FB98.4020907@bsdforen.de>	<1563a4fd0802070549r71731883t9d606a2e62f67d4d@mail.gmail.com> <20080209174516.7f82a967@gumby.homeunix.com.>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

RW wrote:
> On Thu, 7 Feb 2008 19:19:48 +0530
> "navneet Upadhyay" <navneet.upadhyay@gmail.com> 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-----



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