Many users install third party software on FreeBSD from the
Ports Collection and require the installed services to be
started upon system initialization. Services,
such as mail/postfix or
www/apache22 are just two of
the many software packages which may be started during system
initialization. This section explains the procedures available
for starting third party software.
In FreeBSD, most included services, such as cron(8), are started through the system start up scripts.
Now that FreeBSD includes rc.d,
configuration of application startup is easier and provides
more features. Using the key words discussed in the
rc.d section,
applications can be set to start after certain other services
and extra flags can be passed through
/etc/rc.conf in place of hard coded flags
in the start up script. A basic script may look similar to
the following:
This script will ensure that the provided
utility will be started after the
DAEMON pseudo-service. It also provides a
method for setting and tracking the PID, or
process ID file.
This application could then have the following line placed
in /etc/rc.conf:
This method also allows for easier manipulation of the
command line arguments, inclusion of the default functions
provided in /etc/rc.subr, compatibility
with the rcorder(8) utility and provides for easier
configuration via rc.conf.
Other services, such as the POP3 server
daemons or IMAP, could be started using
inetd(8). This involves installing the service utility
from the Ports Collection with a configuration line added to
/etc/inetd.conf, or by
uncommenting one of the current configuration lines. Working
with inetd and its configuration is
described in depth in the
inetd section.
In some cases it may make more sense to use the
cron(8) daemon to start system services. This approach
has a number of advantages because cron
runs these processes as the crontab's
file owner. This allows regular users to start and maintain
some applications.
The cron utility provides a unique
feature, @reboot, which may be used in
place of the time specification. This will cause the job to
be run when cron(8) is started, normally during system
initialization.
This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.