Bug 1277735 - kexec -l followed by reboot hangs machine
Summary: kexec -l followed by reboot hangs machine
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-03 23:12 UTC by Scott Shambarger
Modified: 2016-01-26 03:21 UTC (History)
7 users (show)

Fixed In Version: systemd-219-27.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-26 03:21:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to handle kexec action as reboot in halt_now() (345 bytes, patch)
2015-11-03 23:12 UTC, Scott Shambarger
no flags Details | Diff

Description Scott Shambarger 2015-11-03 23:12:44 UTC
Created attachment 1089317 [details]
Patch to handle kexec action as reboot in halt_now()

Description of problem:
If I load a kernel image using kexec -l, and then attempt to reboot the machine (NOTE systemctl reboot, not systemctl kexec which works), the reboot fails and drops to debug shell.

Version-Release number of selected component (if applicable):
systemd-219-25.fc22.x86_64
dracut-041-14.fc22.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Load a kexec kernel: kexec -l <kernel> --append=<cmdline> --initrd=<initrd>
2. Reboot: systemctl reboot

Actual results:
dracut's shutdown script calls reboot, which fails, and drops to debug shell

Code should not be reached 'Unknown action." at ../src/systemctl/systemctl.c:7353, function halt_now(). Aborting.
/shutdown: line 109: 29616 Aborted
dracut Warning: reboot failed!
....
Dropping to debug shell.


Expected results:
system should reboot

Additional info:
I actually logged an issue upstream, but then found my freedesktop.org tree (from the README) was old, and this issue is fixed in the github.com tree.

The bug is caused by systemctl (which reboot links to) detecting the loaded kexec image, and changing the reboot action to kexec.  However, the halt_now() function doesn't handle the kexec action and aborts.

The fix on upstream is one line, just handle kexec like reboot in this case (ie. not actually kexec the system).

I've attached a patch from upstream...

Comment 1 Fedora Update System 2016-01-07 12:33:55 UTC
systemd-219-27.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7365dd5df4

Comment 2 Fedora Update System 2016-01-09 04:25:53 UTC
systemd-219-27.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-7365dd5df4

Comment 3 Fedora Update System 2016-01-26 03:20:55 UTC
systemd-219-27.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.