Date: Sun, 7 Jun 2009 12:21:11 -1000 From: Clifton Royston <cliftonr@lava.net> To: Scott Ullrich <sullrich@gmail.com> Cc: AES <allnetgroup@yahoo.com>, freebsd-stable@freebsd.org, utisoft@gmail.com Subject: Re: I need to add commands that starts every time at system boot. Message-ID: <20090607222110.GA18662@lava.net> In-Reply-To: <d5992baf0906071312o60926fb5k837adae68dca0866@mail.gmail.com> References: <143776.42704.qm@web34307.mail.mud.yahoo.com> <20090607183035.GA22240@lava.net> <b79ecaef0906071236g3cc29114k37e4daa8206157f3@mail.gmail.com> <d5992baf0906071312o60926fb5k837adae68dca0866@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jun 07, 2009 at 04:12:41PM -0400, Scott Ullrich wrote: > On Sun, Jun 7, 2009 at 3:36 PM, Chris Rees<utisoft@googlemail.com> wrote: > > 2009/6/7 Clifton Royston <cliftonr@lava.net>: > > > >> If you feel you just *can't* do it via a script in > >> /usr/local/etc/rc.d, which is the better way, add a script called > >> /etc/rc.local and that will be run after all the other start-up steps. > > > > What's wrong with rc.local? > > Probably stems from this discussion: > http://lists.freebsd.org/pipermail/freebsd-stable/2007-July/035996.html No, I hadn't actually seen that discussion before. I used to work on BSD/OS, which had only the rc.local mechanism, and when I first switched over to FreeBSD it was what I used. Eventually I got my head around the /etc/rc.d and /usr/local/etc/rc.d mechanism and found it distinctly superior, so now I use it almost exclusively. Major highlights as to why are: * You can readily implement whatever additional operations your service should support, such as restart/shutdown/whatever; * you can add or remove different services as discrete entities, without having to merge their change or removal into a single text file; * the startup/shutdown script can therefore readily be packaged for removal/installation together with any other software for the service in question; * you can get your service or operation run in a specific order relative to other services; * you can use the same script to start, shutdown, or restart the service at another time if appropriate or necessary It used to be a little harder to write them than a few lines in rc.local, but now sourcing rc_subr provides shell functions which make it trivial. These days I only use rc.local if I need to do some kind of non-critical quick hack, e.g. for troubleshooting a problem. -- Clifton -- Clifton Royston -- cliftonr@iandicomputing.com / cliftonr@lava.net President - I and I Computing * http://www.iandicomputing.com/ Custom programming, network design, systems and network consulting services
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090607222110.GA18662>