#! /bin/sh # # $FreeBSD: head/devel/py-mwlib/files/nserve.in 370065 2014-10-05 13:29:15Z wen $ # # 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"