Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 681f89c53 -> 21798024f
  refs/heads/trunk 2d11e5059 -> 0458ec851


AMBARI-19943. Ambari-agent fails to restart in non-root if was running as root 
before (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0458ec85
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0458ec85
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0458ec85

Branch: refs/heads/trunk
Commit: 0458ec8513c85d23016ba5fdcc6e86fd78e5d4a4
Parents: 2d11e50
Author: Andrew Onishuk <[email protected]>
Authored: Thu Feb 9 17:10:20 2017 +0200
Committer: Andrew Onishuk <[email protected]>
Committed: Thu Feb 9 17:10:20 2017 +0200

----------------------------------------------------------------------
 ambari-agent/conf/unix/ambari-agent | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0458ec85/ambari-agent/conf/unix/ambari-agent
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/ambari-agent 
b/ambari-agent/conf/unix/ambari-agent
index 10913f8..70f58ed 100755
--- a/ambari-agent/conf/unix/ambari-agent
+++ b/ambari-agent/conf/unix/ambari-agent
@@ -175,7 +175,7 @@ case "${1:-}" in
         fi
         echo "Checking for previously running Ambari Agent..."
         if [ -f $PIDFILE ]; then
-          PID=`cat $PIDFILE`
+          PID=`ambari-sudo.sh cat $PIDFILE`
           if ! (ps -p $PID >/dev/null 2>/dev/null); then
             echo "$PIDFILE found with no process. Removing $PID..."
             ambari-sudo.sh rm -f $PIDFILE
@@ -223,7 +223,7 @@ case "${1:-}" in
         ;;
   status)
         if [ -f $PIDFILE ]; then
-          PID=`cat $PIDFILE`
+          PID=`ambari-sudo.sh cat $PIDFILE`
           echo "Found $AMBARI_AGENT PID: $PID"
           if ! (ps -p $PID >/dev/null 2>/dev/null); then
             echo "$AMBARI_AGENT not running. Stale PID File at: $PIDFILE"
@@ -249,7 +249,7 @@ case "${1:-}" in
           exit -1
         fi
         if [ -f $PIDFILE ]; then
-          PID=`cat $PIDFILE`
+          PID=`ambari-sudo.sh cat $PIDFILE`
           echo "Found $AMBARI_AGENT PID: $PID"
           if ! (ps -p $PID >/dev/null 2>/dev/null); then
             tput bold

Reply via email to