s6
Software
skarnet.org

The s6-notify-fd-from-socket

s6-notify-fd-from-socket is meant to be used in a run script, when you want to use s6 to supervise a program that follows systemd's NOTIFY_SOCKET protocol. It converts a readiness notification sent via that protocol into s6's native format.

Interface

     s6-notify-fd-from-socket [ -3 fd ] [ -f ] [ -t timeout ] prog...

Exit codes

s6-notify-fd-from-socket can exit before executing into prog:

After forking, s6-notify-fd-from-socket (running as a child or grandchild) can exit with the following exit codes, but those are meaningless because no process will, or should, check them. They are only differentiated for clarity in the source code:

Options

-3 fd, --notification-fd=fd
Force writing the readiness notification to descriptor fd. By default, the notification is sent to the descriptor written in the notification-fd file of the service directory, and it is an error if this file does not exist (because the supervisor needs to be prepared to receive the notification).
-t timeout, --timeout=timeout
Exit without notifying the supervisor if prog hasn't notified readiness after timeout milliseconds. Default is 0, meaning infinite: s6-notify-fd-from-socket will wait forever for a notification, up to when prog exits.
-f, --no-doublefork
Make s6-notify-fd-from-socket live as a direct child of prog rather than doubleforking. It is less costly (it might save a millisecond), but it will leave a zombie around if prog does not know how to reap its bastards (children it doesn't know it has). If prog reaps everything, you can safely use this option; otherwise, leave it alone.

Notes