MikeL's FreeBSD howto - Autostart
This is basically a checklist of how to setup a process to be
autostarted at boot time. The intent is not to cover everything in
detail, merely to point you to each of the tasks that must be
performed.
cd /usr/local/etc/rc.d
- Copy an existing ".sh" file to the name of your deamon.
- Edit that file, replacing whatever app it used with your own.
Note that a well-behaved deamon will leave a "deamon.pid" file in
/var/run/
with the main processes PID where 'kill'
messages should be routed. It should also print the name of the
product to the console with no newline so that at boot-time one can
see what's being started, and when.
- Use
which
and/or find
to determine where
the package was installed.
As a sample, here's the file created by an Apache install:
#!/bin/sh
[ -x /usr/local/sbin/apachectl ] && /usr/local/sbin/apachectl startssl >/dev/null && echo -n ' apache'
Copyright © 1995-2024
Mike Lempriere
(running on host bayanus)