Skip to content

Commit

Permalink
init script
Browse files Browse the repository at this point in the history
  • Loading branch information
redsymbol committed May 2, 2016
1 parent 2ae01d3 commit 0f3f8be
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions init.d/flaskr
@@ -0,0 +1,37 @@
#!/bin/sh

FLASKR_PID_FILE="/var/run/flaskr.pid"

# Source function library.
. /etc/init.d/functions

RETVAL=0

case "$1" in
start)
echo -n "Starting Flaskr "
daemon python /srv/flaskr/flaskr.py --pidfile "$FLASKR_PID_FILE" > /dev/null
RETVAL=$?
if [ $RETVAL = 0 ]; then
success
else
failure
fi
echo
;;
stop)
echo -n "Shutting down Flaskr "
killproc flaskr
RETVAL=$?
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit $RETVAL

0 comments on commit 0f3f8be

Please sign in to comment.