1 Useful concepts 1.1 System initialisation 1.1.1 Chainloading 1.1.2 Requirements and properties of PID 1 1.1.2.1 Functional requirements: longruns and oneshots 1.1.2.2 Signal handling 1.1.2.3 exit() and exec() 1.1.3 Aside: history of init [init-hist] 1.2 Process supervision 1.2.1 Requirements [s6-ov] 1.2.1.1 Auto restart 1.2.1.2 Be itself supervised # The need to be rooted in PID 1 1.2.1.3 Reproducable environment # More of a consequence rather than a requirement 1.2.2 Main choices 1.2.2.1 No supervision, or with PID files, or with /etc/inittab and /etc/ttys 1.2.2.2 monit and supervisord; upstart and systemd 1.2.2.3 daemontools(-encore), runit, perp, s6 and nosh 1.2.3 Aside: the supervision mail list [sv-ml] 1.3 Notification without running a service [ftrig] 2 Anatomy of s6 / s6-rc 2.1 Process supervisior: s6-supervise and s6-svscan 2.1.1 Configuration and runtime control [s6-ov] 2.1.2 Readiness notification 2.1.3 Chainloading and execline 2.2 Service manager: s6-rc 2.2.1 Interfaces provided by s6-rc 2.2.2 Service directory deployment 2.2.3 Why no OR dependencies for now [or-dep] # Compare with "opportunist dependencies" 2.3 Service logging 2.3.1 s6-svscan as init: the fd-holding black magic [magic] 2.3.2 s6-fdholder # Restart of s6-fdholder [fh-restart] 2.3.3 s6-log and ucspilogd # /dev/log: SOCK_STREAM and SOCK_DGRAM [log-dgram] 2.3.4 The good parts of "socket activation" [s6-sa] 2.4 The DJB legacy and the Plan 9 spirit [djb] 2.4.1 File system as the channel 2.4.2 library organisation, eg. buffer.h <-> bio.h 2.4.3 A glance at the source code 3 A simplified example of s6 / s6-rc deployment 3.1 s6-linux-init and "refined" phases of init # Platform-dependency of stage 1 3.2 "Runlevel" emulation with s6-rc 3.3 `emptyenv -p' with setproctitle; `./nosetsid' with dcron 3.4 Shuffling of fd in ucspilogd's `./run' 3.5 Coarseness of logging setup in the example 3.6 Instanced supervision # A hybrid of execline and shell? [el-hybrid] 3.7 Aside: comparison of init scripts [run-comp] -- [djb] [el-hybrid] [fh-restart] [ftrig] [init-hist] [log-dgram] [magic] [run-comp] [or-dep] [s6-sa] [s6-ov] [sv-ml]