1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-11 02:50:24 +00:00
freebsd-ports/www/openacs/files/dotlrn.in
Doug Barton 83eb2c3700 In the rc.d scripts, change assignments to rcvar to use the
literal name_enable wherever possible, and ${name}_enable
when it's not, to prepare for the demise of set_rcvar().

In cases where I had to hand-edit unusual instances also
modify formatting slightly to be more uniform (and in
some cases, correct). This includes adding some $FreeBSD$
tags, and most importantly moving rcvar= to right after
name= so it's clear that one is derived from the other.
2012-01-14 08:57:23 +00:00

50 lines
1011 B
Bash

#! /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"