From e8590adb7b433e003f4ba81d38497518f78a8991 Mon Sep 17 00:00:00 2001 From: slfan1989 <55643692+slfan1989@users.noreply.github.com> Date: Mon, 3 Jul 2023 23:46:57 +0800 Subject: [PATCH] HADOOP-18779. Improve hadoop-function.sh#status script. (#5762) --- .../hadoop-common/src/main/bin/hadoop-functions.sh | 7 +++++++ 1 file changed, 7 insertions(+) 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 c4c3157b9d..45fba7232a 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 @@ -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 $? ;;