incubator-ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitaly Brodetskyi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMBARI-3145) ambari-agent service script should return non-zero when the agent is not running
Date Mon, 09 Sep 2013 12:50:52 GMT

     [ https://issues.apache.org/jira/browse/AMBARI-3145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Vitaly Brodetskyi updated AMBARI-3145:
--------------------------------------

    Attachment: AMBARI-3145.patch
    
> 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

Mime
View raw message