| From | Sent On | Attachments |
|---|---|---|
| navneet Upadhyay | Feb 6, 2008 6:09 am | |
| Pietro Cerutti | Feb 6, 2008 6:22 am | |
| Derek Ragona | Feb 6, 2008 6:22 am | |
| Wojciech Puchar | Feb 6, 2008 6:31 am | |
| navneet Upadhyay | Feb 6, 2008 6:33 am | |
| Derek Ragona | Feb 6, 2008 6:44 am | |
| Ivan Voras | Feb 6, 2008 6:53 am | |
| Ivan Voras | Feb 6, 2008 6:59 am | |
| Wojciech Puchar | Feb 6, 2008 7:35 am | |
| Zbigniew Szalbot | Feb 6, 2008 7:39 am | |
| Jerry McAllister | Feb 6, 2008 7:40 am | |
| Jerry McAllister | Feb 6, 2008 7:46 am | |
| Jerry McAllister | Feb 6, 2008 7:52 am | |
| Zbigniew Szalbot | Feb 6, 2008 7:54 am | |
| Wojciech Puchar | Feb 6, 2008 8:49 am | |
| Zbigniew Szalbot | Feb 6, 2008 8:51 am | |
| Alex Zbyslaw | Feb 6, 2008 9:22 am | |
| Jerry McAllister | Feb 6, 2008 9:29 am | |
| Paul Schmehl | Feb 6, 2008 9:35 am | |
| Ivan Voras | Feb 6, 2008 9:52 am | |
| Dominic Fandrey | Feb 6, 2008 10:50 am | |
| RW | Feb 6, 2008 10:56 am | |
| RW | Feb 6, 2008 11:03 am | |
| Ivan Voras | Feb 7, 2008 2:16 am | |
| navneet Upadhyay | Feb 7, 2008 5:49 am | |
| RW | Feb 9, 2008 10:10 am | |
| Matthew Seaman | Feb 9, 2008 10:22 am | |
| Dominic Fandrey | Feb 9, 2008 11:02 am | |
| RW | Feb 9, 2008 7:03 pm |
| Subject: | script to be executed on system startup. | |
|---|---|---|
| From: | RW (fbs...@mlists.homeunix.com) | |
| Date: | Feb 9, 2008 7:03:25 pm | |
| List: | org.freebsd.freebsd-questions | |
On Sat, 09 Feb 2008 18:22:39 +0000 Matthew Seaman <m.se...@infracaninophile.co.uk> wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
RW wrote:
On Thu, 7 Feb 2008 19:19:48 +0530 "navneet Upadhyay" <navn...@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.
There's a bit more to it than that I think.
As I understand it, local scripts that contain a "# PROVIDE" line are integrated into rcorder, local scripts that don't have that line, but end in .sh, are executed from /etc/rc.d/localpkg in the old-style. AFAIK local scripts that have neither are ignored.
So in short, a user script that simply responds to start/stop needs to go /usr/local/etc/rc.d/, and it does need a .sh extension.





