If the directory /etc/kdump/pre.d is optional, then it is hard to tell between the
following cases:
-1. no directory "/etc/kdump/pre.d"
-2. "rm -rf /etc/kdump/pre.d", which removes all scripts under pre.d
For the second case, kdump.img should be rebuilt.
To bail out from this corner case, always creating pre.d and post.d.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
---
kdumpctl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 70fb551..5f1c956 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -345,6 +345,9 @@ check_files_modified()
POST_FILES="$POST_FILES $file"
fi
done
+ else
+ echo "creating /etc/kdump/post.d"
+ mkdir -p /etc/kdump/post.d
fi
if [ -d /etc/kdump/pre.d ]; then
for file in /etc/kdump/pre.d/*; do
@@ -352,6 +355,9 @@ check_files_modified()
PRE_FILES="$PRE_FILES $file"
fi
done
+ else
+ echo "creating /etc/kdump/pre.d"
+ mkdir -p /etc/kdump/pre.d
fi
CORE_COLLECTOR=`grep ^core_collector $KDUMP_CONFIG_FILE | cut -d\ -f2`
CORE_COLLECTOR=`type -P $CORE_COLLECTOR`
--
2.7.5