S6-SVUNLINK(8)

NAME
s6-svunlink - integrate service directories into an existing service manager sequence and eliminate race conditions

SYNOPSIS
s6-svunlink [-X] [-t timeout] scandir name

DESCRIPTION
s6-svunlink unlinks an s6-service-directory(7) from an s6-scan-directory(7), then notifies s6-svscan(8) that a service has been unregistered. It waits until the s6-supervise(8) supervisor process managing the service has disappeared, then exits.

•   s6-svunlink expects a running s6-svscan(8) process on scandir and a fully functional supervised service on the s6-service-directory(7) in ‘scandir/name’, which must be a symbolic link to a real directory located somewhere else.

•   It deletes the ‘scandir/name’ symlink.

•   It sends a command to s6-svscan(8) to signal it that a service has disappeared.

•   It waits for the s6-supervise(8) process managing the service directory to exit.

•   It exits 0.

Using s6-svunlink to stop services is a suboptimal pattern: starting and stopping supervisors is a heavier operation than just stopping services. The simpler, more efficient pattern is to simply perform ‘s6-svc -dwD scandir/name’, which only commands, and waits for, the death of the service, without impacting the supervisor. Nevertheless, for symmetry with s6-svlink(8), this program is provided.

s6-svunlink is a destructor; as is, it returns 0 even in situations that are nominal failures. For instance, it returns 0 even if its timeout expires; the rationale is that there is no sensible action for the user to do if this error is reported. s6-svunlink only reports errors when they uncover a deeper problem in the system.

s6-svunlink sends a ‘s6-svscanctl -an’ command to scandir, which means that the system's view of services will be refreshed and inactive services will be killed and unsupervised. Depending on what links exist in scandir, new services may appear, and other services than name may disappear.

OPTIONS

-X  Don't wait. s6-svunlink will exit right away, without waiting for the supervisor to exit first.

-t timeout
    If the supervisor has not exited after timeout milliseconds, s6-svunlink will still exit. The default is 0, meaning no time limit.

EXIT STATUS

0   Success.

100 Wrong usage.

111 System call failed.

SEE ALSO
s6-scan-directory(7), s6-service-directory(7), s6-supervise(8), s6-svlink(8), s6-svscan(8)

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-svunlink.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)