[systemd-devel] kexec returns error code 1

Lennart Poettering lennart at poettering.net
Thu Jun 18 11:10:49 PDT 2015

On Fri, 22.05.15 15:59, Aaron_Wright at selinc.com (Aaron_Wright at selinc.com) wrote:

> I'm trying to get kexec reboots to work on my box with systemd. I can get 
> "kexec -l ..." and "kexec -e" to work when ran straight from the command 
> line, but when I run "kexec -l ..." and "systemctl kexec" I get "kexec 
> returned error code 1" and it falls back to a full reboot.
> I've puzzled over this for a while, but I can't figure out the difference 
> between the two situations that would prevent the later from working. 
> (error code 1 doesn't tell me much) Ideas?

Consider placing a script in /usr/lib/systemd/system-shutdown/ that is
marked executable, that play around with the kexec command line,
echoing its output to some log file, so that you can look at it after
reboot. Note though that at that time the fs are already mounted
read-only, you'd have to remount it rw first, to be able to place that
log file somwhere.

Regular logging is unfortunately not available anymore that late,
because things are already mounted read-only.

Also see systemd-shutdown(8) for details.


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list