From e7df808c30e99f2692f08cf5a1771410e4fe0ea3 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 10 Oct 2016 09:30:15 -0400 Subject: [PATCH] Expose RUNASUSER to init.d scripts Remove hardcoded nodepool user from our init.d scripts. Sadly, we cannot do this with systemd (that I know of). Change-Id: Ia284b3dc3b39633b4b484d047a1f0c2f6fc0b512 Signed-off-by: Paul Belanger --- files/etc/default/nodepool | 3 +++ files/etc/default/nodepool-builder | 3 +++ files/etc/default/nodepool-deleter | 3 +++ files/etc/default/nodepool-launcher | 3 +++ files/etc/init.d/nodepool | 2 +- files/etc/init.d/nodepool-builder | 2 +- files/etc/init.d/nodepool-deleter | 2 +- files/etc/init.d/nodepool-launcher | 2 +- 8 files changed, 16 insertions(+), 4 deletions(-) diff --git a/files/etc/default/nodepool b/files/etc/default/nodepool index eb3070b..c924ccf 100644 --- a/files/etc/default/nodepool +++ b/files/etc/default/nodepool @@ -9,4 +9,7 @@ PREFIX=/usr/local # Options to pass to nodepoold. ARGS="-l /etc/nodepool/logging.conf --no-builder --no-deletes --no-launches" +# The user used to nodepool service. +RUNASUSER=nodepool + DIB_IMAGE_CACHE=/opt/nodepool/cache diff --git a/files/etc/default/nodepool-builder b/files/etc/default/nodepool-builder index c359a3d..31f9641 100644 --- a/files/etc/default/nodepool-builder +++ b/files/etc/default/nodepool-builder @@ -9,4 +9,7 @@ PREFIX=/usr/local # Options to pass to nodepool-builder. ARGS="-l /etc/nodepool/builder-logging.conf" +# The user used to nodepool-builder service. +RUNASUSER=nodepool + DIB_IMAGE_CACHE=/opt/nodepool/cache diff --git a/files/etc/default/nodepool-deleter b/files/etc/default/nodepool-deleter index 493b2a2..87da989 100644 --- a/files/etc/default/nodepool-deleter +++ b/files/etc/default/nodepool-deleter @@ -9,4 +9,7 @@ PREFIX=/usr/local # Options to pass to nodepool-deleter. ARGS="-l /etc/nodepool/deleter-logging.conf --no-builder --no-images --no-launches --no-webapp" +# The user used to nodepool-deleter service. +RUNASUSER=nodepool + DIB_IMAGE_CACHE=/opt/nodepool/cache diff --git a/files/etc/default/nodepool-launcher b/files/etc/default/nodepool-launcher index e41b7ff..cf69350 100644 --- a/files/etc/default/nodepool-launcher +++ b/files/etc/default/nodepool-launcher @@ -9,4 +9,7 @@ PREFIX=/usr/local # Options to pass to nodepool-launcher. ARGS="-l /etc/nodepool/launcher-logging.conf --no-builder --no-deletes --no-images --no-webapp" +# The user used to nodepool-launcher service. +RUNASUSER=nodepool + DIB_IMAGE_CACHE=/opt/nodepool/cache diff --git a/files/etc/init.d/nodepool b/files/etc/init.d/nodepool index 716e31e..3351deb 100644 --- a/files/etc/init.d/nodepool +++ b/files/etc/init.d/nodepool @@ -15,12 +15,12 @@ DESC="Nodepool" NAME=nodepool PIDFILE=/var/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -USER=nodepool # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME DAEMON=$PREFIX/bin/nodepoold +USER=${RUNASUSER:-nodepool} # Exit if the package is not installed if ! [ -x "$DAEMON" ]; then diff --git a/files/etc/init.d/nodepool-builder b/files/etc/init.d/nodepool-builder index 3083959..2ccb16e 100644 --- a/files/etc/init.d/nodepool-builder +++ b/files/etc/init.d/nodepool-builder @@ -15,12 +15,12 @@ DESC="Nodepool Builder" NAME=nodepool-builder PIDFILE=/var/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -USER=nodepool # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME DAEMON=$PREFIX/bin/nodepool-builder +USER=${RUNASUSER:-nodepool} # Exit if the package is not installed if ! [ -x "$DAEMON" ]; then diff --git a/files/etc/init.d/nodepool-deleter b/files/etc/init.d/nodepool-deleter index c7adff6..7f9930b 100644 --- a/files/etc/init.d/nodepool-deleter +++ b/files/etc/init.d/nodepool-deleter @@ -15,12 +15,12 @@ DESC="Nodepool Deleter" NAME=nodepool-deleter PIDFILE=/var/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -USER=nodepool # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME DAEMON=$PREFIX/bin/nodepoold +USER=${RUNASUSER:-nodepool} # Exit if the package is not installed if ! [ -x "$DAEMON" ]; then diff --git a/files/etc/init.d/nodepool-launcher b/files/etc/init.d/nodepool-launcher index 2ef6a4a..e12b8ab 100644 --- a/files/etc/init.d/nodepool-launcher +++ b/files/etc/init.d/nodepool-launcher @@ -15,12 +15,12 @@ DESC="Nodepool Launcher" NAME=nodepool-launcher PIDFILE=/var/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -USER=nodepool # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME DAEMON=$PREFIX/bin/nodepoold +USER=${RUNASUSER:-nodepool} # Exit if the package is not installed if ! [ -x "$DAEMON" ]; then