S6-SVSTAT(8)
π S6-SVSTAT(8) β the s6-svstat glow-up π
okay so bestie, this is a page from the System Manager's Manual, and it's literally about s6-svstat: the little icon that prints a short, human-readable or programmatically parsable summary of the state of a process monitored by s6-supervise(8). she's giving β¨status updateβ¨ energy and honestly? obsessed.
β¨ SYNOPSIS β¨
s6-svstat
[-uwNrpest | -o up,wantedup,normallyup,ready,paused,pid,pgid,exitcode,signal,signum,updownsince,readysince,updownfor,readyfor]
[-n] servicedir
πΈ DESCRIPTION πΈ
s6-svstat gives you the tea about the process being monitored at the service directory servicedir β that's your s6-service-directory(7), iykyk β and then it exits 0. bye bestie, love you, here's the info.
When s6-svstat is invoked with no options, or with only the -n option, it prints a human-readable summary of all the available info on the service. in that case, -n tells it to print a signal number (instead of a signal name) if the supervised process was killed by a signal. the summary includes the following data, no cap:
- whether the process is up or down, and if it's up, the number of seconds that it has been up. π
- the process'
pid, if it is up, or its last exit code or terminating signal, if it is down. - what its default state is, if it's different from its current state.
- the number of seconds since it last changed states.
- whether the service is ready (cf.
s6-notifywhenup(7)) as notified by the daemon itself, and if it is, the number of seconds that it has been that way. a service reported as down and ready simply means it's ready to be brought up. a service is down and not ready when it's in the cleanup phase β i.e. the./finishscript is still being executed. main character cleanup arc fr.
When s6-svstat is invoked with one or several options other than -n, it outputs programmatically parsable info instead. the output is a series of space-separated values, one value per requested field. π
the valid options are as follows:
π OPTIONS π
-o fieldsβ list the fields to print.fieldsis a list of comma-separated field names. the valid field names are the following:upβ printstrueif the service is up andfalseif it is down.wantedupβ printstrueifs6-supervise(8)is currently instructed to (re)start the service when it is down, andfalseifs6-supervise(8)is currently instructed to leave the service alone. π«Άnormallyupβ printstrueif the service is supposed to start whens6-supervise(8)starts (i.e. there's no./downfile), andfalseif it is not (i.e. there is a./downfile).readyβ printstrueif the service is ready, andfalseif it is not. note that a service can be both down and ready: it simply means it's ready to be started (i.e. no./finishscript is currently running). to check for service readiness, you should give this option along withup: the service is ready iffs6-svstat -o up,readyprintstrue true. (thetrue truecase will never happen if the service does not support readiness notification.) πpausedβ printstrueif the service is paused (i.e. the process is currently stopped) andfalseif it is not. it's a rare flag β you shouldn't normally need to use this option. πpidβ prints the pid of the supervised process. if the service is currently down,-1is printed instead.pgidβ prints the process group of the supervised process. if the service is currently down, prints the process group of the last living instance of the service.exitcodeβ prints the exit code of the last execution of./run. if the service is currently up, or the last./runprocess was killed by a signal,-1is printed instead.signalβ prints the name of the signal the last./runprocess was killed with. if the service is currently up, or the last./runprocess was not killed by a signal,NAis printed instead.signumβ prints the number of the signal the last./runprocess was killed with. if the service is currently up, or the last./runprocess was not killed by a signal,-1is printed instead.updownsinceβ prints a TAI64N[1] label representing the absolute date when the service last changed states. βreadysinceβ prints a TAI64N[1] label representing the absolute date when the service last became ready. note that this can either mean "service readiness" (if the service is currently up and ready), or "down readiness", i.e. the last time when the service was down and ready to be started (if the service is not currently up and ready).updownforβ prints the number of seconds that have elapsed since the service last changed states.readyforβ prints the number of seconds that have elapsed since the service last became ready (or ready to be started if it's currently not up and ready).
-uβ equivalent to-o up.-wβ equivalent to-o wantedup.-Nβ equivalent to-o normallyup.-rβ equivalent to-o ready.-pβ equivalent to-o pid.-gβ equivalent to-o pgid.-eβ equivalent to-o exitcode.-sβ equivalent to-o signal.-tβ equivalent to-o updownfor.
π¦ EXIT STATUS π¦
0β success. slay. π1βs6-supervise(8)not running onservicedir. π100β wrong usage.111β system call failed. π
π EXAMPLES π
s6-svstat -o up,ready
or its equivalent, s6-svstat -ur, will print true true if the service is up and ready, true false if the service has been started but has not notified readiness yet, false true if it is down and can be started, and false false if it is down and there's a ./finish script running that needs to exit before the service can be restarted. the whole vibe check in four booleans, iconic.
s6-svstat -o pid,exitcode,signal
or its equivalent, s6-svstat -pes, will print 42 -1 NA if the service has been started and ./run's pid is 42; it will print -1 0 NA if the service is down and ./run last exited 0; it will print -1 -1 SIGTERM if the service is down and ./run was last killed by a SIGTERM β as can happen, for instance, when you down the service via a call to s6-svc -d. periodt. π₯
π§ SEE ALSO π§
s6-notifyoncheck(8), s6-permafailon(8), s6-supervise(8), s6-svc(8), s6-svdt(8), s6-svdt-clear(8), s6-svlisten(8), s6-svlisten1(8), s6-svok(8), s6-svscan(8), s6-svscanctl(8), s6-svwait(8)
[1] https://cr.yp.to/libtai/tai64.html
this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-svstat.html β go read the og, she's that girl. π
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
okay that's the whole page, bestie π«Ά and for the cute sign-off: this beauty ships with Debian, dated June 8, 2024, and it lives at S6-SVSTAT(8) in the System Manager's Manual section β go forth and stat your services, mwah ππΈ
π¦ 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