]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
examples: improve chrony-wait service
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 1 Sep 2020 10:05:06 +0000 (12:05 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 1 Sep 2020 10:05:06 +0000 (12:05 +0200)
Use the systemd TimeoutStartSec setting to report a timeout instead of
an error and reduce the timeout to 3 minutes.

examples/chrony-wait.service

index 0f5e2e7613e9224f2625c6630d60d945d464221c..b3aa7aa27c41aaf7d67507498146099913f35ed4 100644 (file)
@@ -8,9 +8,11 @@ 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
+# Wait for chronyd to update the clock and the remaining
+# correction to be less than 0.1 seconds
+ExecStart=/usr/bin/chronyc -h 127.0.0.1,::1 waitsync 0 0.1 0.0 1
+# Wait for at most 3 minutes
+TimeoutStartSec=180
 RemainAfterExit=yes
 StandardOutput=null