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.
This commit is contained in:
Aldrin Piri 2016-04-27 11:18:32 -04:00
parent eded0de154
commit 6938c3db54
1 changed files with 1 additions and 1 deletions

View File

@ -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