Unnamed repository
Go to file
Ziyue Yang 0933f89f65 kdumpctl: fix infinite loop caused by running under bash
Description of problem
(https://bugzilla.redhat.com/show_bug.cgi?id=1465735):
Run `kdumpctl status` as normal user, get below error messages:

Another app is currently holding the kdump lock; waiting for it to exit...
flock: 9: Bad file descriptor
Another app is currently holding the kdump lock; waiting for it to exit...
flock: 9: Bad file descriptor
...

The bug is caused by behavior difference between bash
and sh (bash in posix).

In the function single_instance_lock in kdumpctl script,
there is

exec 9>/var/lock/kdump

which will fail in user mode. However, this fail will cause
script exiting under bash but not exiting under sh, causing
infinite loop because the flock will always fail.

According to the 16th item in
ftp://ftp.gnu.org/old-gnu/Manuals/bash-2.02/html_node/bashref_66.html

If a POSIX.2 special builtin returns an error status, a non-
interactive shell exits.

And according to
https://www.gnu.org/software/bash/manual/html_node/Special-Builtins.html

exec is one of the POSIX.2 special builtin's.

This patch fixes the bug by checking exec return value.

Fixes: 9fb2996d05 ("kdumpctl: change the shebang header to use /bin/bash")
Signed-off-by: Ziyue Yang <ziyang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Reviewed-by: Xunlei Pang <xlpang@redhat.com>
2017-07-14 14:47:37 +08:00
anaconda-addon Rename the subpackage kdump-anaconda-addon 2014-05-22 18:32:43 +08:00
.gitignore .gitignore: Update to make it more generic 2016-05-16 10:15:01 +08:00
98-kexec.rules udev-rules: Restart kdump service on cpu ADD/REMOVE events 2014-09-15 21:55:07 +08:00
dracut-kdump-capture.service Introduce kdump capture service 2014-08-05 13:13:32 +08:00
dracut-kdump-emergency.service kdump-emergency: fix "Transaction is destructive" emergency failure 2017-03-31 11:54:30 +08:00
dracut-kdump-emergency.target kdump-emergency: fix "Transaction is destructive" emergency failure 2017-03-31 11:54:30 +08:00
dracut-kdump-error-handler.service Introduce kdump error handling service 2014-08-05 13:13:32 +08:00
dracut-kdump-error-handler.sh Revert "execute kdump_post after do_default_action" 2015-04-08 15:50:16 +08:00
dracut-kdump.sh dracut-kdump: use POSIX shell syntax 2016-11-28 10:41:15 +08:00
dracut-module-setup.sh dracut-module-setup: Fix test for inclusion of DRM modules 2017-06-15 09:40:03 +08:00
dracut-monitor_dd_progress monitor-dd-progress fix 2013-06-25 16:45:59 +08:00
fadump-howto.txt Document: fix incorrect link in fadump-how.txt 2017-03-08 13:07:20 +08:00
kdump-dep-generator.sh kdump-dep-generator: Add kdump service dependencies on the fly 2014-04-17 11:27:31 +08:00
kdump-in-cluster-environment.txt Add fence_kdump support for generic clusters 2014-04-03 14:43:06 +08:00
kdump-lib-initramfs.sh kdump-lib-initramfs.sh: ignore the failure of echo 2017-04-27 13:59:49 +08:00
kdump-lib.sh kdump-lib.sh: fix incorrect usage with pipe as input for grep -q in is_pcs_fence_kdump() 2017-03-08 13:07:20 +08:00
kdump.conf kdumpctl: for fence_kdump, the ipaddr of this node should be excluded from list 2017-05-18 16:44:42 +08:00
kdump.conf.5 kdump.conf.5: clarify the fence_kdump_nodes option 2017-06-09 09:47:22 +08:00
kdump.service make kdump work when kernel crash after shutdown 2015-06-03 21:10:34 +08:00
kdump.sysconfig Remove kernel param "quiet" from kdump kernel cmdline 2015-12-11 15:18:31 +08:00
kdump.sysconfig.i386 Remove kernel param "quiet" from kdump kernel cmdline 2015-12-11 15:18:31 +08:00
kdump.sysconfig.ppc64 Remove kernel param "quiet" from kdump kernel cmdline 2015-12-11 15:18:31 +08:00
kdump.sysconfig.ppc64le Remove kernel param "quiet" from kdump kernel cmdline 2015-12-11 15:18:31 +08:00
kdump.sysconfig.s390x Remove kernel param "quiet" from kdump kernel cmdline 2015-12-11 15:18:31 +08:00
kdump.sysconfig.x86_64 kdump.sysconfig/x86_64: Add nokaslr to kdump kernel cmdline 2017-04-27 13:59:49 +08:00
kdumpctl kdumpctl: fix infinite loop caused by running under bash 2017-07-14 14:47:37 +08:00
kdumpctl.8 kdumpctl: Add man page for kdumpctl 2015-08-19 14:15:34 +08:00
kexec-kdump-howto.txt kexec-kdump-howto: Add doc about the special mount information via "dracut_args" 2016-08-26 14:03:48 +08:00
kexec-tools-2.0.3-disable-kexec-test.patch Disable kexec_test 2012-01-21 16:56:07 +08:00
kexec-tools-2.0.14-build_mem_phdrs-check-if-p_paddr-is-invalid.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools-2.0.14-makedumpfile-elf_info-kcore-check-for-invalid-physic.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools-2.0.14-makedumpfile-initial-call-cache_init-a-bit-early.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools-2.0.14-makedumpfile-makedumpfile-Correct-the-calculation-of.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools-2.0.14-makedumpfile-makedumpfile-Discard-process_dump_load.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools-2.0.14-makedumpfile-mem-usage-allow-to-work-only-with-f-for.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools-2.0.14-makedumpfile-show_mem_usage-calculate-page-offset-af.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools-2.0.14-makedumpfile-x86_64-check-physical-address-in-PT_LOA.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools-2.0.14-x86-x86_64-Fix-format-warning-with-die.patch Fix makedumpfile --mem-usage /proc/kcore 2017-03-17 10:14:17 +08:00
kexec-tools.spec Release 2.0.15-2 2017-06-28 14:36:01 +08:00
live-image-kdump-howto.txt Revert "kdumpctl: filter 'root' kernel parameter when running in live images" 2017-04-11 16:03:12 +08:00
mkdumprd kdumpctl: remove "root=X" for kdump boot 2017-04-11 16:02:12 +08:00
mkdumprd.8 Remove comma which is redundant 2013-02-16 15:19:41 +08:00
README README: Add a README file 2014-04-02 10:45:36 +08:00
sources Release kexec-tools 2.0.15-1 2017-06-23 11:33:25 +08:00
zanata-notes.txt Add a notes for zanata process 2012-12-05 01:23:09 -05:00

Adding a patch to kexec-tools
=============================
There is a mailing list kexec@lists.fedoraproject.org where all the dicussion
related to fedora kexec-tools happen. All the patches are posted there for
inclusion and committed to kexec-tools after review.

So if you want your patches to be included in fedora kexec-tools package,
post these to kexec@lists.fedoraproject.org.

One can subscribe to list and browse through archives here.

https://admin.fedoraproject.org/mailman/listinfo/kexec