init.d: create pid directory if it doesn't exist

This commit is contained in:
Jérôme Schneider 2013-11-14 14:38:28 +01:00
parent cd05a1c00f
commit 1c71ce95fa
1 changed files with 9 additions and 2 deletions

11
debian/init.d vendored
View File

@ -15,8 +15,9 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC=compte-agglo-montpellier
NAME=compte-agglo-montpellier
DAEMON=/usr/bin/gunicorn
PIDFILE=/var/run/compte-agglo-montpellier/$NAME.pid
LOG_DIR=/var/log/compte-agglo-montpellier
PID_DIR=/var/run/$NAME
LOG_DIR=/var/log/$NAME
PIDFILE=$PID_DIR/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
USER=compte-agglo-montpellier
@ -49,6 +50,12 @@ compte_agglo_montpellier.wsgi:application"
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
# Create pid directory
if [ ! -d $PID_DIR ]; then
install -d -m 755 -o $NAME -g $NAME $PID_DIR
fi
#
# Function that starts the daemon/service
#