Arch Linux rc.d for BRU Server Agent

For Arch Linux users of BRU Server Agent, the following rc.d script has been provided by TOLIS Group Engineering to the startup, shutdown, and restart of the BRU Server Agent daemon.

Make sure you add the "BRUServerAgent" to the "DAEMONS" list in your /etc/rc.conf file.

The below script should be placed in the /etc/rc.d/BRUServerAgent file using your favorite text editor.

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/BRUServerAgent

PID="$(cat /var/run/bru-server_agent.pid 2> /dev/null)"

case "$1" in
start)
stat_busy "Starting BRU Server Agent Daemon"
[ -z "$PID" ] && /usr/local/bru-server/agent $AGENT_ARGS
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon BRUServerAgent
stat_done
fi
;;
stop)
stat_busy "Stopping BRU Server Agent Daemon"
[ ! -z "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon BRUServerAgent
stat_done
fi
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0

For questions or concerns, please contact TOLIS Group Technical Support.