From: Brian C. Lane Date: Tue, 1 Nov 2022 17:06:20 +0000 (-0700) Subject: fix(dracut-logger.sh): this fixes the dlog_init check for /dev/log X-Git-Tag: 058~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b592f581c1a5ec489acee95779867e0485770fd;p=thirdparty%2Fdracut.git fix(dracut-logger.sh): this fixes the dlog_init check for /dev/log The /dev/log check was not correct, it would continue working if /dev/log was a broken symlink. This changes the logic to be more clear -- /dev/log needs to be a socket, and writable, and logger needs to be available. If any of those conditions fail, turn off syslog and only use console logging. --- diff --git a/dracut-logger.sh b/dracut-logger.sh index 07389285e..0dd17cc66 100755 --- a/dracut-logger.sh +++ b/dracut-logger.sh @@ -151,7 +151,7 @@ dlog_init() { readonly _dlogfd=15 systemd-cat -t 'dracut' --level-prefix=true < "$_systemdcatfile" & exec 15> "$_systemdcatfile" - elif ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger > /dev/null; then + elif ! ([[ -S /dev/log ]] && [[ -w /dev/log ]] && command -v logger > /dev/null); then # We cannot log to syslog, so turn this facility off. kmsgloglvl=$sysloglvl sysloglvl=0