Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Service systemd implementation should not fallback to use sysvinit one #319
The current service_systemd.go implementation is falling back to use the sysvinit one (service_init.go) when the commands give an error exit core. This is wrong, because systemd should have either generated a service file for those sysvinit init scripts, or it or the admin might have disabled or masked those services, so falling back will give the wrong result. But it will definitely not pay attention to those sysvinit services outside of its compat support anyway, so either systemctl knows about it, or for all practical purposes it does not matter at all.
The case in point here for us, was the motd service, which is masked on Debian, so systemctl is-enabled motd will return an error code, but while having the Debian initscripts package installed, there will be sysvinit enabled service present, so a check expecting the service to be disabled and not running will fail with an unexpected result when it should have succeeded.
@aelsabbahy Is it possible to pay attention to the current pull request?
Our problem is simple: goss doesn't behave well on systemd based servers
We need a way to disable fallback to sysvinit if service is masked/disabled in systemd.