[services-systemd] Introduce disable-targets and mask
- With refactored code, introducing new kinds of actions is very few lines of code. Allow disabling targets (services was already possible). Allow masking units, but as a special case require the complete name. FIXES #975
This commit is contained in:
parent
5d6e07712b
commit
c9c777b055
@ -76,5 +76,14 @@ def run():
|
||||
if r is not None:
|
||||
return r
|
||||
|
||||
r = systemctl(cfg["disable-targets"], "disable", ".target")
|
||||
if r is not None:
|
||||
return r
|
||||
|
||||
r = systemctl(cfg["mask"], "mask", "")
|
||||
if r is not None:
|
||||
return r
|
||||
|
||||
|
||||
# This could have just been return r
|
||||
return None
|
||||
|
@ -42,8 +42,22 @@
|
||||
# disable:
|
||||
# - name: "pacman-init"
|
||||
# mandatory: false
|
||||
#
|
||||
# # Disables <name>.target
|
||||
# disable-targets: []
|
||||
#
|
||||
# # Masks (stronger version of disable). This section
|
||||
# # is unusual because you **must** include the suffix
|
||||
# # (e.g. ".service") as part of the name, so, e.g. to mask
|
||||
# # NetworkManager (rather than just disable it) you must
|
||||
# # specify "NetworkManager.service" as name.
|
||||
# mask:
|
||||
# - name: "NetworkManager.service"
|
||||
# - mandatory: true
|
||||
|
||||
# By default, no changes are made.
|
||||
services: []
|
||||
targets: []
|
||||
disable: []
|
||||
disable-targets: []
|
||||
mask: []
|
||||
|
Loading…
Reference in New Issue
Block a user