From 6b592f581c1a5ec489acee95779867e0485770fd Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 1 Nov 2022 10:06:20 -0700 Subject: [PATCH] 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. --- dracut-logger.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut-logger.sh b/dracut-logger.sh index 07389285e8..0dd17cc666 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