atom feed29 messages in org.freebsd.freebsd-questionsscript to be executed on system startup.
FromSent OnAttachments
navneet UpadhyayFeb 6, 2008 6:09 am 
Pietro CeruttiFeb 6, 2008 6:22 am 
Derek RagonaFeb 6, 2008 6:22 am 
Wojciech PucharFeb 6, 2008 6:31 am 
navneet UpadhyayFeb 6, 2008 6:33 am 
Derek RagonaFeb 6, 2008 6:44 am 
Ivan VorasFeb 6, 2008 6:53 am 
Ivan VorasFeb 6, 2008 6:59 am 
Wojciech PucharFeb 6, 2008 7:35 am 
Zbigniew SzalbotFeb 6, 2008 7:39 am 
Jerry McAllisterFeb 6, 2008 7:40 am 
Jerry McAllisterFeb 6, 2008 7:46 am 
Jerry McAllisterFeb 6, 2008 7:52 am 
Zbigniew SzalbotFeb 6, 2008 7:54 am 
Wojciech PucharFeb 6, 2008 8:49 am 
Zbigniew SzalbotFeb 6, 2008 8:51 am 
Alex ZbyslawFeb 6, 2008 9:22 am 
Jerry McAllisterFeb 6, 2008 9:29 am 
Paul SchmehlFeb 6, 2008 9:35 am 
Ivan VorasFeb 6, 2008 9:52 am 
Dominic FandreyFeb 6, 2008 10:50 am 
RWFeb 6, 2008 10:56 am 
RWFeb 6, 2008 11:03 am 
Ivan VorasFeb 7, 2008 2:16 am 
navneet UpadhyayFeb 7, 2008 5:49 am 
RWFeb 9, 2008 10:10 am 
Matthew SeamanFeb 9, 2008 10:22 am 
Dominic FandreyFeb 9, 2008 11:02 am 
RWFeb 9, 2008 7:03 pm 
Subject:script to be executed on system startup.
From:RW (fbs@mlists.homeunix.com)
Date:Feb 6, 2008 10:56:15 am
List:org.freebsd.freebsd-questions

On Wed, 6 Feb 2008 18:52:26 +0100 "Ivan Voras" <ivo@freebsd.org> wrote:

On 06/02/2008, Wojciech Puchar <woj@wojtek.tensor.gdynia.pl> wrote:

(for example: "/etc/rc.d/myscript") 2. chmod a+x the script 3. you're done.

This will work for the recent versions of FreeBSD (you didn't say for which version do you need it).

you need to make that script react for "start" and "stop" commands at least

You *can*, but you don't *need* to, if in a hurry :) The script will be executed once at startup, and it can parse the "start" argument given to it, but it doesn't have to.

In a proper RCNG script you don't parse stop/start, you override the stop/start functions. Parsing $1 directly is how the old-style scripts use to work, but the base system and most ports now use the RCNG framework.

Yes, it's somewhat dirty if you ignore start/stop arguments (and if you ignore them you can't rely on nice built-in features like "restart" internally executing stop, then start) but it works.

It depends, if the script is just starting a daemon then it can simply use the default start/stop handlers, and stop/start/restart works without any explicit handling.