From 6d424f91a5f9e7b5eb47b7f8785402b61ddf614c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Thu, 6 Jul 2017 23:37:26 +0200 Subject: [PATCH] clock synchronization rewrite clock synchronization mechanism rewritten to use systemd-timesync instead of NtpDate; at the moment, requires: - modifying /etc/qubes-rpc/policy/qubes.GetDate to redirect GetDate to designated clockvm - enabling clocksync service in clockvm ( qvm-features clockvm-name service/clocksync true ) Works as specified in issue listed below, except for: - each VM synces with clockvm after boot and every 6h - clockvm synces time with the Internet using systemd-timesync - dom0 synces itself with clockvm every 1h (using cron) fixes QubesOS/qubes-issues#1230 --- pm-utils/01qubes-sync-vms-clock | 17 ----------------- pm-utils/qubes-suspend.service | 2 -- rpm_spec/core-dom0-linux.spec | 2 -- system-config/qubes-sync-clock.cron | 2 +- 4 files changed, 1 insertion(+), 22 deletions(-) delete mode 100755 pm-utils/01qubes-sync-vms-clock diff --git a/pm-utils/01qubes-sync-vms-clock b/pm-utils/01qubes-sync-vms-clock deleted file mode 100755 index c14268c..0000000 --- a/pm-utils/01qubes-sync-vms-clock +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 diff --git a/pm-utils/qubes-suspend.service b/pm-utils/qubes-suspend.service index f335843..19a5e1f 100644 --- a/pm-utils/qubes-suspend.service +++ b/pm-utils/qubes-suspend.service @@ -7,10 +7,8 @@ StopWhenUnneeded=yes Type=oneshot RemainAfterExit=yes StandardOutput=syslog -ExecStartPre=/usr/lib64/pm-utils/sleep.d/01qubes-sync-vms-clock suspend suspend ExecStart=/usr/lib64/pm-utils/sleep.d/52qubes-pause-vms suspend suspend ExecStop=/usr/lib64/pm-utils/sleep.d/52qubes-pause-vms resume suspend -ExecStopPost=/usr/lib64/pm-utils/sleep.d/01qubes-sync-vms-clock resume suspend [Install] WantedBy=sleep.target diff --git a/rpm_spec/core-dom0-linux.spec b/rpm_spec/core-dom0-linux.spec index ed2afe4..f40c8a6 100644 --- a/rpm_spec/core-dom0-linux.spec +++ b/rpm_spec/core-dom0-linux.spec @@ -112,7 +112,6 @@ cp qrexec/qubes-rpc-multiplexer $RPM_BUILD_ROOT/usr/lib/qubes ### pm-utils mkdir -p $RPM_BUILD_ROOT/usr/lib64/pm-utils/sleep.d -cp pm-utils/01qubes-sync-vms-clock $RPM_BUILD_ROOT/usr/lib64/pm-utils/sleep.d/ cp pm-utils/52qubes-pause-vms $RPM_BUILD_ROOT/usr/lib64/pm-utils/sleep.d/ mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system cp pm-utils/qubes-suspend.service $RPM_BUILD_ROOT/usr/lib/systemd/system/ @@ -210,7 +209,6 @@ chmod -x /etc/grub.d/10_linux /usr/bin/qvm-move-to-vm /usr/lib/qubes/qfile-dom0-agent # pm-utils -/usr/lib64/pm-utils/sleep.d/01qubes-sync-vms-clock /usr/lib64/pm-utils/sleep.d/52qubes-pause-vms /usr/lib/systemd/system/qubes-suspend.service # Others diff --git a/system-config/qubes-sync-clock.cron b/system-config/qubes-sync-clock.cron index 95c9d33..d93148f 100755 --- a/system-config/qubes-sync-clock.cron +++ b/system-config/qubes-sync-clock.cron @@ -1 +1 @@ -*/6 * * * * root /usr/bin/qvm-sync-clock > /dev/null 2>&1 || true +0 */1 * * * root /usr/bin/qvm-sync-clock > /dev/null 2>&1 || true