-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auth_token unreadable and agent won't start after enabling docker_daemon integration #1558
Comments
I tried the process again and this time it worked. I'll close this, but appending some info for posterity: I believe the system was still in the process of installing / configuring when I SSHd in and ran It appears that the |
Thanks, @eedwards-sk pointing to the right direction! Just adding my experience, and confirmation, for anyone who stumbles upon the Here is my start script: #!/bin/bash
set -xeuo pipefail
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
# Need to ensure proper ownership
# or things start to fail later
readonly token=/etc/datadog-agent/auth_token
# .ebextensions/datadog/hooks/99start_datadog.sh
if [[ ! -e /etc/init/datadog-agent.conf ]]; then
echo "Agent not installed"
exit 0
fi
# The Datadog conf dir is also used for keeping state: the auth token.
# Datadog agent must be able to write there as dd-agent.
# Therefore the dir needs to have dd-agent ownership.
chown -v dd-agent $(dirname "$token")
readonly stat=$(initctl status datadog-agent)
if [[ "$stat" == *"datadog-agent start/running"* ]]; then
echo "Agent already running"
exit 0
fi
initctl start datadog-agent
# Allow some time to write down the token.
sleep 1
# Make sure the token is owned by dd-agent, or the agent fails.
# Usually the token will have that ownership, but with on exception:
# If the Datadog is not running and the command 'datadog-agent'
# is manually run from the command line, then it creates the token
# with root ownership, causing failures down the line.
if [[ -f "$token" ]]; then
chown -v dd-agent "$token"
fi |
Posting here for completion. This was fixed in #5064 |
Output of the info page (if this is a bug)
from agent.log (info will not run due to service not starting)
Describe what happened:
datadog agent created the
auth_token
file with a user ofroot
and group ofroot
, and is unable to read it as userdd-agent
Describe what you expected:
datadog agent created the
auth_token
file with a user ofdd-agent
and group ofdd-agent
, and is able to read it as userdd-agent
Steps to reproduce the issue:
this worked before enabling the
docker
integrationonce I added this to my setup procedure:
and added this docker config:
then it no longer worked
deleting the
/etc/datadog-agent/auth_token
file and restarting the datadog agent caused it to be created correctly with an owner ofdd-agent:dd-agent
Additional environment details (Operating System, Cloud provider, etc):
ec2 ubuntu/images/hvm-ssd/ubuntu-xenial-16.04-amd64-server-20170619.1 (ami-d15a75c7)
docker 1.12 / rancher
The text was updated successfully, but these errors were encountered: