aboutsummaryrefslogtreecommitdiff
path: root/package/openntpd
diff options
context:
space:
mode:
authorGravatar Gustavo Zacarias <gustavo@zacarias.com.ar>2015-01-20 20:31:26 -0300
committerGravatar Peter Korsgaard <peter@korsgaard.com>2015-01-23 21:43:17 +0100
commit35f37d762648bb921aafd43fb34476c76e4eec91 (patch)
tree23b70c5e0cc57e5d4a7ef88e8ee95ac1f6b22353 /package/openntpd
parent1126176be64c2e71f190e43b31247d33a351fdc9 (diff)
downloadbuildroot-35f37d762648bb921aafd43fb34476c76e4eec91.tar.gz
buildroot-35f37d762648bb921aafd43fb34476c76e4eec91.tar.bz2
openntpd: add systemd unit file
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'package/openntpd')
-rw-r--r--package/openntpd/ntpd.service11
-rw-r--r--package/openntpd/openntpd.mk8
2 files changed, 19 insertions, 0 deletions
diff --git a/package/openntpd/ntpd.service b/package/openntpd/ntpd.service
new file mode 100644
index 0000000000..a4ffa7318c
--- /dev/null
+++ b/package/openntpd/ntpd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenNTP Daemon
+After=network.target
+Conflicts=systemd-timesyncd.service
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/ntpd -s -d
+
+[Install]
+WantedBy=multi-user.target
diff --git a/package/openntpd/openntpd.mk b/package/openntpd/openntpd.mk
index abc75aef8c..a6460cbe57 100644
--- a/package/openntpd/openntpd.mk
+++ b/package/openntpd/openntpd.mk
@@ -9,6 +9,14 @@ OPENNTPD_SITE = http://ftp.openbsd.org/pub/OpenBSD/OpenNTPD
OPENNTPD_LICENSE = MIT-like, BSD-2c, BSD-3c
OPENNTPD_LICENSE_FILES = COPYING
+define OPENNTPD_INSTALL_INIT_SYSTEMD
+ $(INSTALL) -D -m 0644 package/openntpd/ntpd.service \
+ $(TARGET_DIR)/etc/systemd/system/ntpd.service
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+ ln -fs ../ntpd.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/ntpd.service
+endef
+
define OPENNTPD_INSTALL_INIT_SYSV
$(INSTALL) -m 0755 -D package/openntpd/S49ntp \
$(TARGET_DIR)/etc/init.d/S49ntp