HomeVyOS Platform

vyos.util: "harden" is_systemd_service_running() function

Description

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

Details

Provenance
c-poAuthored on Aug 13 2021, 7:15 PM
Parents
rVYOSONEXda94e0a73687: vrf: T3734: T3728: vni must be configured with a higher priority then bgpd
Branches
Loading...
Tags
Loading...