supervise switches to the directory named
s and starts the service there by executing first
./start (if it is executable), and then
./run, if it exists.
./start exits zero or
./run exits with any value other than 100.
It pauses for a second after starting
./run, so that it does not loop
too quickly if
./run exits immediately.
./run exits for the last time (ie after
svc -d has been issued), it runs
Unless the file
supervise will run subordinate processes in a new process group.
./log is an executable file,
supervise starts it before any of the above, and will restart it if it exits.
Standard output from the main script
will be redirected through a pipe to standard input of the log process.
As a special case, if
svc -dx is issued, the log will be stopped after the main service has stopped.
If the file
supervise does not start the service immediately. You can use
to start the service and to give other commands to
If the file
s/notify exists and is executable,
supervise executes it when any script starts or stops. It is given four
command-line arguments: The first is the name of the script being
executed, one of
log. The second is a status code, one of:
The third is the process ID of the newly created or just exited process.
The fourth is the exit code or kill signal number, or
0 on start.
The script started executing.
The running script exited.
The running script was killed by a signal.
supervise maintains status information in a binary format inside the directory
s/supervise, which must be writable to
supervise. The status information can be read by
supervise may exit immediately after startup if it cannot find the files it needs in
s or if another copy of
supervise is already running in
supervise is successfully running, it will not exit unless it is killed or specifically
asked to exit. You can use
to check whether
supervise is successfully running and
to check if the supervised process is running. You can use
to reliably start a collection of