kdump need create the dir specified in "path" formerly if it does not
exist. Now change the behavior to be that ueser takes charge of the
"path", make sure "path" has been created, especially when separate
disk
is mounted on this "path".
Signed-off-by: Baoquan He <bhe(a)redhat.com>
---
mkdumprd | 38 ++++++++------------------------------
1 file changed, 8 insertions(+), 30 deletions(-)
diff --git a/mkdumprd b/mkdumprd
index bb1e01e..93fc7fe 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -174,34 +174,13 @@ mkdir_save_path_ssh()
}
-#mkdir if save path does not exist on dump target filesystem
-#$1=dump target
-#caller should ensure $1 is mounted
-mkdir_save_path_fs() {
+#check whether $SAVE_PATH has been created.
+check_save_path_fs() {
local _mnt=$(to_mount_point $1)
- local _remount="no"
- local _ret
-
- [ ! -d ${_mnt}/$SAVE_PATH ] && {
- if is_readonly_mount $1; then
- echo "Mounting $1 as read-write for creating dump directory.."
- mount -o remount,rw $1 || {
- perror_exit "Mounting $1 as read-write failed."
- }
- _remount="yes"
- fi
- mkdir -p ${_mnt}/$SAVE_PATH
- _ret=$?
- [ "$_remount" = "yes" ] && {
- echo "Remounting $1 as read-only."
- mount -o remount,ro $1 || {
- perror_exit "Remounting $1 as read-only failed."
- }
- }
- [ $_ret -ne 0 ] && {
- perror_exit "Creating ${_mnt}/$SAVE_PATH failed."
- }
- }
+
+ if [ ! -d ${_mnt}/$SAVE_PATH ]; then
+ perror_exit "Please check if path:$SAVE_PATH has been created."
+ fi
}
#Function: get_fs_size
@@ -347,7 +326,6 @@ get_block_dump_target()
{
local _target
-
_target=$(get_user_configured_dump_disk)
[ -n "$_target" ] && echo $(to_dev_name $_target) &&
return
@@ -539,7 +517,7 @@ do
add_dracut_module "nfs"
fi
add_mount "$config_val"
- mkdir_save_path_fs $config_val
+ check_save_path_fs $config_val
check_size fs $config_val
;;
raw)
@@ -560,7 +538,7 @@ do
check_size ssh $config_val
mkdir_save_path_ssh $config_val
add_dracut_module "ssh-client"
- add_dracut_sshkey "$SSH_KEY_LOCATION"
+ add_dracut_sshkey "$SSH_KEY_LOCATION"
else
perror_exit "Bad ssh dump target $config_val"
fi
--
1.8.5.3