Make v3 pidfile directory creation dynamic

Addition of Zuul v3 initscripts raced the dynamic pidfile directory
creation fix Idfd5d19e5171278b9bb7005edb4ae927a01f3615. Port it to
them so that if the PIDFILE variable is overridden for a custom
path, we create the correct parent directory.

Change-Id: I3af4e0eb280eed5dfeab909ad4e3fb24ede75a5a
This commit is contained in:
Jeremy Stanley 2020-01-21 22:48:52 +00:00
parent fb45aaaeec
commit 63126bdbb8
4 changed files with 24 additions and 8 deletions

View File

@ -33,6 +33,8 @@ USER=zuul
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
PIDFILE_DIR=$(dirname $PIDFILE)
#
# Function that starts the daemon/service
#
@ -44,8 +46,10 @@ do_start()
# 2 if daemon could not be started
# 3 if pid file already exist
mkdir -p /var/run/$NAME
chown $USER /var/run/$NAME
if [ ! -d "$PIDFILE_DIR" ] ; then
mkdir -p $PIDFILE_DIR
chown $USER $PIDFILE_DIR
fi
ulimit -n 8192
if [ -f $PIDFILE ]; then
return 3

View File

@ -33,6 +33,8 @@ USER=zuul
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
PIDFILE_DIR=$(dirname $PIDFILE)
#
# Function that starts the daemon/service
#
@ -44,8 +46,10 @@ do_start()
# 2 if daemon could not be started
# 3 if pid file already exist
mkdir -p /var/run/$NAME
chown $USER /var/run/$NAME
if [ ! -d "$PIDFILE_DIR" ] ; then
mkdir -p $PIDFILE_DIR
chown $USER $PIDFILE_DIR
fi
ulimit -n 8192
if [ -f $PIDFILE ]; then
return 3

View File

@ -33,6 +33,8 @@ USER=zuul
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
PIDFILE_DIR=$(dirname $PIDFILE)
#
# Function that starts the daemon/service
#
@ -44,8 +46,10 @@ do_start()
# 2 if daemon could not be started
# 3 if pid file exits already
mkdir -p /var/run/$NAME
chown $USER /var/run/$NAME
if [ ! -d "$PIDFILE_DIR" ] ; then
mkdir -p $PIDFILE_DIR
chown $USER $PIDFILE_DIR
fi
ulimit -n 8192
if [ -f $PIDFILE ]; then
return 3

View File

@ -33,6 +33,8 @@ USER=zuul
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
PIDFILE_DIR=$(dirname $PIDFILE)
#
# Function that starts the daemon/service
#
@ -44,8 +46,10 @@ do_start()
# 2 if daemon could not be started
# 3 if pid file exits already
mkdir -p /var/run/$NAME
chown $USER /var/run/$NAME
if [ ! -d "$PIDFILE_DIR" ] ; then
mkdir -p $PIDFILE_DIR
chown $USER $PIDFILE_DIR
fi
ulimit -n 8192
if [ -f $PIDFILE ]; then
return 3