aboutsummaryrefslogblamecommitdiff
path: root/devel/py-mwlib/files/nserve.in
blob: e9242c631e29e97086fb371164e4672b384f2814 (plain) (tree)





































                                                                                     
#! /bin/sh
#
# $FreeBSD$
#

# PROVIDE: nserve
# REQUIRE: DAEMON
# KEYWORD: shutdown

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

. /etc/rc.subr

name="nserve"
rcvar="nserve_enable"

load_rc_config $name

: ${nserve_user:=www}
: ${nserve_group:=www}
: ${nserve_enable:=NO}

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

start_precmd=nserve_pre_start

nserve_pre_start() {
    /usr/bin/install -o ${nserve_user} -g ${nserve_group} -m 644 /dev/null ${pidfile}
}

run_rc_command "$1"