#! /bin/sh # $FreeBSD$ # # PROVIDE: dotlrn # REQUIRE: DAEMON NETWORKING SERVERS # KEYWORD: shutdown # # Add the following line to /etc/rc.conf to enable dotlrn: # # dotlrn_enable="YES" # # Tweakable parameters for users to override in rc.conf . /etc/rc.subr name=dotlrn rcvar=dotlrn_enable load_rc_config ${name} : ${dotlrn_enable="NO"} : ${dotlrn_user="%%OPENACS_USER%%"} : ${dotlrn_group="%%OPENACS_GROUP%%"} : ${dotlrn_conf=%%OPENACSBASE%%/etc/dotlrn-config.tcl} : ${dotlrn_flags="-u ${dotlrn_user} -g ${dotlrn_group}"} : ${dotlrn_prog=%%AOLSERVERBASE%%/bin/nsd} : ${dotlrn_pidfile=/var/run/dotlrn.pid} pidfile=${dotlrn_pidfile} start_postcmd="start_postcmd" stop_postcmd="stop_postcmd" required_files=${dotlrn_conf} command=%%AOLSERVERBASE%%/bin/nsd command_args="-t ${dotlrn_conf}" procname=${dotlrn_prog} start_postcmd() { PID=`pgrep -U ${dotlrn_user} -f ${dotlrn_conf}` [ -n "${PID}" ] && echo ${PID} > ${pidfile} } stop_postcmd() { [ -f "${pidfile}" ] && rm ${pidfile} } run_rc_command "$1"