]> git.parisson.com Git - telecaster-server.git/commitdiff
add uwsgi daemon
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 7 Nov 2013 23:18:25 +0000 (00:18 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 7 Nov 2013 23:18:25 +0000 (00:18 +0100)
tcserver/conf/etc/init.d/uwsgi [new file with mode: 0755]

diff --git a/tcserver/conf/etc/init.d/uwsgi b/tcserver/conf/etc/init.d/uwsgi
new file mode 100755 (executable)
index 0000000..6631bc4
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+# /etc/init.d/uwsgi
+#
+
+DAEMON=/usr/local/bin/uwsgi
+PID=/var/run/uwsgi.pid
+INI=/home/parisson/apps/icpmedia/uwsgi.ini
+LOG=/var/log/uwsgi/icpmedia.log
+USER=www-data
+ARGS="--ini $INI --uid $USER --gid $USER --pidfile=$PID --enable-threads --daemonize=$LOG"
+
+# Carry out specific functions when asked to by the system
+case "$1" in
+    start)
+        echo "Starting uwsgi"
+        start-stop-daemon --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