mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
sm: remove /run/nologin when leaving runlevel S
On a system with systemd's tmpfiles.d files installed, only root can
log in after boot. The files have a boot-only entry:
f+! /run/nologin 0644 - - - "System is booting up. ..."
On systemd the file is removed by systemd-user-sessions when boot is
done. Finit runs the entry, but only removes /etc/nologin, so
pam_nologin keeps refusing everyone but root.
Remove /run/nologin too when leaving runlevel S.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
3 files changed
+21
No files matched your search
@@ -327,11 +327,16 @@ static char sm_rl2ch(int lvl)
|
||||
*/
|
||||
static void nologin(void)
|
||||
{
|
||||
/* From systemd's tmpfiles.d, where systemd-user-sessions removes it */
|
||||
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))
|
||||
erase(FINIT_NOLOGIN_PATH);
|
||||
|
||||
}
|
||||
|
||||
void sm_init(void)
|
||||
|
||||
Reference in new issue
Block a user