sm: keep /etc/nologin when entering runlevel 1 from S

Booting straight into single user mode left logins allowed.  The same
happened going from runlevel 1 to 0 or 6, logins were let in while the
system went down.

The file was created when the new runlevel was 1, 0, 6 or S, and after
that removed when the previous one was.  With both true, the removal
undid the creation.

Remove it only when the new runlevel does not want it.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-11-23 02:17:23 +01:00
1 parent a629c8add3
commit 8fc4cf8b4b
2 files changed
+6 -4

No files matched your search

+4
View File
@@ -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