Skip to content

Instantly share code, notes, and snippets.

Created May 29, 2012 20:18
Show Gist options
  • Save anonymous/2830457 to your computer and use it in GitHub Desktop.
Save anonymous/2830457 to your computer and use it in GitHub Desktop.
stdin
#!/sbin/runscript
UWSGI_CONF="/etc/uwsgi/uwsgi.xml"
opts="depend start stop reload"
depend() {
need net
use nginx
#use apache2 lighttpd nginx
}
start() {
ebegin "Starting uwsgi server"
/usr/bin/uwsgi --pidfile /var/run/uwsgi/uwsgi.pid -x "${UWSGI_CONF}" -d /var/log/uwsgi.log --vacuum
eend $? "Failed to start uwsgi"
}
stop() {
ebegin "Stopping uwsgi server"
#kill -HUP `cat /var/run/uwsgi/uwsgi.pid` &> /dev/null
kill -HUP `pidof uwsgi` &> /dev/null
sleep 3
eend $? "Failed to stop uwsgi"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment