66
www.obarun.org
66-svctl
This command is used to control an already supervised service at live defined in a tree.
Interface
66-svctl [ -h ] [ -v verbosity ] [ -l live ] [ -t tree ] [ -T timeout ] [ -n death ] [ -u | d | r | K | X ] service(s)
This tool expects to find an already supervised service at live defined in the given tree and an already running scandir.
(!) This tool only deals with 'classic' services—see 66-dbctl for other types of services.
Multiple services can be handled by seperating their names with a space. 66-svctl gathers each of these services in a list called selection.
It try to be quicker as possible and send command to the selection asynchronously.
Exit codes
- 0: success, the wanted state has been reached.
- 110: wrong usage.
- 111: system call failed.
Options
- -h : prints this help.
-
-v verbosity : increases/decreases
the verbosity of the command. 1(Default): Only print
error messages. 2: Also print warning messages.
3: Also print debugging messages.
-
-l live : changes the supervision directory of service to live. By default this will be /run/66. The default can
also be changed at compile time by passing the --livedir=live
option to ./configure. An existing absolute path is expected and
should be within a writable filesystem - likely a RAM filesystem—see 66-scandir.
-
-t tree : handles the service from
the given tree. This option is mandatory
except if a tree was marked as 'current'—see 66-tree.
-
-T timeout : specifies a timeout (in milliseconds)
after which 66-svctl will stop to try to reach the desired state of the service; defaults to 3000. timeout is apply for each service of the selection. If you want to set timeout for each service separately use the @timeout-up or @timeout-down key into the frontend service file instead. In such case this option has no effect.
-
-n death : specifies the maximum number of service death events that the supervisor will keep track of.
If the service dies more than this number of times, 66-svctl will stop to try to reach the desired state of the services.
This option has no effect if a @maxdeath was defined for the given service at parsing time—see frontend.
If this option is not specified and no max-death-tally file exists the maximum allowed deaths will default to 5.
-
-u : sends an up signal to the service. It searches for a notification-fd file—see service startup notifications and frontend. If this file exist 66-svctl will automatically change to uppercase U.
-
-d : sends a down signal to the service. It searches for a notification-fd file—see service startup notifications and frontend. If this file exist 66-svctl will automatically change to uppercase D.
-
-r : sends a reload signal to the service. By default, the signal is a SIGTERM; this can be configured via the @down-signal field in the frontend service file. It searches for a notification-fd file—see service startup notifications and frontend. If this file exist 66-svctl will automatically change to uppercase R.
-
-X : exit. The supervisor of the service will exit too. This command should normally never be used on a working system.
-
-K : sends a SIGKILL to the service and keep it down.
s6-svc corresponding signal
from 66-svctl to s6-svc
- -u -> -u
- -U -> -uwU
- -d -> -d
- -D -> -uwD
- -r -> -r
- -X -> -xd
- -K -> -kd
Note
You can also send a signal in a similar fashion to a 'classic' service with the s6-svc tool which has the philosophy "launch and forget".
In contrast to s6-svctl this does not care for the exit status of the service when a signal is sent.
As an extra convenience the -n options allow you to deal directly on the command line with
max-death-tally even if these were not specified explicitely in the services frontend file and no corresponding files exist.