소스 검색

HADOOP-14343. Wrong pid file name in error message when starting secure daemon

Signed-off-by: Allen Wittenauer <aw@apache.org>
Andras Bokor 7 년 전
부모
커밋
abbf4129a2
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

+ 2 - 4
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