mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 13:33:09 +07:00
Disable login also in shutdown/reboot
Disable login in single-user mode as well as shutdown/reboot Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -154,6 +154,12 @@ restart:
|
||||
/* Cleanup stale services */
|
||||
svc_clean_dynamic(service_unregister);
|
||||
|
||||
/* Disable login in single-user mode as well as shutdown/reboot */
|
||||
if (runlevel == 1 || runlevel == 0 || runlevel == 6)
|
||||
touch("/etc/nologin");
|
||||
else
|
||||
erase("/etc/nologin");
|
||||
|
||||
if (0 == runlevel) {
|
||||
do_shutdown(SHUT_OFF);
|
||||
sm->state = SM_RUNNING_STATE;
|
||||
@@ -165,11 +171,6 @@ restart:
|
||||
break;
|
||||
}
|
||||
|
||||
if (runlevel == 1)
|
||||
touch("/etc/nologin"); /* Disable login in single-user mode */
|
||||
else
|
||||
erase("/etc/nologin");
|
||||
|
||||
/* No TTYs run at bootstrap, they have a delayed start. */
|
||||
if (prevlevel > 0)
|
||||
tty_runlevel(runlevel);
|
||||
|
||||
Reference in New Issue
Block a user