From 50a00de6e4aa6337b17a179019ec7689a2cc6b6d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 15 Jun 2018 12:36:00 +0000 Subject: Down signal customization: add ./down-signal file and s6-svc -r --- doc/servicedir.html | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'doc/servicedir.html') diff --git a/doc/servicedir.html b/doc/servicedir.html index 29236e7..2e6a937 100644 --- a/doc/servicedir.html +++ b/doc/servicedir.html @@ -40,7 +40,7 @@ for historical and compatibility reasons.) A service directory foo may contain the following elements: -
  • An optional executable file named finish. Like run, +
  • +
  • An optional executable file named finish. Like run, it can be any executable file. This finish script, if present, is executed everytime the run script dies. Generally, its main purpose is to clean up non-volatile data such as the filesystem after the supervised process has been killed. If the foo service is supposed to be up, -foo/run is restarted -after foo/finish dies. +foo/run is restarted after foo/finish dies.
  • -
  • A directory named supervise. It is automatically created by +
  • A directory named supervise. It is automatically created by s6-supervise if it does not exist. This is where s6-supervise stores its information. The directory must be writable.
  • -
  • An optional, empty, regular file named down. If such a file exists, +
  • An optional, empty, regular file named down. If such a file exists, the default state of the service is considered down, not up: s6-supervise will not automatically start it until it receives a s6-svc -u command. If no down file exists, the default state of the service is up.
  • -
  • An optional, empty, regular file named nosetsid. If such a file exists, +
  • An optional, empty, regular file named nosetsid. If such a file exists, s6-supervise will not make the service a process group and session leader; the service will be run in the same process group as s6-supervise. If no nosetsid file exists, the service has its own process group and is started as a session leader.
  • -
  • An optional regular file named notification-fd. If such a file +
  • An optional regular file named notification-fd. If such a file exists, it means that the service supports readiness notification. The file must only contain an unsigned integer, which is the number of the file descriptor that @@ -128,7 +127,7 @@ notification from the service and broadcast readiness, i.e. any s6-svlisten1 -U or s6-svlisten -U processes will be triggered.
  • -
  • An optional regular file named timeout-kill. If such a file +
  • An optional regular file named timeout-kill. If such a file exists, it must only contain an unsigned integer t. If t is nonzero, then on receipt of a s6-svc -d command, which sends a SIGTERM and a SIGCONT to the service, a timeout of t @@ -137,25 +136,30 @@ milliseconds, then it is sent a SIGKILL. If timeout-kill does not exist, or contains 0 or an invalid value, then the service is never forcibly killed (unless, of course, a s6-svc -k command is sent).
  • -
  • An optional regular file named timeout-finish. If such a file +
  • An optional regular file named timeout-finish. If such a file exists, it must only contain an unsigned integer, which is the number of milliseconds after which the ./finish script, if it exists, will be killed with a SIGKILL. The default is 5000: finish scripts are killed if they're still alive after 5 seconds. A value of 0 allows finish scripts to run forever.
  • -
  • An optional regular file named max-death-tally. If such a file +
  • An optional regular file named max-death-tally. If such a file exists, it must only contain an unsigned integer, which is the maximum number of service death events that s6-supervise will keep track of. If the service dies more than this number of times, the oldest events will be forgotten. Tracking death events is useful, for instance, when throttling service restarts. The value cannot be greater than 4096. If the file does not exist, a default of 100 is used.
  • -
  • A fifodir named event. It is automatically +
  • An optional regular file named down-signal. If such a file +exists, it must only contain the name or number of a signal, followed by a +newline. This signal will be used to kill the supervised process when a +s6-svc -d or s6-svc -r +command is used. If the file does not exist, SIGTERM will be used by default.
  • +
  • A fifodir named event. It is automatically created by s6-supervise if it does not exist. foo/event is the rendez-vous point for listeners, where s6-supervise will send notifications when the service goes up or down.
  • -
  • An optional service directory named log. If it exists and foo +
  • An optional service directory named log. If it exists and foo is in a scandir, and s6-svscan runs on that scandir, then two services are monitored: foo and foo/log. A pipe is open and maintained between foo and -- cgit v1.3.1