From 1ced488e72cb0d2e860e86de3b5817951401b960 Mon Sep 17 00:00:00 2001 From: Emeka Date: Tue, 8 Nov 2016 12:13:45 -0500 Subject: [PATCH] Check for CODEDEPLOY_USER in environment variable for non-root user --- init.d/codedeploy-agent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.d/codedeploy-agent b/init.d/codedeploy-agent index 941c5f42..3568c492 100755 --- a/init.d/codedeploy-agent +++ b/init.d/codedeploy-agent @@ -22,9 +22,9 @@ RETVAL=0 [ -f /etc/profile ] && [ "`stat --format '%U %G' /etc/profile`" == "root root" ] && source /etc/profile prog="codedeploy-agent" -# Modify the following CODEDEPLOY_USER variable to run the codedeploy process as a non-root user # Note: You also need to chown /opt/codedeploy /var/log/aws -CODEDEPLOY_USER="" +# Note: you can modify or set CODEDEPLOY_USER as an environment variable to run the codedeploy process as a non-root user +if [ -z ${CODEDEPLOY_USER+x} ]; then CODEDEPLOY_USER=""; fi AGENT_ROOT="/opt/codedeploy-agent/" INSTALLER="/opt/codedeploy-agent/bin/install" BIN="/opt/codedeploy-agent/bin/codedeploy-agent"