mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
action_utils: Add a method to reset services in 'failed' state
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
4a34feefb0
commit
711c19b511
@ -143,6 +143,12 @@ def service_try_reload_or_restart(service_name):
|
||||
service_action(service_name, 'try-reload-or-restart')
|
||||
|
||||
|
||||
def service_reset_failed(service_name):
|
||||
"""Reset the 'failed' state of units."""
|
||||
service_action(service_name, 'reset-failed')
|
||||
|
||||
|
||||
|
||||
def service_action(service_name, action):
|
||||
"""Perform the given action on the service_name."""
|
||||
subprocess.run(['systemctl', action, service_name],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user