New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qvm-run doesn't work on systemd system-sleep scripts #4131

Closed
gasull opened this Issue Jul 23, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@gasull

gasull commented Jul 23, 2018

Qubes OS version:

Qubes release 4.0 (R4.0)

Affected component(s):


Steps to reproduce the behavior:

In dom0:

$ sudoedit /usr/lib/systemd/system-sleep/suspend-resume.sh
$ chmod 755 /usr/lib/systemd/system-sleep/suspend-resume.sh
$ cat /usr/lib/systemd/system-sleep/suspend-resume.sh
#!/usr/bin/env bash
qvm-run --pass-io --verbose my-qube "echo hi" 2>&1 | systemd-cat -t suspend-resume
$ /usr/lib/systemd/system-sleep/suspend-resume.sh
$ journalctl --identifier=suspend-resume
-- Logs begin at (...) --
Jul 23 2:41:47 dom0 suspend-resume[7846]: Running 'echo hi' on my-qube
Jul 23 2:41:47 dom0 suspend-resume[7846]: hi

Close laptop, wait for it to suspend, open it again, then, in dom0:

$ journalctl --identifier=suspend-resume
-- Logs begin at (...) --
Jul 23 2:41:47 dom0 suspend-resume[7846]: Running 'echo hi' on my-qube
Jul 23 2:41:47 dom0 suspend-resume[7846]: hi
Jul 23 2:43:16 dom0 suspend-resume[7897]: Running 'echo hi' on my-qube
Jul 23 2:43:21 dom0 suspend-resume[7897]: vchan connection timeout
Jul 23 2:43:34 dom0 suspend-resume[7932]: Running 'echo hi' on my-qube
Jul 23 2:43:39 dom0 suspend-resume[7932]: vchan connection timeout

Expected behavior:

The command echo hi should execute in my-qube and therefore journalctl on dom0 should return this instead:

Jul 23 2:43:16 dom0 suspend-resume[7897]: Running 'echo hi' on my-qube
Jul 23 2:43:21 dom0 suspend-resume[7897]: hi
Jul 23 2:43:34 dom0 suspend-resume[7932]: Running 'echo hi' on my-qube
Jul 23 2:43:39 dom0 suspend-resume[7932]: hi

Actual behavior:

As said, journalctl on dom0 shows echo hi wasn't executed:

Jul 23 2:43:16 dom0 suspend-resume[7897]: Running 'echo hi' on my-qube
Jul 23 2:43:21 dom0 suspend-resume[7897]: vchan connection timeout
Jul 23 2:43:34 dom0 suspend-resume[7932]: Running 'echo hi' on my-qube
Jul 23 2:43:39 dom0 suspend-resume[7932]: vchan connection timeout

General notes:

I tried other commands, like writing on the journalctl of my-qube or writing a file in my-qube. They work from the comand line in dom0, but not in the script for system-sleep.


Related issues:

Possibly #2335

@marmarek

This comment has been minimized.

Show comment
Hide comment
@marmarek

marmarek Jul 23, 2018

Member

Jul 23 2:43:16 dom0 suspend-resume[7897]: Running 'echo hi' on my-qube Jul 23 2:43:21 dom0 suspend-resume[7897]: vchan connection timeout

All qubes are suspended/paused for the host suspend time, so at this point it is impossible to interact with them. You can work around this by creating new service ordered before qubes-suspend.service. See systemctl cat qubes-suspend.service for example settings.

Member

marmarek commented Jul 23, 2018

Jul 23 2:43:16 dom0 suspend-resume[7897]: Running 'echo hi' on my-qube Jul 23 2:43:21 dom0 suspend-resume[7897]: vchan connection timeout

All qubes are suspended/paused for the host suspend time, so at this point it is impossible to interact with them. You can work around this by creating new service ordered before qubes-suspend.service. See systemctl cat qubes-suspend.service for example settings.

@andrewdavidwong andrewdavidwong added notanissue and removed bug labels Jul 24, 2018

@andrewdavidwong

This comment has been minimized.

Show comment
Hide comment
@andrewdavidwong

andrewdavidwong Jul 24, 2018

Member

Closing as "not an issue." If you believe this is a mistake, please leave a comment, and we'll be happy to take another look. Thank you.

Member

andrewdavidwong commented Jul 24, 2018

Closing as "not an issue." If you believe this is a mistake, please leave a comment, and we'll be happy to take another look. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment