Problem
The infrastructure agent is not starting, and logs are not created.
Solution
Here are some troubleshooting options for non-root users if the infrastructure agent is not starting and there are no logs:
Check requiretty
To see if requiretty is causing logging issues:
In
/var/log/messagesor/var/log/syslog, look for the messagesudo: sorry, you must have a tty to run sudo.Important
When using old Linux versions, sometimes the
nri-agentuser fails to execute a service because it does not have any TTY attached.If you find this message, edit your
/etc/sudoersfile with thevisudocommand and comment or remove the following line:Defaults requirettySave and exit the file.
Restart the
newrelic-infraservice.
Review log permissions
Check the agent's permission to open log_file. It's possible that the log file you are using was created when the agent was running as root, and now the nri-agent user does not have permissions to write it.
To solve this, try one of these options:
Change the owner of the log file.
Change the
log_fileentry in the/etc/newrelic-infra.ymlconfiguration file. Our installation scripts create the/var/log/newrelic-infra/folder for that purpose, so we recommend the following value:log_file: /var/log/newrelic-infra/newrelic-infra.log