package/sysklogd: add systemd services
authorPetr Kulhavy <brain@jikos.cz>
Wed, 20 Sep 2017 10:21:30 +0000 (12:21 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sun, 24 Sep 2017 13:52:08 +0000 (15:52 +0200)
Sysklogd had only SYSV init scripts. Add systemd service files to start
klogd and syslogd.

Signed-off-by: Petr Kulhavy <brain@jikos.cz>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/sysklogd/klogd.service [new file with mode: 0644]
package/sysklogd/sysklogd.mk
package/sysklogd/syslogd.service [new file with mode: 0644]

diff --git a/package/sysklogd/klogd.service b/package/sysklogd/klogd.service
new file mode 100644 (file)
index 0000000..c66795b
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Kernel Log Daemon
+
+[Service]
+ExecStart=/usr/sbin/klogd -n
+StandardOutput=null
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+WantedBy=syslogd.service
index e1f0c34189ad7ad703f69b74246853eb37084e85..1c8259a9afdb64920f7b22c3ac19abaadb34daca 100644 (file)
@@ -32,4 +32,16 @@ define SYSKLOGD_INSTALL_INIT_SYSV
                $(TARGET_DIR)/etc/init.d/S01logging
 endef
 
+define SYSKLOGD_INSTALL_INIT_SYSTEMD
+       $(INSTALL) -D -m 644 $(SYSKLOGD_PKGDIR)/syslogd.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/syslogd.service
+       $(INSTALL) -D -m 644 $(SYSKLOGD_PKGDIR)/klogd.service \
+               $(TARGET_DIR)/usr/lib/systemd/system/klogd.service
+       mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+       ln -sf ../../../../usr/lib/systemd/system/syslogd.service \
+               $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/syslogd.service
+       ln -sf ../../../usr/lib/systemd/system/syslogd.service \
+               $(TARGET_DIR)/etc/systemd/system/syslog.service
+endef
+
 $(eval $(generic-package))
diff --git a/package/sysklogd/syslogd.service b/package/sysklogd/syslogd.service
new file mode 100644 (file)
index 0000000..70e4cff
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=System Logging Service
+Requires=syslog.socket
+Wants=klogd.service
+
+[Service]
+ExecStart=/usr/sbin/syslogd -m 0 -n
+StandardOutput=null
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
+Alias=syslog.service