fstab: do not mount and fsck from fstab if using systemd
If using systemd in initramfs, we could run into a race condition when dracut and systemd both are trying to mount and run fsck for the same filesystem, and mount or fsck could be a failure. To fix such failure, we should use systemd to mount/fsck from /etc/fstab only. v2: check $DRACUT_SYSTEMD suggested by Alexander Tsoy Signed-off-by: WANG Chao <chaowang@redhat.com>master
parent
3c530fc528
commit
e920bfb1e8
|
@ -27,7 +27,11 @@ fstab_mount() {
|
|||
return 0
|
||||
}
|
||||
|
||||
[ -f /etc/fstab ] && fstab_mount /etc/fstab
|
||||
# systemd will mount and run fsck from /etc/fstab and we don't want to
|
||||
# run into a race condition.
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
[ -f /etc/fstab ] && fstab_mount /etc/fstab
|
||||
fi
|
||||
|
||||
# prefer $NEWROOT/etc/fstab.sys over local /etc/fstab.sys
|
||||
if [ -f $NEWROOT/etc/fstab.sys ]; then
|
||||
|
|
Loading…
Reference in New Issue