aboutsummaryrefslogtreecommitdiff
path: root/www/openacs/files/dotlrn.in
blob: 8def4dc4d3bbfbc65ddf9c6c835c6e1482d90539 (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
39
40
41
42
43
44
45
46
#! /bin/sh
#
#
# PROVIDE: dotlrn
# REQUIRE: DAEMON NETWORKING SERVERS
#
# 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

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}

rcvar=`set_rcvar`
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"