Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1666fb017d
Fetching contributors…

Cannot retrieve contributors at this time

file 43 lines (39 sloc) 0.88 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

. /etc/conf.d/uwsgi

case "$1" in
    start)
        stat_busy "Starting uwsgi"
        if [ -s "$UWSGI_PIDFILE" ]; then
          stat_fail
          stat_busy "Uwsgi is already running"
          stat_die
        fi
        /usr/bin/uwsgi --daemonize "$UWSGI_DAEMONIZE" --ini "$UWSGI_INI" --pidfile2 "$UWSGI_PIDFILE" &>/dev/null
        if [ $? -gt 0 ]; then
            stat_fail
        else
            add_daemon uwsgi
            stat_done
        fi
    ;;
    stop)
        stat_busy "Stopping uwsgi"
        kill -QUIT `cat "$UWSGI_PIDFILE"` &>/dev/null
        if [ $? -ne 0 ]; then
            stat_fail
        else
            rm_daemon uwsgi
            stat_done
        fi
    ;;
    restart)
        $0 stop
        sleep 1
        $0 start
    ;;
    *)
    echo "usage: $0 {start|stop|restart}"
esac

exit 0
Something went wrong with that request. Please try again.