Procedure to make the Datadog Agent Supervisor run as dd-agent
instead of root
.
The main issue is file permission. I moved lock, pid and sock to /tmp
to ensure it works well. Any other directory with rw
permission for the user dd-agent
would make it.
- Stop the Agent.
service datadog-agent stop
- Be sure that all processes are stopped and the pid/sock got removed
- Check
ps aux | grep -v grep | grep datadog
should be empty - Remove
/var/run/datadog-supervisord.pid
,/var/tmp/datadog-supervisor.sock
,/var/lock/subsys/datadog-agent
.
- Check
- Give permission to
dd-agent
to the supervisor log file.- Run
chown dd-agent:dd-agent /var/log/datadog/supervisord.log
- Run
- Update the init script and the supervisor configuration to put files in
tmp
.