Skip to content

Commit

Permalink
[systemd] apply sysconfig/default settings on launch too. (#3489)
Browse files Browse the repository at this point in the history
  • Loading branch information
truthbk authored and olivielpeau committed Aug 24, 2017
1 parent 5dade5d commit 8828728
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packaging/datadog-agent.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ After=network.target
[Service]
Type=forking
User=dd-agent
EnvironmentFile=-/etc/default/datadog-agent
EnvironmentFile=-/etc/sysconfig/datadog-agent
ExecStart=/opt/datadog-agent/bin/start_agent.sh
ExecStop=/opt/datadog-agent/bin/supervisorctl -c /etc/dd-agent/supervisor.conf shutdown

Expand Down
5 changes: 5 additions & 0 deletions packaging/start_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@

PATH=/opt/datadog-agent/embedded/bin:/opt/datadog-agent/bin:$PATH

if [ "$DATADOG_ENABLED" = "no" ]; then
echo "Disabled via DATADOG_ENABLED env var. Exiting."
exit 0
fi

exec /opt/datadog-agent/bin/supervisord -c /etc/dd-agent/supervisor.conf

0 comments on commit 8828728

Please sign in to comment.