Skip to content

Commit

Permalink
fix(dracut-logger.sh): this fixes the dlog_init check for /dev/log
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bcl authored and LaszloGombos committed Nov 3, 2022
1 parent cf31fcf commit 6b592f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dracut-logger.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6b592f5

Please sign in to comment.