Hi Felipe, On 15 October 2017 at 14:30, Felipe Sateler <fsate...@debian.org> wrote: > > Excellent. I would suggest though to fix this first for 235, and > upstream. That way whatever solution is implemented for stretch[1] can > be designed with compatibility with buster in mind. > > > [1] If the release team ACKs the change, too.
Yes, that makes sense as a first step. I have submitted a pull request for upstream [1] and attached a patch against 235-2 (I hope I formatted it properly...). As mentioned in the comments of the PR, I've tested it a bit in VirtualBox, but corrupting /etc/fstab stopped triggering emergency mode at some point. I'm not sure if I tested it well. As far as I can see, systemd moved on to use the meson build system after stretch's version was released, so I'm not sure if sulogin-shell.c can be backported easily. However, the patch itself is very simple, so porting the patch shouldn't be much of an obstacle. > It is my understanding that sulogin --force will still ask for > password if getpwnam works. You're right! I should've read the manpage for sulogin. >> 3) [...] > > This has the drawback of requiring to modify ExecStart, and thus risk > becoming incompatible if the sulogin wrapper changes interface. > >> 4) [...] > > I don't have an opinion here. I've left the sulogin-shell interface as it was. Regards, Stijn van Drongelen [1] https://github.com/systemd/systemd/pull/7116
Author: Stijn van Drongelen <rhym...@gmail.com> Bug: https://github.com/systemd/systemd/issues/7115 Bug-Debian: https://bugs.debian.org/802211 Description: use sulogin --force for rescue and emergency mode Assuming that sulogin-shell is only used for rescue and emergency mode, it always needs to invoke `sulogin --force`. When the root account is locked, sulogin would otherwise refuse to login, causing systemd to boot the default target. . Additionally, this patch also changes the opening message of sulogin-shell to accurately describe this behaviour. It also suggests `journalctl -xb -p3` rather than `journalctl -xb`, as users of especially emergency mode are probably only interested in errors (or worse). --- systemd-235.orig/src/sulogin-shell/sulogin-shell.c +++ systemd-235/src/sulogin-shell/sulogin-shell.c @@ -81,14 +81,15 @@ static void fork_wait(const char* const } static void print_mode(const char* mode) { - printf("You are in %s mode. After logging in, type \"journalctl -xb\" to view\n" - "system logs, \"systemctl reboot\" to reboot, \"systemctl default\" or ^D to boot\n" - "into default mode.\n", mode); + printf("You are in %s mode. If the root account is enabled, you must log in\n" + "as root after this message. In the shell, type \"journalctl -xb -p3\" to view\n" + "the error log for the current boot, \"systemctl reboot\" to reboot,\n" + "\"systemctl default\" or ^D to boot into default mode.\n", mode); fflush(stdout); } int main(int argc, char *argv[]) { - static const char* const sulogin_cmdline[] = {SULOGIN, NULL}; + static const char* const sulogin_cmdline[] = {SULOGIN, "--force", NULL}; int r; log_set_target(LOG_TARGET_AUTO);
_______________________________________________ Pkg-systemd-maintainers mailing list Pkg-systemd-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-systemd-maintainers