-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On Mon, Jun 27, 2016 at 03:47:14PM -0700, [email protected] wrote:
> Hi Marek,
>
> In Qubes Manager's VM context menu 'Shutdown VM' seems to do equivalent of
> 'virsh shutdown VM', i.e. power button press. I'd like to catch it, so my
> shutdown script is executed also via Qubes Manager shutdown.
>
> In /var/lib/qubes/vm-templates/storage/storage.conf I have "
> <on_poweroff>destroy</on_poweroff>".
>
> This file is re-generated on vm start. Where is value for "on_poweroff" taken
> from (so I can set it to "shutdown")?
First of all, this is not the setting you're looking for. This one is
about what should happen after shutting down the VM system[1].
But it should be possible to trigger qrexec service at VM shutdown very
similar to the startup one. There is no rc.local equivalent for
shutdown, but it's easy to add systemd unit for that. Something like
this:
[Unit]
Description=My shutdown actions
After=qubes-dvm.service qubes-mount-dirs.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=-/usr/bin/qrexec-client-vm dom0 ...
[Install]
WantedBy=multi-user.target
The easiest way would be to save it in template for example in
/etc/systemd/system/my-shutdown.service, then enable it with `systemctl
enable`. And setup appropriate qrexec service to allow service call only
from selected VM(s). This is why I've prefixed the command above with
"-" - to not fail the execution when service call is refused.
But you can also save it in /rw/config/ and move in place from rc.local.
[1] http://libvirt.org/formatdomain.html#elementsEvents
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJXcbAGAAoJENuP0xzK19cstdIH/3A6/K4EDv8S7Qr/MVagc4Wo
DDKum1TzwZCNSu6oBDuWyBterALFygRurOMNyGChfWgpIS1nP95A/wgNs0DTmNu3
TsxsEv7IlF83KblD8sDPExGgEiv66b6X9u6PdCi/ZnOQTuzeDItgARFCeKP/ig/1
suXYtQzCLZ2cRcg8t2FBXkjhwWTBswgbAkUwHEN6cf5TTWwkO7IR6ok2JZlrVCu8
oksShQw8gR1ZBv85z0RHFkpVFPhsMzCtGQIH6GBs7ClS76kIy1+a4REV2I/hv5Li
7wAFpQuIsqZpnjLG3+oBP2CrYj2zwp7r9HyhFp5/JDSZ2d+dzvlVHJ9GYeyMNZI=
=GjMu
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/qubes-users/20160627230022.GO1323%40mail-itl.
For more options, visit https://groups.google.com/d/optout.