From 2777a93a9c7e55d60037e41c1691e89cde16d3d1 Mon Sep 17 00:00:00 2001 From: Xunlei Pang Date: Tue, 1 Aug 2017 18:30:38 +0800 Subject: [PATCH] mkdumprd: use 300s as the default systemd unit timeout for kdump mount Currently, systemd uses 90s as the default mount unit timeout (see "man 5 systemd-system.conf " for "DefaultTimeoutStartSec"), in some cases, although it works well in 1st kernel, it's not enough under kdump and results in mount timeout, further results in kdump dumping failure. We've met several such issues, we decided to enlarge this default value a little for kdump. We know that dracut has a default initqueue timeout value of 180s ("rd.retry"), we finalized a little larger value 300s as kdump's default timeout if there is no explicit "DefaultTimeoutStartSec=X, specified by users. "DefaultTimeoutStartSec=X" can be overridden by individual mount option "x-systemd.device-timeout=X", users can specify their own values as needed. This patch achieves the purpose by creating a dedicated conf file "/etc/systemd/system.conf.d/kdump.conf" which has the content of "DefaultTimeoutStartSec=300s", this is based on the fact that all the conf files will be parsed by systemd and the last parsed one will be used if there are duplicate definitions. Signed-off-by: Xunlei Pang Acked-by: Dave Young --- dracut-module-setup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 59b4f04..8de9dbe 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -753,4 +753,13 @@ install() { sed -i -e \ 's/\(^[[:space:]]*reserved_memory[[:space:]]*=\)[[:space:]]*[[:digit:]]*/\1 1024/' \ ${initdir}/etc/lvm/lvm.conf &>/dev/null + + # Kdump turns out to require longer default systemd mount timeout + # than 1st kernel(90s by default), we use default 300s for kdump. + grep -r "^[[:space:]]*DefaultTimeoutStartSec=" ${initdir}/etc/systemd/system.conf* &>/dev/null + if [ $? -ne 0 ]; then + mkdir -p ${initdir}/etc/systemd/system.conf.d + echo "[Manager]" > ${initdir}/etc/systemd/system.conf.d/kdump.conf + echo "DefaultTimeoutStartSec=300s" >> ${initdir}/etc/systemd/system.conf.d/kdump.conf + fi }