Skip to content

Instantly share code, notes, and snippets.

@jonathonbyrdziak
Created June 16, 2012 18:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jonathonbyrdziak/2942151 to your computer and use it in GitHub Desktop.
Save jonathonbyrdziak/2942151 to your computer and use it in GitHub Desktop.
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