tools/qvm-run: fix waiting for session
Register SIGCHLD signal handler later - do not stop data processing when qubes.WaitForSession service exits.
This commit is contained in:
parent
7f5fc6ac3d
commit
024ac6a810
@ -159,13 +159,13 @@ def main(args=None, app=None):
|
|||||||
else:
|
else:
|
||||||
print('Running \'{}\' on {}'.format(args.cmd, vm.name),
|
print('Running \'{}\' on {}'.format(args.cmd, vm.name),
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
if args.passio and not args.localcmd:
|
|
||||||
loop = asyncio.new_event_loop()
|
|
||||||
loop.add_signal_handler(signal.SIGCHLD, loop.stop)
|
|
||||||
if args.gui:
|
if args.gui:
|
||||||
wait_session = vm.run_service('qubes.WaitForSession',
|
wait_session = vm.run_service('qubes.WaitForSession',
|
||||||
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
wait_session.communicate(vm.default_user.encode())
|
wait_session.communicate(vm.default_user.encode())
|
||||||
|
if args.passio and not args.localcmd:
|
||||||
|
loop = asyncio.new_event_loop()
|
||||||
|
loop.add_signal_handler(signal.SIGCHLD, loop.stop)
|
||||||
proc = vm.run_service('qubes.VMShell',
|
proc = vm.run_service('qubes.VMShell',
|
||||||
user=args.user,
|
user=args.user,
|
||||||
localcmd=args.localcmd,
|
localcmd=args.localcmd,
|
||||||
|
Loading…
Reference in New Issue
Block a user