cleaning: removing now useless init script
This commit is contained in:
parent
e27d0d127e
commit
1f0b7c6002
|
@ -1,85 +0,0 @@
|
|||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: mandaye
|
||||
# Required-Start: $all
|
||||
# Required-Stop: $all
|
||||
# Should-Start: $local_fs
|
||||
# Should-Stop: $local_fs
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
### END INIT INFO
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
NAME=mandaye
|
||||
DESC="Mandaye (gunicorn workers)"
|
||||
|
||||
PID_DIR=/var/run/gunicorn
|
||||
LOG_DIR=/var/log/gunicorn
|
||||
|
||||
VIRTUALENV_DIR=/home/mandaye/virtualenv
|
||||
MANDAYE_DIR=$VIRTUALENV_DIR/reverse-proxy
|
||||
|
||||
. /lib/lsb/init-functions
|
||||
|
||||
mkdir -p $PID_DIR
|
||||
mkdir -m770 -p $LOG_DIR
|
||||
|
||||
start() {
|
||||
log_daemon_msg "Starting $DESC"
|
||||
cd $VIRTUALENV_DIR && . bin/activate
|
||||
cd $MANDAYE_DIR
|
||||
start-stop-daemon --start --oknodo --quiet \
|
||||
--chdir $MANDAYE_DIR \
|
||||
--pidfile $PID_DIR/mandaye.pid \
|
||||
--exec $VIRTUALENV_DIR/bin/gunicorn -- \
|
||||
--pid $PID_DIR/mandaye.pid \
|
||||
--name mandaye_gunicorn \
|
||||
--user www-data --group www-data \
|
||||
--daemon \
|
||||
--log-file $LOG_DIR/mandaye.log \
|
||||
--bind=unix:$PID_DIR/mandaye.sock \
|
||||
--workers=30 \
|
||||
--worker-class=sync \
|
||||
--timeout=60 \
|
||||
mandaye.wsgi:application
|
||||
log_success_msg
|
||||
}
|
||||
|
||||
stop() {
|
||||
log_daemon_msg "Stopping $DESC"
|
||||
cd $VIRTUALENV_DIR && . bin/activate
|
||||
cd $MANDAYE_DIR
|
||||
start-stop-daemon --stop --oknodo --retry 1 --quiet --pidfile $PID_DIR/mandaye.pid
|
||||
log_success_msg
|
||||
}
|
||||
|
||||
reload() {
|
||||
log_daemon_msg "Reloading $DESC"
|
||||
cd $VIRTUALENV_DIR && . bin/activate
|
||||
cd $MANDAYE_DIR
|
||||
start-stop-daemon --stop --signal HUP --oknodo --quiet --pidfile $PID_DIR/mandaye.pid
|
||||
log_success_msg
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
reload)
|
||||
reload
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $NAME {start|stop|restart|reload}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Reference in New Issue