sensu / sensu-go-chef

Chef Library Cookbook for Sensu Go
https://sensu.io
MIT License
11 stars 22 forks source link

Add empty systemd unit to allow proper service reloading on agent upgrade #132

Closed ValkyrieOps closed 3 years ago

ValkyrieOps commented 3 years ago

Pull Request Checklist

Is this in reference to an existing issue?

Yes. See issue #131

General

New Features

No new features added.

Purpose

Bugfix. Creates an empty systemd unit file which forces a unit reload when agents are upgraded.

Known Compatibility Issues

derekgroh commented 3 years ago

You'll need to add the notifies code as well, otherwise your resource will never be referenced.

"Then use a notification to reload the unit file configuration before the service restart is called."

ValkyrieOps commented 3 years ago

Hey definitely apparent my test cases were messed up, my bad. I have added a notifies statement to the package block because I think that is the intended behavior. However now it seems the Chef runs fail due to the default agent systemd unit file not supporting a reload function. I'm probably doing this incorrectly though.

For testing sake I created a new branch here that creates a new systemd file with a reload function. That one works for me and takes care of the systemd reload on upgrade and downgrades as well with the existing service block. Let me know how to proceed here.

derekgroh commented 3 years ago

This passed in my testing. You'll need to correct (remove) the references to ubuntu 16.04 to the workflow pass.

Take a look at the PR I submitted against your branch, which should resolve most of the errors.

ValkyrieOps commented 3 years ago

This passed in my testing. You'll need to correct (remove) the references to ubuntu 16.04 to the workflow pass.

Take a look at the PR I submitted against your branch, which should resolve most of the errors.

Merged, thank you very much for that!

majormoses commented 3 years ago

This has been released on git and supermarket in 1.4.0 thank you for your contribution.