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:
parent
685bd72274
commit
76e431330c
|
@ -284,7 +284,7 @@ class Machine:
|
||||||
async def _find_active_services(self):
|
async def _find_active_services(self):
|
||||||
shell_cmd: SCMDComp = self.server.lookup_component('shell_command')
|
shell_cmd: SCMDComp = self.server.lookup_component('shell_command')
|
||||||
scmd = shell_cmd.build_shell_command(
|
scmd = shell_cmd.build_shell_command(
|
||||||
"systemctl list-units --all --type=service")
|
"systemctl list-units --all --type=service --plain --no-legend")
|
||||||
try:
|
try:
|
||||||
resp = await scmd.run_with_response()
|
resp = await scmd.run_with_response()
|
||||||
lines = resp.split('\n')
|
lines = resp.split('\n')
|
||||||
|
|
Loading…
Reference in New Issue