Created
November 12, 2011 01:18
-
-
Save prestontimmons/1359849 to your computer and use it in GitHub Desktop.
uwsgi init script
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/init.d/uwsgi | |
# | |
daemon=/path/to/uwsgi | |
pid=/path/to/uwsgi.pid | |
args="-x /path/to/uwsgi.xml" | |
# Carry out specific functions when asked to by the system | |
case "$1" in | |
start) | |
echo "Starting uwsgi" | |
start-stop-daemon -p $pid --start --exec $daemon -- $args | |
;; | |
stop) | |
echo "Stopping script uwsgi" | |
start-stop-daemon --signal INT -p $pid --stop $daemon -- $args | |
;; | |
reload) | |
echo "Reloading conf" | |
kill -HUP $(cat $pid) | |
;; | |
*) | |
echo "Usage: /etc/init.d/uwsgi {start|stop|reload}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment