Skip to content

Instantly share code, notes, and snippets.

@btbytes
Created October 21, 2010 15:45
Show Gist options
  • Select an option

  • Save btbytes/638732 to your computer and use it in GitHub Desktop.

Select an option

Save btbytes/638732 to your computer and use it in GitHub Desktop.
NOT YET TESTED.
#!/bin/bash
#
# /etc/rc.d/init.d/procer
# procer This shell script takes care of starting and stoppning
# procer (the user space process manager)
# Author: Pradeep Gowda <[email protected]>
#
# Source function library.
. /etc/init.d/functions
NAME=procer
PROCER_DIR=/home/pradeep/deployment
PROFILES_DIR=PROCER_DIR/profiles
PIDFILE=$PROCER_DIR/procer.pid
start() {
echo -n "Starting : " $NAME
if [ -f $PIDFILE ]; then
PID= `cat $PIDFILE`
echo $NAME is already running: $PID
else
cd $PROCER_DIR
procer $PROFILES_DIR $PIDFILE
RETVAL= $?
echo
return $RETVAL
fi
return
}
stop() {
echo -n "Shutting down : " $NAME
echo
killproc procer
echo
rm -f $PIDFILE
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|status|restart"
exit 1
;;
esac
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment