Add in support for /etc/default/datadog-agent and set nicelevel from it #3086
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This adds support for
/etc/default/datadog-agentinto the debian and centos init scripts.It then uses the
NICELEVELif set.In debian, start-stop-daemon has a
--nicelevelargument.In centos, daemon does not, but seems to honor the NICELEVEL environmental variable
Motivation
In my environment, we run sshd at a high priority to aid in access during host issues. This higher priority is inherited by apt, and by the init script. Thus accidentally causing datadog-agent to run at high priority
We're finding that when datadog-agent runs at a high priority, gohai ends up causing some CPU locks. I referenced this in #3085 This is workaround.
Additional Notes
I don't know how to add this to the systemd configs. Though they won't have the same inheritance issue I'm running into.