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/scandir.html | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 doc/scandir.html (limited to 'doc/scandir.html') diff --git a/doc/scandir.html b/doc/scandir.html new file mode 100644 index 0000000..366bd08 --- /dev/null +++ b/doc/scandir.html @@ -0,0 +1,145 @@ + + + + + s6: scan directories + + + + + + +

+s6
+Software
+skarnet.org +

+ +

Scan directories

+ +

+ A scan directory is a directory containing a list of +service directories, or symbolic links +pointing to service directories. +

+ +

+ A scan directory represents a list of services that are supposed to +be supervised. Running s6-svscan on this +scan directory launches a supervision tree: every service +listed in the scan directory will be supervised. +

+ +

+ There is normally only one scan directory per system, although nothing +prevents a system administrator from having more. +daemontools traditionally +uses /service, and runit +traditionally uses /etc/service. s6 does not care where your +scan directory is, but I would advise /service for compatibility +with daemontools. Depending on your installation, /service could +be a symbolic link and point to a place either in a RAM filesystem or in +/var. +

+ + +

Where and how to build a scan directory

+
+ +

+ Opinions and practices differ. +

+ +

+ It is generally accepted that the place where you store all your +service directories (your "service repository") should not be +used as a scan directory - for a simple reason: you might want to have +service directories for more services than what you want to start at +any given time. In other words, your scan directory will be a subset +of your service repository, so you cannot just run s6-svscan on every +service you have a service directory for. So, the first thing is to +separate your service repository, which is just a storage place +for all the services you might want to manage someday, and your scan +directory, which is a directory representing all the services that +you are currently managing. +

+ +

Service repository

+ +

+ Where to store your service repository is purely a matter of personal +preference. You just have to be aware that +s6-supervise needs writable supervise and event +subdirectories in a service directory it monitors. +

+ +

Scan directory

+ +

+ Where and how to build your scan directory depends heavily on your boot +system - and on your personal preference too. +

+ +

+ Standard daemontools and +runit installations like to have +a fixed scan directory containing symlinks to service directories located +in the service repository. In other words, the service repository contains +the real working copies of the service directories. This works, +as long as: +

+ + + +

+ My own recommendation would be to have working copies of the service +directories entirely separate from the service repository. The +service repository can be safely stored on the root filesystem, and the +needed directories copied to a RAM filesystem at boot time. The scan +directory can be either the place where the working copies are written, +or another directory containing symlinks to those working copies. (The +latter is useful if you are not using s6-svscan -t0: copying a +directory is not atomic, but making a symlink is, so there is no risk +of your scanner finding an incomplete directory.) +

+ +

+ An example: +

+ + + + + -- cgit v1.2.3