Skip to content

Commit

Permalink
Don't try to stop datadog-agent with supervisor if not supervised (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
alq666 committed Jun 7, 2012
1 parent 231d298 commit 7650646
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packaging/datadog-agent-base/deb/datadog-agent.init
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,15 @@ case "$1" in

echo -n "Stopping $DESC: "
if [ -f $USE_SUPERVISOR ]; then
echo -n "(using supervisorctl) "
supervisorctl stop datadog-agent:*
# Prevent errors if not under actual supervision
supervised=$(supervisorctl avail | grep datadog-agent | wc -l)
if [ $supervised -gt 1 ]; then
echo -n "(using supervisorctl) "
supervisorctl stop datadog-agent:*
else
# Should have been
echo -n "(warning: datadog-agent supervisor config is missing) "
fi
else
su $AGENTUSER -c "$AGENTPATH stop init"
fi
Expand Down

0 comments on commit 7650646

Please sign in to comment.