From 39d4ae2b424edf32d457723cba30c65aa55ee4f2 Mon Sep 17 00:00:00 2001 From: LV-426 Date: Sun, 18 Jan 2015 21:43:38 +0200 Subject: init script: create pidfile under /var/run/$NAME - required to run as USERNAME:GROUPNAME --- res/debian/rhizi.init | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'res') diff --git a/res/debian/rhizi.init b/res/debian/rhizi.init index c8c6870d..d00d97da 100644 --- a/res/debian/rhizi.init +++ b/res/debian/rhizi.init @@ -16,7 +16,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="rhizi-server" NAME=rhizi DAEMON=/srv/www/rhizi/rhizi.net/bin/rz_server.py -PIDFILE=/var/run/$NAME.pid +PIDFILE=/var/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME USERNAME=www-data GROUPNAME=www-data @@ -38,6 +38,12 @@ ARGS__START_STOP_DAEMON="--make-pidfile --background --chuid ${USERNAME}:${GROUP # and status_of_proc is working. . /lib/lsb/init-functions +# make sure /var/run/$NAME exists with proper +w mode as the uid:gid used to fork the server +if [ ! -d /var/run/$NAME ]; then + mkdir /var/run/$NAME + chown ${USERNAME}:${GROUPNAME} /var/run/$NAME +fi + # # Function that starts the daemon/service # -- cgit v1.3.1