mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
action_utils: Introduce utility for masking services
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
b66de4a9b7
commit
ee991dbab8
@ -36,6 +36,7 @@ def parse_arguments():
|
||||
add_service_action(subparsers, 'reload', 'reload a service')
|
||||
add_service_action(subparsers, 'is-running', 'status of a service')
|
||||
add_service_action(subparsers, 'is-enabled', 'status a service')
|
||||
add_service_action(subparsers, 'mask', 'unmask a service')
|
||||
add_service_action(subparsers, 'unmask', 'unmask a service')
|
||||
|
||||
subparsers.add_parser('list', help='List of running system services')
|
||||
@ -72,6 +73,10 @@ def subcommand_reload(arguments):
|
||||
action_utils.service_reload(arguments.service)
|
||||
|
||||
|
||||
def subcommand_mask(arguments):
|
||||
action_utils.service_mask(arguments.service)
|
||||
|
||||
|
||||
def subcommand_unmask(arguments):
|
||||
action_utils.service_unmask(arguments.service)
|
||||
|
||||
|
||||
@ -83,6 +83,11 @@ def service_disable(service_name):
|
||||
pass
|
||||
|
||||
|
||||
def service_mask(service_name):
|
||||
"""Mask a service"""
|
||||
subprocess.call(['systemctl', 'mask', service_name])
|
||||
|
||||
|
||||
def service_unmask(service_name):
|
||||
"""Unmask a service"""
|
||||
subprocess.call(['systemctl', 'unmask', service_name])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user