diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index 3eeb8933..7fc1e3fe 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -382,6 +382,10 @@ All relevant changes are documented in this file. files installed. They create `/run/nologin` at boot, and on systemd it is removed by systemd-user-sessions. Finit now removes it when leaving runlevel S, like it already does with `/etc/nologin` +- Fix logins allowed in single user mode when booting straight into + runlevel 1, and while going from runlevel 1 to halt or reboot. The + `/etc/nologin` file was created for the new runlevel and then removed + again for the one being left - Fix a lost reload for a service paused mid-reload by a condition in flux. A second reload arriving meanwhile re-parsed the unchanged .conf and cleared the pending mark, so the service resumed without ever being diff --git a/src/sm.c b/src/sm.c index 9b63c239..debe47f3 100644 --- a/src/sm.c +++ b/src/sm.c @@ -327,16 +327,14 @@ static char sm_rl2ch(int lvl) */ static void nologin(void) { - /* From systemd's tmpfiles.d, where systemd-user-sessions removes it */ + /* Left by tmpfiles.d at boot */ if (prevlevel == INIT_LEVEL) erase("/run/nologin"); if (runlevel == 1 || IS_RESERVED_RUNLEVEL(runlevel)) touch(FINIT_NOLOGIN_PATH); - - if (prevlevel == 1 || IS_RESERVED_RUNLEVEL(prevlevel)) + else if (prevlevel == 1 || IS_RESERVED_RUNLEVEL(prevlevel)) erase(FINIT_NOLOGIN_PATH); - } void sm_init(void)