소스 검색

HADOOP-18779. Improve hadoop-function.sh#status script. (#5762)

slfan1989 1 년 전
부모
커밋
e8590adb7b
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

+ 7 - 0
hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

@@ -2192,6 +2192,13 @@ function hadoop_daemon_handler
   case ${daemonmode} in
     status)
       hadoop_status_daemon "${daemon_pidfile}"
+      if [[ $? == 0 ]]; then
+        echo "${daemonname} is running as process $(cat "${daemon_pidfile}")."
+      elif [[ $? == 1 ]]; then
+        echo "${daemonname} is stopped."
+      else
+        hadoop_error "hadoop_status_daemon error."
+      fi
       exit $?
     ;;