Commit d0096837 authored by Geoff Simmons's avatar Geoff Simmons

trackrdrd: init script: assume the default config file

                        make sure varnishd is running and trackrdrd is
                        not already running
parent 18bea5b4
......@@ -15,11 +15,14 @@
# sends each data record to an ActiveMQ message broker.
### END INIT INFO
CONFIG=/var/opt/varnish_tracking/etc/run.conf
PIDFILE=/var/run/trackrdrd.pid
TRACKRDRD_BIN=/var/opt/varnish_tracking/bin/trackrdrd
CMD="${TRACKRDRD_BIN} -c ${CONFIG}"
# We use the default config /etc/trackrdrd.conf, no -c option needed
#CONFIG=/var/opt/varnish_tracking/etc/run.conf
#CMD="${TRACKRDRD_BIN} -c ${CONFIG}"
CMD="${TRACKRDRD_BIN}"
# Child process stops after receiving a request
CURL=/usr/bin/curl
......@@ -61,8 +64,22 @@ function getstatus_trackrdrd {
echo "trackrdrd running"
}
function check_varnishd {
pgrep -f varnishd.*pa_proxy >/dev/null
if [ $? -ne 0 ]
echo "varnishd not running"
exit 1
fi
}
case "$1" in
start)
checkproc ${TRACKRDRD_BIN}
if [ $? -eq 0 ]; then
echo "trackrdrd already running"
exit 1
fi
check_varnishd
start_trackrdrd
exit 0
;;
......@@ -71,6 +88,7 @@ case "$1" in
exit 0
;;
restart)
check_varnishd
echo "Restarting trackrdrd"
stop_trackrdrd
sleep 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment