From: Guillaume Pellerin Date: Thu, 7 Nov 2013 23:18:25 +0000 (+0100) Subject: add uwsgi daemon X-Git-Tag: 1.0~3^2~6^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=ea1170c6d87ff732b167202cc7545cbe04a1ca15;p=telecaster-server.git add uwsgi daemon --- diff --git a/tcserver/conf/etc/init.d/uwsgi b/tcserver/conf/etc/init.d/uwsgi new file mode 100755 index 0000000..6631bc4 --- /dev/null +++ b/tcserver/conf/etc/init.d/uwsgi @@ -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