introduce disabled services into the systemd stage
This commit is contained in:
parent
e9fb1ded15
commit
9ea6150ee7
1 changed files with 8 additions and 1 deletions
|
|
@ -1,16 +1,23 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
def main(tree, options):
|
||||
enabled_services = options["enabled_services"]
|
||||
disabled_services = options.get("disabled_services", [])
|
||||
|
||||
for service in enabled_services:
|
||||
subprocess.run([f"systemctl", "--root", tree, "enable", service], check=True)
|
||||
|
||||
for service in disabled_services:
|
||||
subprocess.run([f"systemctl", "--root", tree, "disable", service], check=True)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
args = json.load(sys.stdin)
|
||||
r = main(args["tree"], args["options"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue