From 755fe9863249649ec57a1d9557f16f253ba52b9b Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Sun, 29 Jul 2012 14:58:21 +0200 Subject: [PATCH] systemd: Use journald for system and kernel logging. From now we will use the shipped journal daemon, to log and watch our messages from system and kernel. Reference #10199. --- systemd/systemd.nm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/systemd/systemd.nm b/systemd/systemd.nm index 0b6b5cb85..b3575f6f8 100644 --- a/systemd/systemd.nm +++ b/systemd/systemd.nm @@ -5,7 +5,7 @@ name = systemd version = 187 -release = 1 +release = 2 maintainer = Stefan Schantl groups = System/Base @@ -59,6 +59,9 @@ build end install_cmds + # Create folder in log to store the journal. + mkdir -pv %{BUILDROOT}/var/log/journal + # Create sysv compatible symlinks. mkdir -pv %{BUILDROOT}%{sbindir} ln -svf ../lib/systemd/systemd %{BUILDROOT}/%{sbindir}/init @@ -104,6 +107,13 @@ build # Remove unneeded symlink for xdg rm -rfv %{BUILDROOT}/etc/xdg/systemd + + # Use journald. Enable the import of kernel messages. + # Stop forwarding to a syslog daemon. + sed \ + -e "s/^#ForwardToSyslog=.*$/ForwardToSyslog=no/" \ + -e "s/^#ImportKernel=.*$/ImportKernel=yes/" \ + -i %{BUILDROOT}/etc/systemd/journald.conf end end @@ -130,12 +140,14 @@ packages /sbin/reboot /sbin/shutdown + syslog udev = %{thisver} end conflicts dracut < 019 filesystem < 002 + rsyslog < 5.8.6-4 upstart end @@ -195,6 +207,12 @@ packages # Restart login service after update /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : /usr/bin/systemctl try-restart systemd-logind.service >/dev/null 2>&1 || : + + # Use the new journald configuration file and restart the service. + if ! grep -xq ImportKernel=yes /etc/systemd/journald.conf ; then + mv /etc/systemd/journald.conf.paknew /etc/systemd/journald.conf + /usr/bin/systemctl restart systemd-journald.service >/dev/null 2>&1 || : + fi end # Be sure to start the new udev after everything is done. -- 2.39.5