summaryrefslogtreecommitdiffstats
path: root/examples/chrony-wait.service
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--examples/chrony-wait.service18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/chrony-wait.service b/examples/chrony-wait.service
new file mode 100644
index 0000000..0f5e2e7
--- /dev/null
+++ b/examples/chrony-wait.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=Wait for chrony to synchronize system clock
+Documentation=man:chronyc(1)
+After=chronyd.service
+Requires=chronyd.service
+Before=time-sync.target
+Wants=time-sync.target
+
+[Service]
+Type=oneshot
+# Wait up to ~10 minutes for chronyd to synchronize and the remaining
+# clock correction to be less than 0.1 seconds
+ExecStart=/usr/bin/chronyc -h 127.0.0.1,::1 waitsync 600 0.1 0.0 1
+RemainAfterExit=yes
+StandardOutput=null
+
+[Install]
+WantedBy=multi-user.target