qubes-core-admin-linux/pm-utils/01qubes-sync-vms-clock
Marek Marczykowski-Górecki b19ba4dc2d
pm-utils: do not leave background tasks - will be killed by systemd
qvm-sync-clock running in background is killed as soon as
qubes-suspend.service is terminated.
Additionally restore --verbose option, which was the case (implicitly)
in previous qvm-run based code.

Fixes QubesOS/qubes-issues#1795
2016-02-29 13:31:25 +01:00

18 lines
430 B
Bash
Executable File

#!/bin/sh
sync_qubes_vms_wallclock()
{
# Sync all VMs (based on dom0 clock if network time sync fails)
/usr/bin/qvm-sync-clock --force --verbose
}
case "$1" in
thaw|resume) sync_qubes_vms_wallclock ;;
# Kill qvm-sync-clock (if running) to not desync time after resume
suspend|hibernate)
killall qvm-sync-clock 2> /dev/null
exit 0
;;
*) exit 0 ;;
esac