Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2014
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.99 KB | None | 0 0
  1. #!/bin/sh -e
  2.  
  3. # Starts, stops, and restarts rest service
  4.  
  5. ### BEGIN INIT INFO
  6. # Provides:          rest-service
  7. # Required-Start:    $remote_fs $syslog
  8. # Required-Stop:     $remote_fs $syslog
  9. # Default-Start:     2 3 4 5
  10. # Default-Stop:      0 1 6
  11. # Short-Description: Start daemon at boot time
  12. # Description:       Enable service provided by daemon.
  13. ### END INIT INFO
  14.  
  15. REST_DIR="/home/ec2-user/"
  16.  
  17. case $1 in
  18.     start)
  19.         echo "Starting rest service"
  20.         cd $REST_DIR
  21.     source rest/bin/activate
  22.     python rest/run.py start rest/Conf/app.json
  23.         #$JAVA $JAVA_OPTIONS > $LOG_FILE 2>&1 &
  24.         ;;
  25.     stop)
  26.         echo "Stopping rest service"
  27.         cd $REST_DIR
  28.         source rest/bin/activate
  29.         python rest/run.py stop rest/Conf/app.json
  30.         #$JAVA $JAVA_OPTIONS --stop
  31.         ;;
  32.     restart)
  33.         $0 stop
  34.         sleep 1
  35.         $0 start
  36.         ;;
  37.     *)
  38.         echo "Usage: $0 {start|stop|restart}" >&2
  39.         exit 1
  40.         ;;
  41. esac
  42.  
  43. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement