summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-07 22:39:37 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-03-09 09:33:20 +0100
commit906b04e97e8e1f8f09110e6e13caad87862f4736 (patch)
treecdf192149d5d96e10a231c6e2c91b49e467687fe
parent22f36ffbbd0c4e0fe1bfe331cb7ca15ec6ae80aa (diff)
downloadrsyslog-906b04e97e8e1f8f09110e6e13caad87862f4736.tar.gz
rsyslog-906b04e97e8e1f8f09110e6e13caad87862f4736.tar.xz
rsyslog-906b04e97e8e1f8f09110e6e13caad87862f4736.zip
systemd: use standard syslog.socket unit
In systemd we now have a standard socket unit for /dev/log called syslog.socket. This unit can be shared between an early boot mini syslog and the full syslog implementation started later on. The mini syslog is shipped along systemd and does nothing but simply forward the data received through /dev/log to the kernel log buffer (i.e. kmsg, as visible by dmesg). It is run during early boot, and then as soon as rsyslog starts up it is terminated, so that rsyslog can take over the /dev/log socket. Since one of the first things rsyslog does after starting up is flushing the kernel log buffer to disk we end up with all data from early boot up in syslog. This patch changes two things: removes rsyslog.socket and instead configures rsyslog.service to take possession of syslock.socket. And secondly includes a PreStart line to terminate the running syslog bridge instance.
-rw-r--r--Makefile.am3
-rw-r--r--rsyslog.service.in3
-rw-r--r--rsyslog.socket8
3 files changed, 2 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index 9493e373..f699cc46 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -44,9 +44,6 @@ endif
#
if HAVE_SYSTEMD
-dist_systemdsystemunit_DATA = \
- rsyslog.socket
-
nodist_systemdsystemunit_DATA = \
rsyslog.service
diff --git a/rsyslog.service.in b/rsyslog.service.in
index 2bcde528..03db596e 100644
--- a/rsyslog.service.in
+++ b/rsyslog.service.in
@@ -2,9 +2,10 @@
Description=System Logging Service
[Service]
+ExecStartPre=/bin/systemctl stop systemd-kmsg-syslogd.service
ExecStart=@sbindir@/rsyslogd -n -c5
ExecReload=/bin/kill -HUP $MAINPID
+Sockets=syslog.socket
[Install]
WantedBy=multi-user.target
-Also=rsyslog.socket
diff --git a/rsyslog.socket b/rsyslog.socket
deleted file mode 100644
index 0cd86054..00000000
--- a/rsyslog.socket
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=Syslog Socket
-
-[Socket]
-ListenDatagram=/dev/log
-
-[Install]
-WantedBy=sockets.target