You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ar...@apache.org on 2024/10/02 16:05:57 UTC
(ambari-metrics) branch master updated: status: command not found (#125)
This is an automated email from the ASF dual-hosted git repository.
arshad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ambari-metrics.git
The following commit(s) were added to refs/heads/master by this push:
new cc4204b status: command not found (#125)
cc4204b is described below
commit cc4204bdb63b7a327bb82928ecbf598605188edf
Author: zzccctv <zz...@163.com>
AuthorDate: Thu Oct 3 00:05:51 2024 +0800
status: command not found (#125)
Co-authored-by: zhangzhanchang <zh...@keendata.com>
Signed-off-by: Mohammad Arshad <ar...@apache.org>
---
.../conf/unix/ambari-metrics-grafana | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana b/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
index 58c2598..9285799 100644
--- a/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
+++ b/ambari-metrics-grafana/conf/unix/ambari-metrics-grafana
@@ -89,7 +89,7 @@ fi
DAEMON_OPTS="--pidfile=${PID_FILE} --config=${CONF_FILE} cfg:default.paths.data=${DATA_DIR} cfg:default.paths.logs=${LOG_DIR}"
function isRunning() {
- status -p $PID_FILE $NAME > /dev/null 2>&1
+ test -e "$PID_FILE"
}
case "$1" in
@@ -149,7 +149,7 @@ case "$1" in
exit $return
;;
stop)
- echo -n "Stopping $DESC ..." >> $LOG_FILE
+ echo "Stopping $DESC ..." >> $LOG_FILE
if [ -f "$PID_FILE" ]; then
pid=$(cat "$PID_FILE")
@@ -169,13 +169,22 @@ case "$1" in
fi
echo "OK"
else
- echo -n "(not running)" >> $LOG_FILE
+ echo "(not running)" >> $LOG_FILE
fi
exit 0
;;
status)
- status -p $PID_FILE $NAME
- exit $?
+ if [ -f "$PID_FILE" ]; then
+ pid=$(cat "$PID_FILE")
+ if ps -p "$pid" > /dev/null; then
+ echo "Already running."
+ else
+ echo "Not running."
+ fi
+ else
+ echo "Not running."
+ fi
+ exit 0
;;
restart|force-reload)
if [ -f "$PID_FILE" ]; then
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org