mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-07-29 12:09:37 +00:00
action_utils: Add utility to call systemd daemon-reload
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Nektarios Katakis <iam@nektarioskatakis.xyz>
This commit is contained in:
parent
744308a501
commit
f2c451720d
@ -20,6 +20,12 @@ def is_systemd_running():
|
||||
return os.path.exists('/run/systemd')
|
||||
|
||||
|
||||
def service_daemon_reload():
|
||||
"""Reload systemd to ensure that newer unit files are read."""
|
||||
subprocess.run(['systemctl', 'daemon-reload'], check=True,
|
||||
stdout=subprocess.DEVNULL)
|
||||
|
||||
|
||||
def service_is_running(servicename):
|
||||
"""Return whether a service is currently running.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user