From: Harald Hoyer Date: Wed, 22 Jan 2014 10:48:45 +0000 (+0100) Subject: dracut-logger.sh: systemd-cat only understands prio 0-7 X-Git-Tag: RHEL-7.1~152 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74c9df58f25736aea0da8c56e15d047dc6a9cb5a;p=thirdparty%2Fdracut.git dracut-logger.sh: systemd-cat only understands prio 0-7 --- diff --git a/dracut-logger.sh b/dracut-logger.sh index f679dc945..70b0da4c6 100755 --- a/dracut-logger.sh +++ b/dracut-logger.sh @@ -154,7 +154,7 @@ dlog_init() { readonly _systemdcatfile="$_dlogdir/systemd-cat" mkfifo "$_systemdcatfile" readonly _dlogfd=15 - systemd-cat -t 'dracut' <"$_systemdcatfile" & + systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" & exec 15>"$_systemdcatfile" elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then # We cannot log to syslog, so turn this facility off. @@ -330,7 +330,7 @@ _do_dlog() { if (( $lvl <= $sysloglvl )); then if [[ "$_dlogfd" ]]; then - echo "<$(_dlvl2syslvl $lvl)>$msg" >&$_dlogfd + printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd else logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg" fi