openntpd: add systemd unit file
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Tue, 20 Jan 2015 23:31:26 +0000 (20:31 -0300)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 23 Jan 2015 20:43:17 +0000 (21:43 +0100)
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/openntpd/ntpd.service [new file with mode: 0644]
package/openntpd/openntpd.mk

diff --git a/package/openntpd/ntpd.service b/package/openntpd/ntpd.service
new file mode 100644 (file)
index 0000000..a4ffa73
--- /dev/null
@@ -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
index abc75aef8ce06194c620cf7b86631c1c72465d01..a6460cbe570eb8ae3048bc32fda29e2fd1bc2883 100644 (file)
@@ -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