machine: service unit detection fix

Add `--plain` and `--no-legend` to the command to list service units.
This fixes a bug where  a service could be prefixed with a unique
character, resulting undetected services.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-11-26 09:02:05 -05:00
parent 685bd72274
commit 76e431330c
1 changed files with 1 additions and 1 deletions

View File

@ -284,7 +284,7 @@ class Machine:
async def _find_active_services(self):
shell_cmd: SCMDComp = self.server.lookup_component('shell_command')
scmd = shell_cmd.build_shell_command(
"systemctl list-units --all --type=service")
"systemctl list-units --all --type=service --plain --no-legend")
try:
resp = await scmd.run_with_response()
lines = resp.split('\n')