Man, this is amazing! It finally works!

I spend over 20 hours fighting with systemd (depending on shutdown target, all 
or some qubes targets, doing PreStart=- but nothing worked) and in desperation 
I tried nasty hack of replacing /usr/sbin/shutdown with my script, but it was 
not called when shutting down from qubes manager.

Here's final service:
---------
[Unit]
Description=Detach block devices
After=qubes-dvm.service qubes-mount-dirs.service qubes-qrexec-agent.service

[Service]
Type=oneshot
RemainAfterExit=true

ExecStart=/bin/true
ExecStop=-/usr/local/bin/detach-devices.sh

KillMode=none
TimeoutSec=65

[Install]
WantedBy=multi-user.target
-----------

In detach-devices.sh I put two 'sleep 5' commands around 'umount' to be sure 
future commands for stopping Samba / NFS will have time to complete and it 
works.

Great! Much thanks!

-- 
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/7d4a4f74-ec2a-49ea-a6f1-fa6a0aefc9f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to