Closed cwjohnston closed 6 years ago
:+1: I'm now working around this with a dirty sed
( well actually ansible's lineinfile
) to the /opt/sensu/bin/sensu-service
script to fix the calls to be to /etc/defaut/sensu-<service_name>
but would love to see a fix and new package so I don't have to commit such atrocities.
I can help work on this if need be, the changes should be fairly straight forward.
Although tbh I struggle to understand the value of /opt/sensu/bin/sensu-service
I get it's probably useful for making it easier to deal with multiple init systems, but from a ubuntu xenial / systemd perspective I'm not sure I see anything much in there you couldn't deal with calling /opt/sensu/bin/sensu-server .....
from a systemd unit file.
@portertech ptal
@cwjohnston let's look at this together, tomorrow.
The following issue was brought to my attention by @paulczar via #monitoring_love on HangOps Slack organization.
Expected Behavior
All Sensu service management scripts, whether sysv or systemd, should honor environment variables set in /etc/default/sensu and the service-specific defaults file, e.g.
/etc/default/sensu-server
in the case ofsensu-server
service.Current behavior
sysv init script checks for the existence of both
/etc/default/sensu
and service-specific default files, sourcing them when present. After sourcing these files, sysv script eventually calls/opt/sensu/bin/sensu-service
with arguments to start the desired Sensu service.systemd unit specifies no environment files, calls
/opt/sensu/bin/sensu-service
directly./opt/sensu/bin/sensu-service
sources /etc/default/sensu, if it exists, but does not attempt to source service-specific default files.Possible solution
Move service-specific default logic in sysv init script into
/opt/sensu/bin/sensu-service
wrapper script.Additionally, @paulczar writes: