Bug 2050565

Summary: Make sure dracut-initramfs-restore cleans up the incompletely unpacked initramfs upon forced shutdown
Product: Red Hat Enterprise Linux 9 Reporter: David Tardon <dtardon>
Component: dracutAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED DUPLICATE QA Contact: qe-baseos-daemons
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: dracut-maint-list, dtardon
Target Milestone: rcKeywords: Bugfix, Reproducer, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-04 16:18:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Tardon 2022-02-04 09:34:54 UTC
This bug was initially created as a copy of Bug #2023665

I am copying this bug because: 
It still applies.


Description of problem:

For some still unknown reason on HP systems, hitting Ctrl-Alt-Del from the iLO sends a burst of ctrl-alt-del events, leading to systemd shutting down forcibly the system while dracut-shutdown.service is still running.
In turn, systemd kills all processes making the service, including dracut-initramfs-restore, which hence dies before cleaning up the incompletely unpacked initramfs (because cpio itself got killed).
The result is a system crash when "shutdown" command in the initramfs tries to execute:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
[   25.967275] systemd-shutdown[1]: Successfully changed into root pivot.
[   25.968881] systemd-shutdown[1]: Returning to initrd...
[   25.971797] watchdog: watchdog0: watchdog did not stop!
/bin/sh: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or director
y
[   25.974390] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[   25.974390] 
[   25.976256] CPU: 0 PID: 1 Comm: shutdown Kdump: loaded Not tainted 4.18.0-348.2.1.el8_5.x86_64 #1
[   25.977464] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-4.fc34 04/01/2014
[   25.978679] Call Trace:
[   25.979564]  dump_stack+0x5c/0x80
[   25.980548]  panic+0xe7/0x2a9
[   25.981391]  do_exit.cold.23+0x57/0xb6
[   25.982287]  do_group_exit+0x3a/0xa0
[   25.983186]  __x64_sys_exit_group+0x14/0x20
[   25.984133]  do_syscall_64+0x5b/0x1a0
[   25.985006]  entry_SYSCALL_64_after_hwframe+0x65/0xca
[   25.985901] RIP: 0033:0x7f4db749c90e
[   25.986647] Code: 89 fa 41 b8 e7 00 00 00 be 3c 00 00 00 eb 14 0f 1f 44 00 00 89 d7 89 f0 0f 05 48 3d 00 f0 ff ff 7
7 1a f4 89 d7 44 89 c0 0f 05 <48> 3d 00 f0 ff ff 76 e2 f7 d8 89 05 6a f8 20 00 eb d8 f7 d8 89 05
[   25.989464] RSP: 002b:00007ffdc23bce38 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
[   25.990506] RAX: ffffffffffffffda RBX: 00007f4db74a5210 RCX: 00007f4db749c90e
[   25.991521] RDX: 000000000000007f RSI: 000000000000003c RDI: 000000000000007f
[   25.992591] RBP: 00007f4db76ace5f R08: 00000000000000e7 R09: 0000000000000000
[   25.993667] R10: 0000000000000020 R11: 0000000000000246 R12: 00007f4db76ace70
[   25.994854] R13: 0000000000000001 R14: 00007f4db76ac1d0 R15: 0000000000000000
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------


Version-Release number of selected component (if applicable):

dracut-049-191 (RHEL8)


How reproducible:

Always


Steps to Reproduce:
1. Boot a QEMU/KVM nameed "ctrlaltdel8"
2. From the hypervisor, send a burst of ctrl-alt-del

  # for i in $(seq 1 10); do virsh send-key ctrlaltdel8 KEY_LEFTCTRL KEY_LEFTALT KEY_DELETE; sleep 0.1; done


Actual results:

Crash

Expected results:

No crash

Additional info:

Will submit a Upstream PR soon :)

Comment 1 David Tardon 2022-02-04 16:18:18 UTC

*** This bug has been marked as a duplicate of bug 2024502 ***