From 6938c3db54401e46fd7fb5f61321e7683f5a276c Mon Sep 17 00:00:00 2001 From: Aldrin Piri Date: Wed, 27 Apr 2016 11:18:32 -0400 Subject: [PATCH] NIFI-1817 Respecting when run.as is commented out by ensuring the chosen line starts with run.as optionally preceded by whitespace This closes #383. --- .../nifi-resources/src/main/resources/bin/nifi.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh index 063065d8fe..353ee13244 100755 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh @@ -164,7 +164,7 @@ run() { BOOTSTRAP_CONF="${BOOTSTRAP_CONF_DIR}/bootstrap.conf"; BOOTSTRAP_LIBS="${NIFI_HOME}/lib/bootstrap/*" - run_as=$(grep run.as "${BOOTSTRAP_CONF}" | cut -d'=' -f2) + run_as=$(grep '^\s*run.as' "${BOOTSTRAP_CONF}" | cut -d'=' -f2) # If the run as user is the same as that starting the process, ignore this configuration if [ "$run_as" = "$(whoami)" ]; then unset run_as