aboutsummaryrefslogtreecommitdiff
path: root/package/chrony
diff options
context:
space:
mode:
authorGravatar Alex Suykov <alex.suykov@gmail.com>2015-05-23 13:02:24 +0300
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-07-13 18:08:26 +0200
commitc6946f24cc1e4cbb8aaff1a2192c1a95d539ca5d (patch)
treed1ce0280f43217bfd5a23994bdd1b8a9c3658f5b /package/chrony
parent93ee95b4f0d392ad395acc1a2329bb26d4612992 (diff)
downloadbuildroot-c6946f24cc1e4cbb8aaff1a2192c1a95d539ca5d.tar.gz
buildroot-c6946f24cc1e4cbb8aaff1a2192c1a95d539ca5d.tar.bz2
chrony: systemd support
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>
Diffstat (limited to 'package/chrony')
-rw-r--r--package/chrony/chrony.mk8
-rw-r--r--package/chrony/chrony.service11
2 files changed, 19 insertions, 0 deletions
diff --git a/package/chrony/chrony.mk b/package/chrony/chrony.mk
index 8e41ddcf2e..f8012ac01f 100644
--- a/package/chrony/chrony.mk
+++ b/package/chrony/chrony.mk
@@ -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
index 0000000000..6000fce40c
--- /dev/null
+++ b/package/chrony/chrony.service
@@ -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