Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design: improvements for integration with different init systems #3

Open
jk-ozlabs opened this issue Nov 25, 2016 · 3 comments
Open

Comments

@jk-ozlabs
Copy link
Contributor

Currently, kexec -e just does a:

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

This makes a couple of assumptions about userspace though:

  • that shutdown is present
  • that the init system will handle a fairly normal reboot request in a way that kexec expects (ie, ending with a reboot(LINUX_REBOOT_CMD_KEXEC)). This means that the init system needs to (somehow) detect, out-of-band, that we want to do a kexec reboot rather than a normal one.

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
Copy link
Contributor Author

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
Copy link

mpe commented Nov 25, 2016

I just use -f?

@jk-ozlabs
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants