summary refs log tree commit diff
path: root/man/runsvdir.8
blob: 7aa7249f33c6f17625ff06e37d71c6bb2d8aae7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
.TH runsvdir 8
.SH NAME
runsvdir \- starts and monitors a collection of runsv(8) processes
.SH SYNOPSIS
.B runsvdir
[\-P]
.I dir
[
.I log
]
.SH DESCRIPTION
.I dir
must be a directory.
.I log
is a space holder for a readproctitle log, and must be at least seven
characters long or absent.
.P
.B runsvdir
starts a
.BR runsv (8)
process for each subdirectory in the services directory
.IR dir ,
up to a limit of 1000 subdirectories.
.B runsvdir
skips subdirectory names starting with dots.
.BR runsv (8)
must be in
.BR runsvdir 's
PATH.
.P
At least every five seconds
.B runsvdir
checks whether the services directory
.I dir
has changed.
If it sees a new subdirectory in
.IR dir ,
it starts a new
.BR runsv (8)
process.
If it sees an old sudirectory where a
.BR runsv (8)
process has exited, it restarts the
.BR runsv (8)
process.
If
.B runsvdir
sees a subdirectory being removed that was previously there, it sends the
corresponding
.BR runsv (8)
process a TERM signal, stops monitoring this process, and so does not
restart the
.BR runsv (8)
process if it exits.
.P
If the
.I log
argument is given to
.BR runsvdir ,
all output to standard error is redirected to this
.IR log ,
which is similar to the daemontools'
.B readproctitle
log.
To see the most recent error messages, use a process-listing tool such as
.BR ps (1).
.B runsvdir
writes a dot to the readproctitle log every 15 minutes so that old error
messages expire.
.SH OPTIONS
.TP
.B \-P
use
.BR setsid (2)
to run each
.BR runsv (8)
process in a new session and separate process group.
.SH SIGNALS
If
.B runsvdir
receives a TERM signal, it exits with 0 immediately.
.P
If
.B runsvdir
receives a HUP signal, it sends a TERM signal to each
.BR runsv (8)
process it is monitoring and then exits with 111.
.SH SEE ALSO
sv(8),
runsv(8),
runsvchdir(8),
runit(8),
runit-init(8),
chpst(8),
svlogd(8),
utmpset(8),
setsid(2)
.P
http://smarden.org/runit/
.SH AUTHOR
Gerrit Pape <pape@smarden.org>