Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
supervise(8)		    System Manager's Manual		  supervise(8)

NAME
       supervise - starts and monitors a service.

SYNOPSIS
       supervise s

DESCRIPTION
       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.	It restarts ./run if ./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.
       After ./run exits for the last time (ie after svc -d has	been  issued),
       it runs ./stop once.

       Unless the file ./no-setsid exists, supervise will run subordinate pro-
       cesses in a new process group.

       If ./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 s/down exists, supervise does not start the service immedi-
       ately.  You  can	use svc(8) to start the	service	and to give other com-
       mands to	supervise.

       If the file s/notify exists and is executable,  supervise  executes  it
       when  any  script starts	or stops.  It is given four command-line argu-
       ments: The first	is the name of	the  script  being  executed,  one  of
       start, run, stop, or log.  The second is	a status code, one of:

       start  The script started executing.

       exit   The running script exited.

       killed The running script was killed by a signal.

       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.

       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 svstat(8).

       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  s.  Once supervise is successfully running, it will not exit	unless
       it is killed or specifically asked to exit.  You	 can  use  svok(8)  to
       check whether supervise is successfully running and svup(8) to check if
       the supervised process is running. You can use  svscan(8)  to  reliably
       start a collection of supervise processes.

ENVIRONMENT
       SUPERVISEDIR
	      If set, the named	directory is used instead of supervise for the
	      status information and control files.  If	 $SUPERVISEDIR	is  an
	      absolute	path,  it  is  suffixed	 with  the  path to s with all
	      slashes ("/") replaced with colons (":").

SEE ALSO
       svc(8), svok(8),	svup(8), svstat(8),  svscanboot(8),  svscan(8),	 read-
       proctitle(8), fghack(8),	pgrphack(8), multilog(8), tai64n(8), tai64nlo-
       cal(8), setuidgid(8), envuidgid(8), envdir(8), softlimit(8), setlock(8)

								  supervise(8)

NAME | SYNOPSIS | DESCRIPTION | ENVIRONMENT | SEE ALSO

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=supervise&sektion=8&manpath=FreeBSD+13.0-RELEASE+and+Ports>

home | help