aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-12-25 20:41:00 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-12-25 20:41:00 +0100
commit96f1d6b70c6c27798df6867d3cd98b385da624ea (patch)
tree4c3ae892986f5656c40f23a0f353ad60baaba418
parent7d5c881bd0cbf3cb1a755acf95a00b37625f7628 (diff)
downloadbusybox-w32-96f1d6b70c6c27798df6867d3cd98b385da624ea.tar.gz
busybox-w32-96f1d6b70c6c27798df6867d3cd98b385da624ea.tar.bz2
busybox-w32-96f1d6b70c6c27798df6867d3cd98b385da624ea.zip
Update to examples/var_service/README_distro_proposal.txt
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--examples/var_service/README_distro_proposal.txt35
1 files changed, 21 insertions, 14 deletions
diff --git a/examples/var_service/README_distro_proposal.txt b/examples/var_service/README_distro_proposal.txt
index 9b3fe04ba..8140facba 100644
--- a/examples/var_service/README_distro_proposal.txt
+++ b/examples/var_service/README_distro_proposal.txt
@@ -98,10 +98,10 @@ It is not required that a specific clone should be used. Let evolution work.
98daemon: any long running background program. Common examples are sshd, getty, 98daemon: any long running background program. Common examples are sshd, getty,
99ntpd, dhcp client... 99ntpd, dhcp client...
100 100
101service: same as "daemon" 101service: daemon controlled by a service monitor.
102 102
103service directory: a directory with an executable file (script) named "run" 103service directory: a directory with an executable file (script) named "run"
104which (usually) execs daemon (possibly after some preparatory steps). 104which (usually) execs some daemon, possibly after some preparatory steps.
105It should start it not as a child or daemonized process, but by exec'ing it 105It should start it not as a child or daemonized process, but by exec'ing it
106(inheriting the same PID and the place in the process tree). 106(inheriting the same PID and the place in the process tree).
107 107
@@ -116,7 +116,7 @@ whose directories disappeared.
116 116
117supervisor: a tool which monitors one service directory. 117supervisor: a tool which monitors one service directory.
118It runs "run" script as its child. It restarts it if it dies. 118It runs "run" script as its child. It restarts it if it dies.
119It can be instructed to start/top/signal its child. 119It can be instructed to start/stop/signal its child.
120In daemontools package, it is called "supervise". In runit, it is called 120In daemontools package, it is called "supervise". In runit, it is called
121"runsv". In s6, it is called "s6-supervise". 121"runsv". In s6, it is called "s6-supervise".
122 122
@@ -150,7 +150,9 @@ The less distros diverge, the easier users' lives are.
150 150
151System-wide service dirs reside in a distro-specific location. 151System-wide service dirs reside in a distro-specific location.
152The recommended location is /var/service. (However, since it is not 152The recommended location is /var/service. (However, since it is not
153a mandatory location, avoid depending on it in your run scripts). 153a mandatory location, avoid depending on it in your run scripts.
154Void Linux wanted to have it somewhere in /run/*, and they solved this
155by making /var/service a symlink).
154 156
155The install location for service dirs is /etc/rc: 157The install location for service dirs is /etc/rc:
156when e.g. ntpd daemon is installed, it creates the /etc/rc/ntpd 158when e.g. ntpd daemon is installed, it creates the /etc/rc/ntpd
@@ -182,10 +184,14 @@ of bad things may happen. This may be worked around by various
182heuristics in service monitor which give new service a few seconds 184heuristics in service monitor which give new service a few seconds
183of "grace time" to be fully populated; but this is not yet 185of "grace time" to be fully populated; but this is not yet
184implemented in any of three packages. 186implemented in any of three packages.
187This also may be worked around by creating a .dotdir (a directory
188whose name starts with a dot), populating it, and then renaming;
189but packaging tools usually do not have an option to do this
190automatically - additional install stripting in packages will be needed.
185 191
186Daemons' output file descriptors are handled somewhat awkwardly 192Daemons' output file descriptors are handled somewhat awkwardly
187by various daemontools implementations. For example, for runit tools, 193by various daemontools implementations. For example, for runit tools,
188daemons' stdout goes to wherever runsdir's stdout was directied; 194daemons' stdout goes to wherever runsvdir's stdout was directied;
189stderr goes to runsvdir, which in turn "rotates" it on its command line 195stderr goes to runsvdir, which in turn "rotates" it on its command line
190(which is visible in ps output). 196(which is visible in ps output).
191 197
@@ -236,11 +242,11 @@ there is no guarantee in which order commands are sent to them.
236If DIR has no slash and is not "." or "..", it is assumed to be 242If DIR has no slash and is not "." or "..", it is assumed to be
237relative to the system-wide service directory. 243relative to the system-wide service directory.
238 244
239The "svok DIR" tool exits 0 if service is running, and nonzero if not. 245[Currently, "svc" exists only in daemontools and in busybox.
246This proposal asks developrs of other daemontools implementations
247to add "svc" command to their projects]
240 248
241The "svstat DIR1 DIR2..." prints one human-readable line for each directory, 249The "svok DIR" tool exits 0 if service is running, and nonzero if not.
242saying whether supervise is successfully running in that directory,
243and reporting the status information maintained by supervise.
244 250
245Other tools with different names and APIs may exist; however 251Other tools with different names and APIs may exist; however
246for portability scripts should use the above tools. 252for portability scripts should use the above tools.
@@ -253,15 +259,16 @@ depending on the distro) its files to the "live" service directory,
253whereever it is located on this distro. 259whereever it is located on this distro.
254 260
255Removal of the service should be done as follows: 261Removal of the service should be done as follows:
256svc -d DIR [DIR/log], then remove the service directory 262svc -d DIR [DIR/log], then remove the service directory:
257(this makes service monitor SIGTERM per-directory supervisors 263this makes service monitor SIGTERM per-directory supervisors
258(if they exist in the implementation)) 264(if they exist in the implementation).
259 265
260 266
261 Implementation details 267 Implementation details
262 268
263Top-level service monitor program name is not standardized. 269Top-level service monitor program name is not standardized
264[svscan, runsvdir, s6-svscan ...] 270[svscan, runsvdir, s6-svscan ...] - it does not need to be,
271as far as daemon packagers are concerned.
265 272
266It may run one per-directory supervisor, or two supervisors 273It may run one per-directory supervisor, or two supervisors
267(one for DIR/ and one for DIR/log/); for memory-constrained systems 274(one for DIR/ and one for DIR/log/); for memory-constrained systems