From 1c71ce95fab4889abc1b48413a21b4c55cf6beb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Schneider?= Date: Thu, 14 Nov 2013 14:38:28 +0100 Subject: [PATCH] init.d: create pid directory if it doesn't exist --- debian/init.d | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/init.d b/debian/init.d index 25af423..92053b7 100644 --- a/debian/init.d +++ b/debian/init.d @@ -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 #