Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh -e
- # Starts, stops, and restarts rest service
- ### BEGIN INIT INFO
- # Provides: rest-service
- # Required-Start: $remote_fs $syslog
- # Required-Stop: $remote_fs $syslog
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Start daemon at boot time
- # Description: Enable service provided by daemon.
- ### END INIT INFO
- REST_DIR="/home/ec2-user/"
- case $1 in
- start)
- echo "Starting rest service"
- cd $REST_DIR
- source rest/bin/activate
- python rest/run.py start rest/Conf/app.json
- #$JAVA $JAVA_OPTIONS > $LOG_FILE 2>&1 &
- ;;
- stop)
- echo "Stopping rest service"
- cd $REST_DIR
- source rest/bin/activate
- python rest/run.py stop rest/Conf/app.json
- #$JAVA $JAVA_OPTIONS --stop
- ;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
- *)
- echo "Usage: $0 {start|stop|restart}" >&2
- exit 1
- ;;
- esac
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement