-
-
Notifications
You must be signed in to change notification settings - Fork 3
svc.8
svc - controls services monitored by supervise(8).
svc [ -udopchaitkx ] services
services consists of any number of arguments, each argument naming a directory used by supervise.
svc applies all the options to each service in turn.
-u
Up. If the service is not running, start it. If the service stops,
restart it.
-d
Down. If the service is running, send it a TERM signal and then a CONT
signal. After it stops, do not restart it. If the script shutdown
exists, run shutdown to terminate the service
-r
Restart. If the service is running, send it a term signal, then a CONT
signal. After it stops, start it.
-o
Once. If the service is not running, start it. Do not restart it if it
stops.
-p
Pause. Send the service a STOP signal.
-c
Continue. Send the service a CONT signal.
-h
Hangup. Send the service a HUP signal.
-a
Alarm. Send the service an ALRM signal.
-i
Interrupt. Send the service an INT signal.
-t
Terminate. Send the service a TERM signal.
-q
Quit. Send the service a QUIT signal.
-1 | -U
SIGUSR1. Send the service a SIGUSR1 signal.
-2
SIGUSR2. Send the service a SIGUSR2 signal.
-k
Kill. Send the service a KILL signal.
-G
For all options above, the signal will be sent to the entire process
group instead of just the pid of the service.
-w
Wait. svc(8) will wait for service to be up. supervise(8)
opens the named pipe service/up after executing service/run.
svc opens this named pipe in O_WRONLY mode in blocking mode, thus
making svc wait till the named pipe is opened by supervise. This
option can be used by any program to wait for a supervised service. This
can also be used by supervise to setup inter-dependencies between
services.
-W
Wait. svc(8) will wait for service to be down. supervise(8)
opens the named pipe service/dn after sending TERM folowed by CONT
signal to service, when svc -d option is used. svc opens this
named pipe in O_WRONLY mode in blocking mode, thus making svc wait
till the named pipe is opened by supervise. This option can be used
by any program to wait for a supervised service.
-T timeout
Use timeout as timeout when waiting for service to be up or down (-w
or -W options)
-x
Exit. supervise(8) will exit as soon as the service is down. If
you use this option on a stable system, you're doing something wrong;
supervise is designed to run forever.
svc returns 0 if all operations succeeded, 1 if it was not able to open service/supervise/control, 2 if supervise for service service is not running and 3 for timeout. The return value cannot be used reliably when svc is passed multiple arguments.
supervise(8), svok(8), svps(1), svstat(8), svctool(8), minisvc(8), svscan(8), svscanboot(8), readproctitle(8), fghack(8), pgrphack(8), multilog(8), tai64n(8), tai64nlocal(8), setuidgid(8), envuidgid(8), envdir(8), softlimit(8), setlock(8),