Skip to content

Commit bc76413

Browse files
committed
Merge remote-tracking branch 'origin/pr/769'
* origin/pr/769: Use canonical name to Qrexec service
2 parents 7753de6 + cbf29dd commit bc76413

1 file changed

Lines changed: 10 additions & 14 deletions

File tree

qubes/vm/dispvm.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -489,43 +489,42 @@ def on_domain_loaded(self, event) -> None:
489489
assert self.template
490490

491491
async def wait_operational_preload(
492-
self, rpc: str, service: str, timeout: int | float
492+
self, service: str, timeout: int | float
493493
) -> None:
494494
"""
495495
Await for preloaded disposable to become fully operational.
496496
497-
:param str rpc: Pretty RPC service name.
498497
:param str service: Full command-line.
499498
:param int|float timeout: Fail after timeout is reached.
500499
"""
501500
try:
502501
self.log.info(
503502
"Preload startup waiting '%s' with '%d' seconds timeout",
504-
rpc,
503+
service,
505504
timeout,
506505
)
507506
await asyncio.wait_for(
508-
self.run_for_stdio(
507+
self.run_service_for_stdio(
509508
service,
510509
stdout=subprocess.DEVNULL,
511510
stderr=subprocess.DEVNULL,
512511
),
513512
timeout=timeout,
514513
)
515-
self.log.info("Preload startup completed '%s'", rpc)
514+
self.log.info("Preload startup completed '%s'", service)
516515
except asyncio.TimeoutError:
517516
debug_msg = "systemd-analyze blame"
518517
raise qubes.exc.QubesException(
519518
"Timed out call to '%s' after '%d' seconds during preload "
520519
"startup. To debug, run the following on a new disposable of "
521-
"'%s': %s" % (rpc, timeout, self.template, debug_msg)
520+
"'%s': %s" % (service, timeout, self.template, debug_msg)
522521
)
523522
except (subprocess.CalledProcessError, qubes.exc.QubesException):
524523
debug_msg = "systemctl --failed"
525524
raise qubes.exc.QubesException(
526525
"Error on call to '%s' during preload startup. To debug, "
527-
"run the following on a new disposable of '%s': %s"
528-
% (rpc, self.template, debug_msg)
526+
"disable preloading from '%s' and run the following on a new "
527+
"disposable: %s" % (service, self.template, debug_msg)
529528
)
530529

531530
@qubes.events.handler("domain-start")
@@ -546,15 +545,12 @@ async def on_domain_started_dispvm(
546545
return
547546
if not self.preload_requested:
548547
timeout = self.qrexec_timeout
549-
# https://github.com/QubesOS/qubes-issues/issues/9964
550-
path = "/run/qubes-rpc:/usr/local/etc/qubes-rpc:/etc/qubes-rpc"
551-
rpcs = ["qubes.WaitForRunningSystem"]
548+
services = ["qubes.WaitForRunningSystem"]
552549
start_tasks = []
553-
for rpc in rpcs:
554-
service = '$(PATH="{}" command -v "{}")'.format(path, rpc)
550+
for service in services:
555551
start_tasks.append(
556552
asyncio.create_task(
557-
self.wait_operational_preload(rpc, service, timeout)
553+
self.wait_operational_preload(service, timeout)
558554
)
559555
)
560556
break_task = asyncio.create_task(

0 commit comments

Comments
 (0)