s6
Software
skarnet.org

The s6-svc program

s6-svc sends commands to a running s6-supervise process. In other words, it's used to control a supervised process; among other benefits, it allows an administrator to send signals to daemons without knowing their PIDs, and without using horrible hacks such as .pid files.

Interface

     s6-svc [ -wu | -wU | -wd | -wD | -wr | -wR ] [ -T timeout ] [ -s signal | -abqhkti12pcyrPCK ] [ -oduDUxO ] servicedirs...

s6-svc sends the given series of commands to the s6-supervise processes monitoring the servicedirs directories, then exits 0.

If an error occurs, s6-svc prints an error message and keeps processing servicedirs. It then exits with an error code corresponding to the last directory in servicedir that caused an error.

Options



Exit codes

0
Success.
100
Usage error.
102
One of the arguments in servicedirs is not a currently supervised service directory.
111
System call failure.

Usage examples

 s6-svc -h /run/service/httpd 

Send a SIGHUP to the process represented by the /run/service/httpd service directory. Traditionally, this makes web servers reload their configuration file.

 s6-svc -r /run/service/sshd /run/service/httpd 

Kill (and automatically restart, if the wanted state of the service is up) the process represented by the /run/service/sshd service directory — typically the sshd server — as well as the process represented by the /run/service/httpd directory — typically the Web server.

 s6-svc -wD -d /run/service/ftpd 

Take down the ftpd server and block until the process is down and the finish script has completed.

 s6-svc -wU -T 5000 -u /run/service/ftpd 

Bring up the ftpd server and block until it has sent notification that it is ready. Exit 1 if it is still not ready after 5 seconds.

 s6-svc -twR /run/service/ftpd /run/service/gitd 

Send a SIGTERM to the ftpd server and the git server; wait for their respective supervisors to restart them, and block until they both have notified that they are ready to serve again. See the NOTES section below.

 s6-svc -a /run/service/httpd/log 

Send a SIGALRM to the logger process for the httpd server. If this logger process is s6-log, this triggers a log rotation.

Internals

Notes