Created
October 21, 2010 15:45
-
-
Save btbytes/638732 to your computer and use it in GitHub Desktop.
NOT YET TESTED.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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