Patch 1 is just a cleanup for some left over duplicate code. Patch 2 is the actual resolution to fix /etc/fstab modification check. Now it will check for modification only when this file exists.
Pratyush Anand (2): kdumpctl: Kill duplicate code related to file modication check kdumpctl: check /etc/fstab modification only when it exists
kdumpctl | 23 ++--------------------- mkdumprd | 2 +- 2 files changed, 3 insertions(+), 22 deletions(-)
commit "28e8c4b5ac89 kdumpctl: Move file modification check logic in check_system_modified()" copied file modification check logic instead of moving. Kill the duplicate logic from original calling function check_rebuild().
Signed-off-by: Pratyush Anand panand@redhat.com --- kdumpctl | 20 -------------------- 1 file changed, 20 deletions(-)
diff --git a/kdumpctl b/kdumpctl index ccb1e1e4d4a6..f616fdbcf503 100755 --- a/kdumpctl +++ b/kdumpctl @@ -538,26 +538,6 @@ check_rebuild() image_time=`stat -c "%Y" $TARGET_INITRD 2>/dev/null` fi
- #also rebuild when Pacemaker cluster conf is changed and fence kdump is enabled. - modified_files=$(get_pcs_cluster_modified_files $image_time) - - EXTRA_BINS=`grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2` - CHECK_FILES=`grep ^kdump_pre $KDUMP_CONFIG_FILE | cut -d\ -f2` - 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" - - check_exist "$files" && check_executable "$EXTRA_BINS" - [ $? -ne 0 ] && return 1 - - for file in $files; do - time_stamp=`stat -c "%Y" $file` - if [ "$time_stamp" -gt "$image_time" ]; then - modified_files="$modified_files $file" - fi - done - check_system_modified ret=$? if [ $ret -eq 2 ]; then
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 --- 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.
On 2016/09/14 at 22:42, Pratyush Anand wrote:
Patch 1 is just a cleanup for some left over duplicate code. Patch 2 is the actual resolution to fix /etc/fstab modification check. Now it will check for modification only when this file exists.
Pratyush Anand (2): kdumpctl: Kill duplicate code related to file modication check kdumpctl: check /etc/fstab modification only when it exists
kdumpctl | 23 ++--------------------- mkdumprd | 2 +- 2 files changed, 3 insertions(+), 22 deletions(-)
The series looks good to me: Reviewed-by: Xunlei Pang xlpang@redhat.com
Hi, Pratyush
Acked and applied.
On 09/14/16 at 08:12pm, Pratyush Anand wrote:
Patch 1 is just a cleanup for some left over duplicate code. Patch 2 is the actual resolution to fix /etc/fstab modification check. Now it will check for modification only when this file exists.
Pratyush Anand (2): kdumpctl: Kill duplicate code related to file modication check kdumpctl: check /etc/fstab modification only when it exists
kdumpctl | 23 ++--------------------- mkdumprd | 2 +- 2 files changed, 3 insertions(+), 22 deletions(-)
-- 2.7.4 _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/admin/lists/kexec@lists.fedoraproject.org
Thanks Dave