vyos.util: "harden" is_systemd_service_running() function
Inspired by the comments of https://unix.stackexchange.com/a/435317 use a more
robust approach. A service can be "active" but not "running" (e.g. restarting
with a configuration error). We can now test if a systemd unit is "activated"
and if it is "running" at all.
from vyos.util import is_systemd_service_active
from vyos.util import is_systemd_service_running
is_systemd_service_active('ssh')
True
is_systemd_service_running('sshd')
False
is_systemd_service_running('ssh')
True