From abbf4129a24c99fbce6d70b191ec19cf0d17e9be Mon Sep 17 00:00:00 2001 From: Andras Bokor Date: Mon, 31 Jul 2017 20:03:43 -0700 Subject: [PATCH] HADOOP-14343. Wrong pid file name in error message when starting secure daemon Signed-off-by: Allen Wittenauer --- .../hadoop-common/src/main/bin/hadoop-functions.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh index 8ac1b0c3465..2744643838f 100755 --- a/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh +++ b/hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh @@ -1873,11 +1873,9 @@ function hadoop_start_secure_daemon_wrapper (( counter++ )) done - # this is for the daemon pid creation #shellcheck disable=SC2086 - echo $! > "${jsvcpidfile}" 2>/dev/null - if [[ $? -gt 0 ]]; then - hadoop_error "ERROR: Cannot write ${daemonname} pid ${daemonpidfile}." + if ! echo $! > "${jsvcpidfile}"; then + hadoop_error "ERROR: Cannot write ${daemonname} pid ${jsvcpidfile}." fi sleep 1