[arch-general] Can we talk about the systemd mkinitcpio hook for a minute?
Hello all, First off, apologies if this has been/is being discussed elsewhere, but this has been on my mind for quite some time. The state of the systemd mkinitcpio hook has been bothering me recently. It seems that there is some confusion/ambiguity about what capabilities, precisely, said hook provides; particularly with regards to replacing the 'base' hook at some point. I think it's effectively ready now; I've been using the systemd hook without base and udev for some time now. The only sticking point seems to be with the rescue and emergency shells. Of the 19 open systemd bugs [0], four of them [1-4] deal with systemd not providing an emergency/rescue shell and/or busybox/maintenance tools to the initrd image. Based on my understanding of the status quo, the systemd init hook is intended to simplify and streamline the boot process and the initrd image for systemd-based systems. The hook currently does this. It does not provide any functional rescue capabilities (you can get to an emergency shell, but it doesn't work), and I don't think it should. The use case for initrd-based rescue shells is very small and specific; many of these use cases can make do with a live image or something similar. Basically, my view is this: the systemd hook should only provide boot functionality, and not contain rescue/emergency targets/shells by default. The problem with providing such functionality is that the dependencies and binary include requirements quickly spiral out of control when providing a full shell within the initrd (sulogin, busybox, any rescue tools, etc). Having so many dependencies goes against the simplicity that the systemd hook is trying to accomplish. If anything, I propose a new hook, sd-rescue, which provides rescue.{target,service}, emergency.{target,service}, busybox, and minimal binaries useful for rescuing a system. This can be used in situations where live-image booting is not an option, or where the sysadmin prefers the option of initrd emergency/rescue functions. Also, we should maybe stop including emergency.target with the systemd hook, since it doesn't seem to work in most cases. -- Chris [0] https://bugs.archlinux.org/?project=1&cat%5B%5D=31&string=systemd [1] https://bugs.archlinux.org/task/44493?project=1&cat%5B0%5D=31&string=systemd [2] https://bugs.archlinux.org/task/45480?project=1&cat%5B0%5D=31&string=systemd [3] https://bugs.archlinux.org/task/42399?project=1&cat%5B0%5D=31&string=systemd [4] https://bugs.archlinux.org/task/36265?project=1&cat%5B0%5D=31&string=systemd
If anything, I propose a new hook, sd-rescue, which provides rescue.{target,service}, emergency.{target,service}, busybox, and minimal binaries useful for rescuing a system. This can be used in situations where
Hi Chris, Am 04.09.2015 16:38 schrieb "Chris Bell" <cwbell@narmos.org>: live-image booting is not an option, or where the sysadmin prefers the option of initrd emergency/rescue functions. Also, we should maybe stop including emergency.target with the systemd hook, since it doesn't seem to work in most cases. Go for it! I will enable that hook and have it everywhere, since I regularly need that shell. But please also add rescue.target and rescue.service. emergency.* happens on my systems before the USB drivers are loaded that I need to have my keyboard functional. I would also appreciate if my passwd/shadow/group files would not be leaked into the initrd by default (using *.initrd in favor of the real files if those are available). Best Regards, Tobias
On 09/04/2015 04:37 PM, Chris Bell wrote:
Hello all,
First off, apologies if this has been/is being discussed elsewhere, but this has been on my mind for quite some time.
The state of the systemd mkinitcpio hook has been bothering me recently. It seems that there is some confusion/ambiguity about what capabilities, precisely, said hook provides; particularly with regards to replacing the 'base' hook at some point. I think it's effectively ready now; I've been using the systemd hook without base and udev for some time now. The only sticking point seems to be with the rescue and emergency shells.
Please have a look at my mkinitcpio-systemd-ng-git package on the AUR[1], sources on GitHub[2]. It contains a collection of fixes I've made to the systemd hook over time, mostly to make it more maintainable, but it also adds better support for the emergency and rescue shells. I've been using this hook (without the 'base' hook) on all my boxes for a few months now, without any major issues. I've created a topic on the BBS for discussing my hook[3], which may be more convenient for people who are not subscribed to this mailing list. Any questions, suggestions and pull requests are very welcome. -Alain
Basically, my view is this: the systemd hook should only provide boot functionality, and not contain rescue/emergency targets/shells by default. The problem with providing such functionality is that the dependencies and binary include requirements quickly spiral out of control when providing a full shell within the initrd (sulogin, busybox, any rescue tools, etc). Having so many dependencies goes against the simplicity that the systemd hook is trying to accomplish.
If anything, I propose a new hook, sd-rescue, which provides rescue.{target,service}, emergency.{target,service}, busybox, and minimal binaries useful for rescuing a system. This can be used in situations where live-image booting is not an option, or where the sysadmin prefers the option of initrd emergency/rescue functions. Also, we should maybe stop including emergency.target with the systemd hook, since it doesn't seem to work in most cases.
While I oridinally intended my hook to be a possible update candidate to the official systemd hook (making sure the changes are minimal), my success at minimizing and organizing things in the script should make it very easy to split it into a main systemd hook and some other hooks adding functionality such as emergency/rescue shell support (I've already split off an optional package providing configuration of keyboard drivers for use with the emergency/rescue shell during early boot). [1]: https://aur.archlinux.org/packages/mkinitcpio-systemd-ng-git/ [2]: https://github.com/ackalker/mkinitcpio-systemd-ng [3]: https://bbs.archlinux.org/viewtopic.php?id=196755
participants (3)
-
Alain Kalker
-
Chris Bell
-
Tobias Hunger