Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Feb 2008 18:52:26 +0100
From:      "Ivan Voras" <ivoras@freebsd.org>
To:        "Wojciech Puchar" <wojtek@wojtek.tensor.gdynia.pl>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: script to be executed on system startup.
Message-ID:  <9bbcef730802060952o178e654hbc0412127c7e887a@mail.gmail.com>
In-Reply-To: <20080206163423.E4029@wojtek.tensor.gdynia.pl>
References:  <1563a4fd0802060609j59451879h3920be790d7667c0@mail.gmail.com> <fochm5$gre$1@ger.gmane.org> <20080206163423.E4029@wojtek.tensor.gdynia.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
On 06/02/2008, Wojciech Puchar <wojtek@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. 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.

I spent a few days playing with the rc.d mechanism and it's awesome.



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