[rhel6-branch] Start rsyslogd in linuxrc.s390 like syslogging in init.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some tools such as NetworkManager only send messages to syslog
but not to any terminal. In order to be able to debug issues
with such tools, allow s390 to do similar logging to init.c's
built-in syslogging.

Basically, this is cherry picking with adaptation of:
0fde437ad02a7cfb170472bad0ddf3b3faf4e7b0
e8cdfc480ccec62cfb2b70598dd792bbab43a1b2
66e12bec0d1e4afeabda8ab5c0ad663cea5f8135

There have been at least the following bugs asking for the content
of /tmp/syslog on s390.
Related: rhbz#541873
Related: rhbz#578428
Related: rhbz#597206
Related: rhbz#591533
---
 loader/linuxrc.s390  |    4 +++
 scripts/mk-images    |   51 ++++++++++++++++++++++++++++++++++++++++++++++++++
 scripts/upd-instroot |    4 ++-
 3 files changed, 58 insertions(+), 1 deletions(-)

diff --git a/loader/linuxrc.s390 b/loader/linuxrc.s390
index 99e5192..b6b13c3 100644
--- a/loader/linuxrc.s390
+++ b/loader/linuxrc.s390
@@ -331,6 +331,10 @@ function init_main() {
         # make /tmp/ramfs
         mount -t ramfs none /tmp
 
+        # start rsyslogd after mount of /tmp ramfs since it logs to /tmp/syslog
+        echo $"Starting rsyslogd..."
+        rsyslogd -c 4
+
         ifconfig lo 127.0.0.1 netmask 255.0.0.0
         route add -host 127.0.0.1 dev lo
 
diff --git a/scripts/mk-images b/scripts/mk-images
index 2ae76b7..cf8e47e 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -644,6 +644,9 @@ makeinitrd() {
                    lsreipl lsdasd dasdview dasdinfo lszfcp ; do
             instbin $IMGPATH /usr/sbin/$cmd $MBD_DIR /sbin/$cmd
         done
+
+        # rsyslogd
+        mkdir -p $MBD_DIR/$LIBDIR/rsyslog
     fi
 
     if [ -n "$INITRDMODULES" ]; then
@@ -806,6 +809,54 @@ makeinitrd() {
     instbin $IMGPATH /usr/sbin/mdadm $MBD_DIR /sbin/mdadm
     instbin $IMGPATH /usr/sbin/mdmon $MBD_DIR /sbin/mdmon
 
+    if [ "$BUILDARCH" = "s390" -o "$BUILDARCH" = "s390x" ]; then
+        # rsyslog
+        instbin $IMGPATH /usr/sbin/rsyslogd $MBD_DIR /sbin/rsyslogd
+        ( cd $IMGPATH/$LIBDIR/rsyslog
+            for f in *.so; do
+                instbin $IMGPATH /$LIBDIR/rsyslog/$f $MBD_DIR /$LIBDIR/rsyslog/$f
+            done
+        )
+        # \EOF has a quote in the first character on purpose; see man bash on here documents
+        cat > $MBD_DIR/etc/rsyslog.conf <<\EOF
+#### MODULES ####
+$ModLoad imuxsock.so     # provides support for local system logging
+$ModLoad imklog.so       # provides kernel logging support
+
+#### GLOBAL DIRECTIVES ####
+# Use default timestamp format
+$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
+
+#### TEMPLATES ####
+
+$template anaconda_tty4, "%syslogseverity-text:::uppercase% %programname%:%msg%\n"
+$template anaconda_syslog, "%timestamp:8:$:date-rfc3164%,%timestamp:1:3:date-subseconds% %syslogseverity-text:::uppercase% %programname%:%msg%\n"
+
+#### RULES ####
+# log everything except anaconda-specific records from local1 (those are stored
+# directly into files via python logging)
+*.*;\
+authpriv.none;\
+local1.none             /tmp/syslog;anaconda_syslog
+#                        & /dev/tty4;anaconda_tty4
+
+# ### begin forwarding rule ###
+# The statement between the begin ... end define a SINGLE forwarding
+# rule. They belong together, do NOT split them. If you create multiple
+# forwarding rules, duplicate the whole block!
+#
+# An on-disk queue is created for this action. If the remote host is
+# down, messages are spooled to disk and sent when it is up again.
+$ActionQueueMaxDiskSpace 1m     # space limit (use as much as possible)
+$ActionQueueSaveOnShutdown off  # do not save messages to disk on shutdown
+$ActionQueueType LinkedList     # run asynchronously
+$ActionResumeRetryCount -1      # infinite retries if host is down
+# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
+# ### end of the forwarding rule ###
+
+EOF
+    fi
+
     # Misc
     instbin $IMGPATH /usr/sbin/dmidecode $MBD_DIR /sbin/dmidecode
     instbin $IMGPATH /usr/bin/egrep $MBD_DIR /sbin/egrep
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index 4c5f1b1..a59f996 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -192,7 +192,7 @@ PACKAGES="GConf2 NetworkManager NetworkManager-gnome ORBit2 acl anaconda
     python-libs python-nss python-pyblock python-sqlite python-epdb
     python-urlgrabber python-volume_key pyxf86config readline redhat-artwork
     reiserfs-utils report-config-default report-gtk report-newt rpm rpm-libs
-    rpm-python sed selinux-policy-targeted
+    rpm-python rsyslogd sed selinux-policy-targeted
     setup slang smc-meera-fonts specspo sqlite startup-notification 
     synaptics system-config-date
     system-config-keyboard ${brandpkgname}-logos ${brandpkgname}-release
@@ -725,6 +725,7 @@ EOF
 
 if [ $ARCH = s390 -o $ARCH = s390x ]; then
     cat >> $KEEPFILE <<EOF
+$LIBDIR/rsyslog/*
 bin/basename
 bin/cat
 bin/chmod
@@ -766,6 +767,7 @@ sbin/portmap
 sbin/qetharp
 sbin/qetharp-2.6
 sbin/qethconf
+sbin/rsyslogd
 sbin/sysctl
 usr/bin/dirname
 usr/bin/expr
-- 
1.7.0.4


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux