Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
APE Daemon File
#! /bin/sh
# /etc/init.d/aped
#
# chkconfig: 2345 85 15
# description: APE Daemon
# processname: APE Daemon
#
# Tutorial for installing this file can be found at
# @see http://redrokk.com/2012/06/16/installing-ape-streaming-server-tutorial
# Install the service with chkconfig --add aped
#
# Define where ape is installed.
# The trailing slash is required ( Example : /my/path/bin/ )
APE_DIRECTORY=/etc/ape/bin/
# Define the PID File
PIDFILE=/var/run/aped.pid
# Source function library.
. /etc/init.d/functions
DAEMON="${APE_DIRECTORY}aped --cfg ${APE_DIRECTORY}ape.conf > /dev/null"
start() {
echo -n "Starting APE... "
cd $APE_DIRECTORY;
daemon $DAEMON
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/aped
return $RETVAL
}
stop() {
echo "Stopping APE..."
kill `cat /var/run/aped.pid`
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/aped
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|restart}"
exit 1
;;
esac
exit $RETVAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.