]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
examples: add systemd services
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 4 Sep 2014 15:30:36 +0000 (17:30 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 4 Sep 2014 15:30:36 +0000 (17:30 +0200)
examples/chrony-wait.service [new file with mode: 0644]
examples/chronyd.service [new file with mode: 0644]

diff --git a/examples/chrony-wait.service b/examples/chrony-wait.service
new file mode 100644 (file)
index 0000000..6513b4f
--- /dev/null
@@ -0,0 +1,17 @@
+[Unit]
+Description=Wait for chrony to synchronize system clock
+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 waitsync 60 0.1
+RemainAfterExit=yes
+StandardOutput=null
+
+[Install]
+WantedBy=multi-user.target
diff --git a/examples/chronyd.service b/examples/chronyd.service
new file mode 100644 (file)
index 0000000..a609f7d
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=NTP client/server
+After=ntpdate.service sntp.service ntpd.service
+Conflicts=ntpd.service systemd-timesyncd.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/chronyd.pid
+EnvironmentFile=-/etc/sysconfig/chronyd
+ExecStart=/usr/sbin/chronyd $OPTIONS
+
+[Install]
+WantedBy=multi-user.target