Skip to content

Instantly share code, notes, and snippets.

@prestontimmons
Created November 12, 2011 01:18
Show Gist options
  • Save prestontimmons/1359849 to your computer and use it in GitHub Desktop.
Save prestontimmons/1359849 to your computer and use it in GitHub Desktop.
uwsgi init script
#! /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