Changeset - 592bcf2e1517
[Not reviewed]
default
0 0 1
Dennis Fink - 11 years ago 2014-01-21 19:42:56
dennis.fink@c3l.lu
added init script for gunicorn
1 file changed with 36 insertions and 0 deletions:
0 comments (0 inline, 0 general)
Scripts/init_script_gunicorn.sh
Show inline comments
 
new file 100644
 
NAME=ennstatus
 
DESC=ennstatus
 
 
 
start () {
 
    echo "Starting ennstatus"
 
    source /var/www/enn.lu/ennstatus/bin/activate
 
    gunicorn -w 4 --chdir /var/www/enn.lu/ennstatus/chroot/ -D -p /var/run/ennstatus.pid -u www-data -g www-data -e ENNSTATUS_SETTINGS=/var/www/enn.lu/ennstatus/chroot/config.py -b 127.0.0.1 ennstatus:app
 
    return
 
}
 
 
 
stop () {
 
    echo "Killing ennstatus"
 
    kill $(cat /var/run/ennstatus.pid)
 
}
 
 
 
case "$1" in
 
    start)
 
        echo "Starting $DESC"
 
        start
 
        ;;
 
    stop)
 
        echo "Stopping $DESC"
 
        stop
 
        ;;
 
    restart)
 
        echo "Restarting $DESC"
 
        stop
 
        sleep 1
 
        start
 
        ;;
 
    *)
 
        echo "Usage: ennstatus {start|stop|restart}"
 
        exit 1
 
        ;;
 
    esac
 
exit 0
0 comments (0 inline, 0 general)