antonblanchard / kexec-lite

GNU General Public License v2.0
6 stars 17 forks source link

Design: improvements for integration with different init systems #3

Open jk-ozlabs opened 7 years ago

jk-ozlabs commented 7 years ago

Currently, kexec -e just does a:

        execlp("shutdown", "shutdown", "-r", "now", NULL);

This makes a couple of assumptions about userspace though:

Neither of these is true for busybox init, hence @mikey 's problems running upstream kexec-lite on petitboot. We have some glue in petitboot to handle this, but that's specific to busybox, and probably not something we want to integrate into kexec-lite as-is.

So, it would be great if we can design a better, lightweight way to tell init to shutdown & kexec. We'd probably need to coordinate with kexec-tools for this too.

jk-ozlabs commented 7 years ago

Initially, I think we could create a convention of a specific binary for kexec & kexec-lite to call when it wants to start a graceful shutdown & kexec. The system would provide that binary to do the right thing for that userspace.

And we'd fall-back to shutdown -r now, of course.

mpe commented 7 years ago

I just use -f?

jk-ozlabs commented 7 years ago

@mpe: we still want a graceful shutdown of userspace, which -f prevents. In that case, (for example) you'll still have DHCP leases pending.