summaryrefslogtreecommitdiff
path: root/devel/py-mwlib/files/nslave.in
blob: 94342b9b668ec5c78d4f154482b52e7e629acbae (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
#! /bin/sh
#
# $FreeBSD$
#

# PROVIDE: nslave
# REQUIRE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable nslave:
#
#nslave_enable="YES"

. /etc/rc.subr

name="nslave"
rcvar="nslave_enable"

load_rc_config $name

: ${nslave_user:=www}
: ${nslave_group:=www}
: ${nslave_enable:=NO}

pidfile="/var/run/${name}.pid"
command="/usr/sbin/daemon"
command_args="-c -f -p ${pidfile} %%PREFIX%%/bin/nslave ${nslave_args}"
command_interpreter="%%PYTHON_CMD%%"
procname="%%PREFIX%%/bin/nslave"

start_precmd=nslave_pre_start

nslave_pre_start() {
    /usr/bin/install -o ${nslave_user} -g ${nslave_group} -m 644 /dev/null ${pidfile}
}

run_rc_command "$1"