dracut-kdump.sh: Redirect kdump script stdout/stderr to /dev/console

Currently in kdump.sh, we redirect stdout to stderr, because dracut
pre-pivot service (which kdump.sh is running within) only output stderr
to console. That behavior is defined in dracut-pre-pivot.service:

[Service]
...
StandardInput=null
StandardOutput=syslog
StandardError=syslog+console
...

But during testing, it has been observed that systemd will cache stderr
buffer, and first record to syslog (and it's own journal), then copy the
logs to /dev/console. And this practice is somehow unexpected in our
kdump script. We may have suppressed stdout/stderr that hasn't been
write to /dev/console before we run a force reboot.

With this change of redirecting stdout/stderr to /dev/console, kdump.sh
will output everything immediately to console, not cached/hidden by
systemd.

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
WANG Chao 2013-07-05 15:45:07 +08:00 committed by Baoquan He
parent 5de822d48d
commit a88f0848dc

View File

@ -1,6 +1,6 @@
#!/bin/sh
exec >&2
exec &> /dev/console
. /lib/dracut-lib.sh
set -o pipefail