All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Kulhavy <brain@jikos.cz>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/sysklogd: add systemd services
Date: Wed, 20 Sep 2017 12:21:30 +0200	[thread overview]
Message-ID: <1505902890-5891-1-git-send-email-brain@jikos.cz> (raw)

Sysklogd had only SYSV init scripts. Add systemd service filesto start klogd
and syslogd.

Signed-off-by: Petr Kulhavy <brain@jikos.cz>
---
 package/sysklogd/klogd.service   | 11 +++++++++++
 package/sysklogd/sysklogd.mk     | 12 ++++++++++++
 package/sysklogd/syslogd.service | 13 +++++++++++++
 3 files changed, 36 insertions(+)
 create mode 100644 package/sysklogd/klogd.service
 create mode 100644 package/sysklogd/syslogd.service

diff --git a/package/sysklogd/klogd.service b/package/sysklogd/klogd.service
new file mode 100644
index 0000000..c66795b
--- /dev/null
+++ b/package/sysklogd/klogd.service
@@ -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
diff --git a/package/sysklogd/sysklogd.mk b/package/sysklogd/sysklogd.mk
index e1f0c34..1c8259a 100644
--- a/package/sysklogd/sysklogd.mk
+++ b/package/sysklogd/sysklogd.mk
@@ -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
index 0000000..70e4cff
--- /dev/null
+++ b/package/sysklogd/syslogd.service
@@ -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
-- 
2.7.4

             reply	other threads:[~2017-09-20 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20 10:21 Petr Kulhavy [this message]
2017-09-24 14:14 ` [Buildroot] [PATCH 1/1] package/sysklogd: add systemd services Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505902890-5891-1-git-send-email-brain@jikos.cz \
    --to=brain@jikos.cz \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.