freebsd-ports/www/trafficserver/files/trafficserver.in
Vanilla I. Shu 362a1b3537 Upgrade to 3.0.5.
Approved by:	maintainer
2012-06-21 06:07:16 +00:00

42 lines
984 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: trafficserver
# REQUIRE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
rcvar=trafficserver_enable
name="trafficserver"
trafficserver_enable=${trafficserver_enable:-"NO"}
trafficserver_tm_pidfile=${trafficserver_tm_pidfile:-"/usr/local/var/trafficserver/manager.lock"}
trafficserver_ts_pidfile=${trafficserver_ts_pidfile:-"/usr/local/var/trafficserver/server.lock"}
pidfile="/var/run/traffic_cop.lock"
stop_cmd="trafficserver_stop"
command=/usr/sbin/daemon
command_args="-p ${pidfile} %%PREFIX%%/bin/traffic_cop"
procname="%%PREFIX%%/bin/traffic_cop"
trafficserver_stop()
{
if [ -f ${pidfile} ]; then
kill `cat ${pidfile}`
rm -f ${pidfile}
fi
if [ -f ${trafficserver_tm_pidfile} ]; then
kill `cat ${trafficserver_tm_pidfile}`
rm -f ${trafficserver_tm_pidfile}
fi
if [ -f ${trafficserver_ts_pidfile} ]; then
kill `cat ${trafficserver_ts_pidfile}`
rm -f ${trafficserver_ts_pidfile}
fi
}
load_rc_config "$name"
run_rc_command "$1"