This patch executes the binary and script files in /etc/kdump/{pre.d,post.d}
just like kdump_pre or kdump_post directive written in /etc/kdump.conf.
Signed-off-by: shin-onitsuka <onitsuka.shinic(a)fujitsu.com>
---
dracut-kdump.sh | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 2ae1c7c..51a1f73 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -30,15 +30,51 @@ do_dump()
do_kdump_pre()
{
+ local _ret
+
if [ -n "$KDUMP_PRE" ]; then
"$KDUMP_PRE"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ echo "kdump: $KDUMP_PRE exited with $_ret status"
+ return $_ret
+ fi
+ fi
+
+ if [ -d /etc/kdump/pre.d ]; then
+ for file in `find /etc/kdump/pre.d -type f | sort`; do
+ "$file"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ echo "kdump: $file exited with $_ret status"
+ return $_ret
+ fi
+ done
fi
}
do_kdump_post()
{
+ local _ret
+
+ if [ -d /etc/kdump/post.d ]; then
+ for file in `find /etc/kdump/post.d -type f | sort`; do
+ "$file" "$1"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ echo "kdump: $file exited with $_ret status"
+ return $_ret
+ fi
+ done
+ fi
+
if [ -n "$KDUMP_POST" ]; then
"$KDUMP_POST" "$1"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ echo "kdump: $KDUMP_POST exited with $_ret status"
+ return $_ret
+ fi
fi
}
--
1.8.3.1
Show replies by date