blob: 39e7b2c4a1508256c0976e98be1edd9188393ed7 (
plain)
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
|
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: runsvdir
# BEFORE: SERVERS
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable `runsvdir':
#
# runsvdir_enable="YES"
# runsvdir_path="/var/service"
. /etc/rc.subr
name=runsvdir
desc="starts and monitors a collection of runsv(8) processes"
rcvar=runsvdir_enable
load_rc_config runsvdir
: ${runsvdir_enable:=NO}
: ${runsvdir_path=/var/service}
command="%%PREFIX%%/sbin/runsvdir"
start_cmd=runsvdir_start
stop_postcmd="%%PREFIX%%/sbin/sv exit ${runsvdir_path}/*"
runsvdir_start()
{
/bin/mkdir -p /var/run/runit/runsvdir
/bin/ln -sF %%RUNITDIR%%/runsvdir/current /var/run/runit/runsvdir/current
/bin/test -d ${runsvdir_path} || /bin/mkdir -p ${runsvdir_path}
/usr/bin/env -i \
PATH=/bin:/sbin:/usr/bin:/usr/sbin:%%PREFIX%%/bin:%%PREFIX%%/sbin:/rescue \
/usr/sbin/daemon -c -f \
${command} ${runsvdir_path} 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
}
run_rc_command $1
|