Closed nervo closed 6 years ago
We need to do some testing. We can start by manually editing an previously installed systemd unit file for a Sensu service.
@amdprophet Can you please tackle this? ❤️
@portertech @amdprophet don't forget to enable the service too, so that the symink will be moved from /etc/systemd/system/network-online.target.wants
to /etc/systemd/system/multi-user.target.wants
@nervo enabling the service is part of the installation documentation as we don't want the service to start on boot by default.
@nervo thanks for the contribution!
@amdprophet of course, it's part of the installation documentation, it just meant for your tests :)
I think there have been some confusion in this pr: https://github.com/sensu/sensu-omnibus/pull/229
I first noticed some strange issues on our servers, where the sensu-client was sometimes loaded, sometime not, without any reasonable explanations. I then realized that when it was not loaded, the
network-online.target
systemd unit was not reached too.So the bug appeared on servers where sensu-client was the only service needing
network-online.target
.The systemd documentation is pretty clear: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/#cutthecraphowdoimakesurethatmyservicestartsafterthenetworkisreallyonline
So we must use
Wants=network-online.target
(which is obvious when you realize that network-online must be pulled in), and to avoid chicken/eggs issues, rollbackWantedBy
to something else, likemulti-user.target
which mimics runlevels 2 3 4 5, just like the good olds sysvinit scripts.