fscd
—
service state monitoring daemon
fscd |
[-dfVv ] [-p
pidfile] [-s
socket] [-c
file] |
The fscd
FreeBSD, service
control daemon, is a service which monitors states of other services and
attempts to restart them if they die.
When invoked, the fscd
utility will check
for services listed in its configuration file,
/usr/local/etc/fscd.conf and create a socket to
listen for messages from
fscadm(8),
FreeBSD the services control administration utility.
The
fscadm(8)
utility will allow for the addition or removal of services from the
fscd(8)
internal monitoring list.
When monitored services terminate, they will be restarted, and a
notification will be logged to the LOG_ERR
facility.
If fscd
is unable to successfully start a service,
it will be removed and a log message will be issued.
fscd
uses the
kqueue(2)
interface to be notified about process terminations and
rc(8),
resp.
service(8)
for (re)starting services, getting their pids and initially checking their
status.
fscd
is subject the same rules which
govern
rc(8);
meaning that services must have an entry in
rc.conf(5)
before they may be handled through this interface. After successfully
becoming a daemon, services may be added using the
fscadm(8)
utility.
Several signals don't restart the service immediately as they may be the result
of the user restarting it by hand. Instead, fscd
will
wait up to 60 seconds for the service to restart. These are:
- SIGINT
- SIGTERM
- SIGUSR1
- SIGUSR2
- SIGKILL
-d
- Run
fscd
in the background as a deamon. The
default is to run in the foreground to show service start messages on the
screen.
-f
- Force, if the socket already exists, delete it. This can occur if
fscd
is already running or was not properly shut
down before.
-V
- Print out the version of
fscd
and exit.
-v
- Verbose, don't fork to background and don't log to
syslog(3)
but to console.
-p
pidfile
- Use alternative pidfile pid file instead of the
standard /var/run/fscd.pid.
-s
socket
- Use socket socket instead of the standard socket
/var/run/fscd.sock.
-c
file
- Use file file as configuration file instead of the
standard file /usr/local/etc/fscd.conf.
- /var/run/fscd.sock
- name of the UNIX domain socket
- /usr/local/etc/fscd.conf
- name of the configuration file
The fscd
utility is available in both the ports
collection and github.
The fsc
utilities and documentation were written by
Tom Rhodes ⟨trhodes@FreeBSD.org⟩.
The fscd
utility may fail to start a service if the
parent died with a SIGKILL and children, with unique PIDs are not subsequently
killed off. Such cases usally leave resources, such as port numbers or
pidfiles around which confuse
service(8).
This behavior has been observed on several operating systems and should
possibly be fixed by the software in question.