From 90b12bd71bb9fc79a4640b9112c13ef529d0196a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 5 Dec 2014 22:26:11 +0000 Subject: Initial commit --- doc/s6-svscan.html | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 doc/s6-svscan.html (limited to 'doc/s6-svscan.html') diff --git a/doc/s6-svscan.html b/doc/s6-svscan.html new file mode 100644 index 0000000..4a7e800 --- /dev/null +++ b/doc/s6-svscan.html @@ -0,0 +1,176 @@ + + + + + s6: the s6-svscan program + + + + + + +

+s6
+Software
+www.skarnet.org +

+ +

The s6-svscan program

+ +

+s6-svscan starts and monitors a collection of s6-supervise +processes, each of these processes monitoring a single service. It is designed to be either +the root or a branch of a supervision tree. +

+ +

Interface

+ +
+     s6-svscan [ -c max ] [ -t rescan ] [ scandir ]
+
+ + + +

Options

+ + + +

Signals

+ +

+ s6-svscan reacts to the following signals: +

+ + + +

The reaper

+ +

+ Upon receipt of a SIGCHLD, or a s6-svscanctl -z +command, s6-svscan runs a reaper routine. +

+ +

+The reaper acknowledges (via some +wait() +function), without blocking, every terminated child of s6-svscan, even ones it does not +know it has. This is especially important when s6-svscan is +run as process 1. +

+ +

+ If the dead child is a s6-supervise process watched +by s6-svscan, and the last scan flagged that process as active, then it is restarted +one second later. +

+ +

The scanner

+ +

+ Every rescan milliseconds, or upon receipt of a SIGALRM or a +s6-svscanctl -a command, s6-svscan runs a +scanner routine. +

+ +

+ The scanner scans the current directory for subdirectories (or symbolic links +to directories), which must be service directories. +It skips names starting with dots. It will not create services for more than +max subdirectories. +

+ +

+ For every new subdirectory dir it finds, the scanner spawns a +s6-supervise process on it. If +dir/log exists, it spawns a s6-supervise process on +both dir and dir/log, and maintains a +never-closing pipe from the service's stdout to the logger's stdin. +This is starting the service, with or without a corresponding +logger. +Every service the scanner finds is flagged as "active". +

+ +

+ The scanner remembers the services it found. If a service has been +started in an earlier scan, but the current scan can't find the corresponding +directory, the service is then flagged as inactive. No command is sent +to stop inactive s6-supervise processes (unless the administrator +uses s6-svscanctl -n), but inactive +s6-supervise processes will not be restarted if they die. +

+ +

Implementation notes

+ + + + + -- cgit 1.4.1