Open the-maldridge opened 1 year ago
@david-yu can you help confirm this? i can update the docs to reflect the current functionality
Only windows is supported, not systemd/unix. The documentation is inaccurate*.
Reference: The os_service_unix.go source file makes it clear that unix isn't supported yet. The original PR intentionally only addressed this for Windows.
*The original PR author probably felt the docs were accurate, because you technically can specify a SystemD
type... but if you do that, you'll get "not implemented" errors.
While technically accurate, this is not the expectation I hold as an end user. Per the principle of least surprise, if something is flagged as a supported option I would expect that configuring it does not result in an error.
Totally agree @the-maldridge. Technically correct is the worst kind of correct ;)
Out of curiosity, what are you doing instead (since the OS Service health check type doesn't exist for Linux)? And how adequate of an alternative is that?
If I remember correctly, we implemented OS Service health checks on Windows primarily because trying to do the equivalent with a script check had a really high overhead on Windows, whereas it didn't on Linux. More details here.
I use just an http service check, but I've occasionally had that return interesting results, so I was wanting to enable OS checks as well so that I could alert on the condition where systemd thinks something is up but the service itself disagrees.
Hello lovely people. Awaiting this to be implemented on Linux, but in the meantime @the-maldridge @jkirschner-hashicorp for anyone that comes across this you can simply use a script check e.g.:
{
"service": {
"name": "dhcp",
"check": {
"args": ["/usr/bin/systemctl", "is-active", "kea-dhcp4-server"],
"interval": "10s"
}
}
}
Overview of the Issue
The documentation clearly states that os_service supports both windows and systemd service types. However systemd support is unimplemented. Either the docs should be updated to reflect reality, or the support should be implemented.
Reproduction Steps
Consul info for both Client and Server
N/A
Operating system and Environment details
Debian 11, amd64.
Log Fragments