chrony: systemd support
authorAlex Suykov <alex.suykov@gmail.com>
Sat, 23 May 2015 10:02:24 +0000 (13:02 +0300)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 13 Jul 2015 16:08:26 +0000 (18:08 +0200)
systemd has its own NTP daemon, which must be disabled before
starting chrony. Possible (but unlikely) conflict with openntpd
is not marked in either package.

Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/chrony/chrony.mk
package/chrony/chrony.service [new file with mode: 0644]

index 8e41ddcf2ec611ec41750a0c74dbfa89e2fcdd54..f8012ac01f1b038a3fb7a57532e5f0aed8881d5c 100644 (file)
@@ -45,4 +45,12 @@ define CHRONY_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 755 package/chrony/S49chrony $(TARGET_DIR)/etc/init.d/S49chrony
 endef
 
+define CHRONY_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 package/chrony/chrony.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/chrony.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf /usr/lib/systemd/system/chrony.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/chrony.service
+endef
+
 $(eval $(generic-package))
diff --git a/package/chrony/chrony.service b/package/chrony/chrony.service
new file mode 100644 (file)
index 0000000..6000fce
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Chrony Network Time Daemon
+After=syslog.target network.target
+Conflicts=systemd-timesyncd.service
+
+[Service]
+ExecStart=/usr/bin/chronyd -n
+Restart=always
+
+[Install]
+WantedBy=multi-user.target