Do not check, if the logfile itsself is writable. Check the directory
instead.
# Log initrd creation.
if ! [[ $dracutlogfile ]]; then
[[ $dracutbasedir = /usr/share/dracut ]] && \
- dracutlogfile=/var/log/dracut.log || \
- dracutlogfile=$HOME/dracut.log
- if [[ -w $dracutlogfile ]]; then
- >"$dracutlogfile"
+ dracutlogfile=/var/log/dracut.log || \
+ dracutlogfile=$HOME/dracut.log
+ if [[ -w ${dracutlogfile%/*} ]]; then
+ >>"$dracutlogfile"
fi
fi