2011-07-25 11:38:43 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
KDUMP_PATH="/var/crash"
|
|
|
|
CORE_COLLECTOR="makedumpfile -d 31 -c"
|
2011-07-26 16:02:19 +00:00
|
|
|
DEFAULT_ACTION="reboot -f"
|
2011-07-25 11:38:43 +00:00
|
|
|
|
|
|
|
read_kdump_conf()
|
|
|
|
{
|
|
|
|
local conf_file="/etc/kdump.conf"
|
|
|
|
if [ -f "$conf_file" ]; then
|
|
|
|
while read config_opt config_val;
|
|
|
|
do
|
|
|
|
case "$config_opt" in
|
|
|
|
path)
|
|
|
|
KDUMP_PATH="$config_val"
|
|
|
|
;;
|
|
|
|
core_collector)
|
|
|
|
CORE_COLLECTOR="$config_val"
|
|
|
|
;;
|
|
|
|
default)
|
2011-07-26 16:02:19 +00:00
|
|
|
case $config_val in
|
|
|
|
shell)
|
|
|
|
DEFAULT_ACTION="/bin/sh"
|
|
|
|
;;
|
|
|
|
reboot)
|
|
|
|
DEFAULT_ACTION="reboot -f"
|
|
|
|
;;
|
|
|
|
halt)
|
|
|
|
DEFAULT_ACTION="halt -f"
|
|
|
|
;;
|
|
|
|
poweroff)
|
|
|
|
DEFAULT_ACTION="poweroff -f"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
2011-07-25 11:38:43 +00:00
|
|
|
esac
|
|
|
|
done < $conf_file
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
do_default_action()
|
|
|
|
{
|
2011-07-26 16:02:19 +00:00
|
|
|
$DEFAULT_ACTION
|
2011-07-25 11:38:43 +00:00
|
|
|
}
|
|
|
|
|