starting daemons at server start

freebsd at xzozx.net freebsd at xzozx.net
Sun Jan 4 13:01:12 PST 2004


There are numerous ways for daemons to start on boot:
----------
1) Via their enabling in /etc/rc.conf (e.g. inetd, lpd)
e.g. lpd_enable="YES".

Look at /etc/defaults/rc.conf for things that will start (or not start)
automatically unless they are overridden in /etc/rc.conf.

Inetd is an good example of this (it defaults to start, unlike lpd) - in
/etc/defaults/rc.conf, the line:
inetd_enable="YES"
is there, which makes inetd start in boot unless
inetd_enable="NO"
were specified in /etc/rc.conf

2) Via /usr/local/etc/rc.d/*.sh scripts (e.g. samba) - the ports put
scripts in this directory.

e.g. When samba is installed from the ports tree or via sysinstall, it
creates /usr/local/etc/rc.d/samba.sh.sample.  You must copy or rename it
to /usr/local/etc/rc.d/samba.sh to have samba start on boot.   Obviously a
working smb.conf file is required.  The install of samba also creates
/usr/local/etc/smb.conf.default - you must copy or rename it to smb.conf,
then edit it as suitable for your environment.  Other ports typically
install sample config files and startup scripts in /usr/local/etc and
/usr/local/etc/rc.d respectively.

3) Via /usr/local/etc/rc.d/*.sh scripts and /etc/rc.conf (e.g. proftpd
from the ports)

e.g. proftpd requires both an entry in /etc/rc.conf - proftpd_enable="YES"
and /usr/local/etc/rc.d/proftpd.sh

This behavior of requiring both entries (on 4.x) started sometime last
year (see rc.subr in the ports tree)

4) Via /etc/rc.local
Anything you put in here will start on boot, e.g.
balance 3389 ts1 ts2    (this command happens to balance MS terminal
server sessions between the hosts named "ts1" and "ts2") if the port
"balance" is installed, othewise the command just fails.

----------

As mentioned in the thread - inetd is a super server that spawns other
processes to answer requests for services.  see /etc/inetd.conf for things
it "responds" to.

Paul


> Micke P wrote:
>
>>Right! Ok, it's definitely not inetd that I need. I'm
>>thinking primarily of starting apache and a dynamic ip
>>updater automatically at startup.
>>
>>Micke
>>
>>
>>--- fbsd_user <fbsd_user at a1poweruser.com> wrote:
>>
>>
>>>Maybe you just don't understand what you are seeing.
>>>Inetd is the
>>>Super server. Every thing you uncomment in the
>>>inetd.conf file is an
>>>server of it own right. But instead of an daemon
>>>running for telnet
>>>or FTP all the time. Inetd runs and listens on the
>>>ports where those
>>>services would be listings and when inetd sees an
>>>request on the
>>>specified port it automatically launches the server
>>>for that
>>>service. With inetd running , ps ax only shows inetd
>>>running, but
>>>start an telnet session to your box and you will see
>>>that inetd has
>>>spawned an telnet server session. When your telnet
>>>users leaves the
>>>session, the telnet server terminates. Inetd is used
>>>to conserve
>>>resources.
>>>
>>>
> If you installed apache from ports, there should already be a
> apache-dist.sh script in /usr/local/etc/rc.d .
> Copy it to apache.sh, chmod 600 (or at least make it executable), and
> apache should start at system reboot.
>
> Scott
>
>
> _______________________________________________
> 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