# The systemctl calls are replaced with a proprietary openrc wrapper --- a/services/systemd.py +++ b/services/systemd.py @@ -35,8 +35,7 @@ return "--system" if self.system else "--user" def getServices(self, *services): - args = ("systemctl", "-q", self.__mode, "show", - "--property="+",".join(self.valmap), *services) + args = ("rcctl", "info", *services) result = subprocess.run(args, stdout=subprocess.PIPE, universal_newlines=True) split = [[line.split("=", 1) for line in block.split("\n") if "=" in line] for block in result.stdout.split("\n\n")] units = [{self.valmap[key]: value for key, value in block if key in self.valmap} for block in split] @@ -53,7 +52,7 @@ return {unit["unit"]: unit for unit in units if "unit" in unit} def run(self, command, *targets): - result = subprocess.run(("systemctl", "-q", self.__mode, command, *targets), + result = subprocess.run(("rcctl", "-q", command, *targets), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True) return result.returncode, result.stdout