S6-SVC(8)
π
S6-SVC(8) β send commands to a running s6-supervise(8) process
okay so bestie, welcome to s6-svc, from the System Manager's Manual (that's the manual name, we're folding it in right here at the top, you're welcome β¨). This is the little tool that lets you boss around a daemon without ever needing to know its PID. no cap.
πΈ SYNOPSIS
s6-svc [-wu | -wU | -wd | -wD | -wr | -wR] [-T timeout]
[-s signal | abqhkti12pcyrPCK] [-oduDUxO] servicedirs...
π¦ DESCRIPTION
s6-svc is literally your remote control for a supervised process. Among other benefits β and this is the iconic part β it lets an administrator send signals to daemons without knowing their PIDs, and without resorting to horrible hacks like .pid files. we do not do that here. π
s6-svc sends the given series of commands to the s6-supervise(8) 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.
π Notes
The -t and -r options make s6-supervise(8) send a signal to the service it's supervising if it is up; but if the service is currently down, they do nothing, and in particular they do not instruct s6-supervise(8) to bring the service up. Consequently, s6-svc -rwr servicedirs may wait forever for one of the services to be up, if it is currently wanted down. π To avoid that, make sure your services are wanted up by using s6-svc -ruwr servicedirs instead. slay.
The U and D letters, which convey the same idea as u and d (up and down) but with added emphasis, do not have the same meaning in the -U / -D and -wU / -wD options. listen closely, this is the part that gets people:
- In the
-U/-Dcase, they mean "change the external service configurations to match what the supervisors have been instructed that the starting state of the services should be". - In the
-wU/-wDcase, they mean "wait until the services have reached the wanted state and also are ready" (or "ready to be started again" for-wD).
The thing to remember is "it's up/down, with something more", but the "something" isn't the same. iykyk π«Ά
β¨ OPTIONS β¨
-aβ Send aSIGALRMto the supervised process.-bβ Send aSIGABRTto the supervised process.-qβ Send aSIGQUITto the supervised process.-hβ Send aSIGHUPto the supervised process.-kβ Send aSIGKILLto the supervised process.-tβ Send aSIGTERMto the supervised process.-iβ Send aSIGINTto the supervised process.-1β Send aSIGUSR1to the supervised process.-2β Send aSIGUSR2to the supervised process.-pβ Send aSIGSTOPto the supervised process.-cβ Send aSIGCONTto the supervised process.-yβ Send aSIGWINCHto the supervised process.-ssignal β Send signal to the supervised process. signal can be given as its name (case-insensitive) or its number, but only the signals listed above are accepted β you cannot, for instance, manually send aSIGSEGVto the supervised process. π«-oβ Once. Equivalent to-uO.-dβ Down. If the supervised process is up, send it aSIGTERM(by default) then aSIGCONT(to make sure even stopped processes receive the signal aimed to kill them) and do not restart it. TheSIGTERMdefault can be changed by editing the./down-signalfile in thes6-service-directory(7).-Dβ Down, and create a./downfile so the service does not restart automatically if the supervisor dies. This option is mostly used by automated systems working on top of s6; as a human user, you probably don't need it. π-uβ Up. If the supervised process is down, start it. Automatically restart it when it dies.-Uβ Up, and remove any./downfile that may exist, in order to make sure the service is automatically restarted even if the supervisor dies. This option is mostly used by automated systems working on top of s6; as a human user, you probably don't need it. π-xβ Exit. When the service is asked to be down and the supervised process dies,s6-supervise(8)will exit too. This command should normally never be used on a working system. π¬ Note that if this command is sent and a./finishscript exists for the service, the last./finishinvocation befores6-supervise(8)exits will run with its stdin and stdout redirected to/dev/null.-Oβ Mark the service to run once at most. iow: do not restart the supervised process when it dies. If it is down when the command is received, do not even start it.-Qβ Once at most, and create a./downfile. Like-D, but do not terminate the service if it is currently running.-rβ If the service is up, restart it, by sending it a signal to kill it and lettings6-supervise(8)start it again. By default, the signal is aSIGTERM; this can be configured via the./down-signalfile in thes6-service-directory(7).-Ttimeout β If the-wstateoption has been given,-Tspecifies a timeout (in milliseconds) after whichs6-svcwill exit1with an error message if the service still hasn't reached the desired state. By default, the timeout is0, which means thats6-svcwill block indefinitely. β³-wdβs6-svcwill not exit until the service is down, i.e. until the run process has died.-wDβs6-svcwill not exit until the service is down and ready to be brought up, i.e. a possible finish script has exited.-wuβs6-svcwill not exit until the service is up, i.e. there is a process running the run executable.-wUβs6-svcwill not exit until the service is up and ready (cf.s6-notifywhenup(7)) as notified by the daemon itself. If thes6-service-directory(7)does not contain anotification-fdfile to tells6-supervise(8)to accept readiness notification,s6-svcwill print a warning and act as if the-wuoption had been given instead.-wrβs6-svcwill not exit until the service has been started or restarted.-wRβs6-svcwill not exit until the service has been started or restarted and has notified readiness.-Pβ Send aSIGSTOPto the process group of the supervised process.-Cβ Send aSIGCONTto the process group of the supervised process.-Kβ Send aSIGKILLto the process group of the supervised process.
π₯ IMPLEMENTATION NOTES
s6-svc writes control commands into the x/supervise/control FIFO for every service directory x listed in servicedirs. An s6-supervise(8) process running on x will be listening to this FIFO, and will read and interpret those commands. cute, right? π
When invoked with one of the -w options, s6-svc executes into s6-svlisten(8), which will listen to service state changes and spawn another s6-svc instance (without the -w option) that will send the commands to the services. Any error message written during the waiting period will mention it is being written by s6-svlisten(8); this is normal. don't panic bestie π
π§ EXIT STATUS
0β Success. π100β Usage error.102β One of the arguments in servicedirs is not a currently supervised service directory.111β System call failure.
π 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 (cf. s6-supervise(8)) to restart them, and block until they both have notified that they are ready to serve again. See the "Notes" section. π
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(8), this triggers a log rotation. π
π SEE ALSO
s6-notifyoncheck(8), s6-permafailon(8), s6-supervise(8), s6-svdt(8), s6-svdt-clear(8), s6-svlisten(8), s6-svlisten1(8), s6-svok(8), s6-svscan(8), s6-svscanctl(8), s6-svstat(8), s6-svwait(8),
This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-svc.html
πΈ AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)
ok that's the whole page bestie, you ate that π so anyway β this version came from Debian, dated November 2, 2025, and honestly? iconic. go forth and signal things responsibly. π
π¦ where this page comes from
- nixpkgs unstable: s6 2.15.1.0
- nixpkgs unstable: s6-man-pages 2.14.0.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms