Best Way to Start an App at Boot Time?

Jerry McAllister jerrymc at clunix.cl.msu.edu
Sat Mar 18 21:16:12 UTC 2006


> 
> Hello Robert,
> 
> robert wrote:
> > rc.local is not normally used with later versions of Freebsd - see man
> > rc.local. 
> > 
> > The script should tell you how to use it, but normally it should be
> > added to /usr/local/etc/rc.d and called from /etc/rc.conf with something
> > like denyhosts="YES".

You are mostly right, but a quibble about your terminology.

You do not 'call' it from /etc/rc.conf (or /etc/rc/conf.local)
by putting in the denyhosts="YES" line.

Putting the denyhosts="YES" line in rc.conf sets that as an environment
variable which the script in /usr/local/etc/rc.d can examine and
decide whether to do its thing or not.

There is another process that runs during startup.  It obtains a list
of the contents of the /usr/local/etc/rc.d directory.  It then executes 
all of the files whose name ends in .sh and has execute permission set 
on them.  Each of them is run in turn and given the single parameter 
of 'start'.

Those files are normally scripts and they are given the environment variables
of rc.conf (and rc.conf.local or another if there is an include for it).

Obviously, you could put a statement in rc.conf that causes something
to run right then, but that is not the expected way to do it.

////jerry

> 
> Nice to know this :), thank you.
> 
> Martin
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
> 



More information about the freebsd-questions mailing list