Return-Path: X-Original-To: apmail-incubator-ambari-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9E0FFC502 for ; Sat, 14 Sep 2013 20:43:54 +0000 (UTC) Received: (qmail 46114 invoked by uid 500); 14 Sep 2013 20:43:53 -0000 Delivered-To: apmail-incubator-ambari-dev-archive@incubator.apache.org Received: (qmail 45843 invoked by uid 500); 14 Sep 2013 20:43:52 -0000 Mailing-List: contact ambari-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-dev@incubator.apache.org Received: (qmail 45825 invoked by uid 99); 14 Sep 2013 20:43:51 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Sep 2013 20:43:51 +0000 Date: Sat, 14 Sep 2013 20:43:51 +0000 (UTC) From: "Vitaly Brodetskyi (JIRA)" To: ambari-dev@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Reopened] (AMBARI-3145) ambari-agent service script should return non-zero when the agent is not running MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-3145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vitaly Brodetskyi reopened AMBARI-3145: --------------------------------------- > ambari-agent service script should return non-zero when the agent is not running > -------------------------------------------------------------------------------- > > Key: AMBARI-3145 > URL: https://issues.apache.org/jira/browse/AMBARI-3145 > Project: Ambari > Issue Type: Bug > Components: agent > Affects Versions: 1.2.5 > Reporter: Vitaly Brodetskyi > Assignee: Vitaly Brodetskyi > Fix For: 1.4.1 > > Attachments: AMBARI-3145.patch > > > The ambari-agent service script should return non-zero when the agent is not running. For example, if a customer wants to have puppet ensure the service is always running, it will not start a killed service because it thinks it's already running when it returns 0. > [root@host-123-123-123 init.d]# service ambari-agent status > ambari-agent currently not running > Usage: /usr/sbin/ambari-agent {start|stop|restart|status} > [root@host-123-123-123 init.d]# echo $? > 0 > For comparison... > [root@host-123-123-123 init.d]# service winbind status > winbindd is stopped > [root@host-123-123-123 init.d]# echo $? > 3 > Possible fix: > AMBARI_AGENT_PID_PATH="/var/run/ambari-agent/ambari-agent.pid"; > RES="3"; > if [ -f $AMBARI_AGENT_PID_PATH ] > then > RES=`cat $AMBARI_AGENT_PID_PATH | xargs ps -f -p | wc -l`; > AMBARI_AGENT_PID=`cat $AMBARI_AGENT_PID_PATH`; > else > RES=-1; > fi > if [ $RES -eq "2" ] > then > echo "OK: Ambari agent is running [PID:$AMBARI_AGENT_PID]"; > exit 0; > else > echo "CRITICAL: Ambari agent is not running [$AMBARI_AGENT_PID_PATH not found]"; > exit 2; > fi -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira