stages/systemd: add -- before unit names
Units can start with a -, for example, -.mount. Trying to enable,
disable, or mask a service like that fails with
systemctl: invalid option -- '.'
Hint: to specify units starting with a dash, use "--":
systemctl [OPTIONS...] COMMAND -- -.mount ...
Adding -- to all 'systemctl' calls lets us specify unit files that start
with -.
This commit is contained in:
parent
106a9af937
commit
901fa24905
1 changed files with 3 additions and 3 deletions
|
|
@ -14,13 +14,13 @@ def main(tree, options):
|
|||
default_target = options.get("default_target")
|
||||
|
||||
for service in enabled_services:
|
||||
subprocess.run(["systemctl", "--root", tree, "enable", service], check=True)
|
||||
subprocess.run(["systemctl", "--root", tree, "enable", "--", service], check=True)
|
||||
|
||||
for service in disabled_services:
|
||||
subprocess.run(["systemctl", "--root", tree, "disable", service], check=True)
|
||||
subprocess.run(["systemctl", "--root", tree, "disable", "--", service], check=True)
|
||||
|
||||
for service in masked_services:
|
||||
subprocess.run(["systemctl", "--root", tree, "mask", service], check=True)
|
||||
subprocess.run(["systemctl", "--root", tree, "mask", "--", service], check=True)
|
||||
|
||||
if masked_generators:
|
||||
# systemctl can't mask generators, so manually create the mask
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue