kdumpctl: check /etc/fstab modification only when it exists
On a diskless client /etc/fstab does not exist. Therefore check modification time of this file for rebuild only if it exists. Also use --fstab option with findmnt only when /etc/fstab exists. Signed-off-by: Pratyush Anand <panand@redhat.com> Reviewed-by: Xunlei Pang <xlpang@redhat.com> Acked-by: Dave Young <dyoung@redhat.com>
This commit is contained in:
parent
9b95184251
commit
1bb23e7536
3
kdumpctl
3
kdumpctl
|
@ -345,7 +345,8 @@ check_files_modified()
|
||||||
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
|
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
|
||||||
CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-`
|
CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-`
|
||||||
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
|
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
|
||||||
files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS /etc/fstab"
|
files="$KDUMP_CONFIG_FILE $kdump_kernel $EXTRA_BINS"
|
||||||
|
[[ -e /etc/fstab ]] && files="$files /etc/fstab"
|
||||||
|
|
||||||
check_exist "$files" && check_executable "$EXTRA_BINS"
|
check_exist "$files" && check_executable "$EXTRA_BINS"
|
||||||
[ $? -ne 0 ] && return 2
|
[ $? -ne 0 ] && return 2
|
||||||
|
|
2
mkdumprd
2
mkdumprd
|
@ -104,7 +104,7 @@ to_mount() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev)
|
_fstype=$(findmnt -k -f -n -r -o FSTYPE $_dev)
|
||||||
_options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev)
|
[[ -e /etc/fstab ]] && _options=$(findmnt --fstab -f -n -r -o OPTIONS $_dev)
|
||||||
[ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
|
[ -z "$_options" ] && _options=$(findmnt -k -f -n -r -o OPTIONS $_dev)
|
||||||
# with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
|
# with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
|
||||||
# kernel, filter it out here.
|
# kernel, filter it out here.
|
||||||
|
|
Loading…
Reference in New Issue