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(a)redhat.com>
---
kdumpctl | 3 ++-
mkdumprd | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index f616fdbcf503..d0bbb55c06ae 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -345,7 +345,8 @@ check_files_modified()
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-`
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"
[ $? -ne 0 ] && return 2
diff --git a/mkdumprd b/mkdumprd
index 37057490aff7..12f59a9fc584 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -104,7 +104,7 @@ to_mount() {
fi
_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)
# with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
# kernel, filter it out here.
--
2.7.4