Skip to content
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

[centos] Improve systemd and service restart behaviors #194

Merged
merged 3 commits into from
Aug 18, 2017

Conversation

olivielpeau
Copy link
Member

@olivielpeau olivielpeau commented Aug 17, 2017

Depends on DataDog/dd-agent#3477

  • Improves service restart logic in installation scripts: on CentOS instead of restarting the agent service both in postinst and posttrans, only restart it in posttrans, and make sure a datadog.conf file is present before doing so.

  • Adds a systemd unit file: CentOS versions that use systemd (>= CentOS 7) will use it instead of the init.d script for lifecycle commands (start/stop/restart): same unit file and bash script as what's already used on debian.
    On a customer's environment with CentOS 7, using a systemd unit file has been way more reliable than relying on systemd's conversion of the init.d script, so let's ship it with the regular RPM pkg.

These changes pass dd-agent-testing. I haven't done much manual testing but if someone feels we should I can do that.

The posttrans script runs for installs/upgrades on CentOS, that's
the only place where we should restart the agent.
Same unit file and start script as debian and suse packages.
Copy link
Contributor

@gmmeyer gmmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@olivielpeau
Copy link
Member Author

Just tested this on a CentOS 5 VM, it works well 👍

@olivielpeau olivielpeau merged commit 09d61ff into master Aug 18, 2017
@olivielpeau olivielpeau deleted the olivielpeau/centos-7-systemd branch August 18, 2017 19:06
@truthbk
Copy link
Member

truthbk commented Aug 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants