Browse Source

tools/qvm-sync-clock: don't start clockvm

Since bda9264, a qubes.GetDate call from a VM will not cause clockvm
startup. Also avoid causing it with /etc/cron.d/qubes-sync-clock.cron.

Fixes QubesOS/qubes-issues#3588
Rusty Bird 5 năm trước cách đây
mục cha
commit
8b2b26134e
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      qvm-tools/qvm-sync-clock

+ 5 - 0
qvm-tools/qvm-sync-clock

@@ -32,6 +32,11 @@ def main():
     app = Qubes()
     clockvm = app.clockvm
 
+    if not clockvm.is_running():
+        sys.stderr.write('ClockVM {} is not running, aborting.\n'.format(
+            clockvm.name))
+        sys.exit(0)
+
     p = clockvm.run_service('qubes.GetDate')
     untrusted_date_out = p.stdout.read(25).decode('ascii', errors='strict')
     untrusted_date_out = untrusted_date_out.strip()