Skip to content

Commit d9d95b4

Browse files
author
slfan1989
committed
HADOOP-18779. Improve hadoop-function.sh#status script.
1 parent 5c02f21 commit d9d95b4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hadoop-common-project/hadoop-common/src/main/bin/hadoop-functions.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,13 @@ function hadoop_daemon_handler
21922192
case ${daemonmode} in
21932193
status)
21942194
hadoop_status_daemon "${daemon_pidfile}"
2195+
if [[ $? == 0 ]]; then
2196+
echo "${daemonname} is running as process $(cat "${daemon_pidfile}")."
2197+
elif [[ $? == 1 ]]; then
2198+
echo "${daemonname} is stopped."
2199+
else
2200+
hadoop_error "hadoop_status_daemon error."
2201+
fi
21952202
exit $?
21962203
;;
21972204

0 commit comments

Comments
 (0)