Aparentemente impossível sem alterar o código-fonte.
A pesquisa de login.defs
ou LOGIN_TIMEOUT
não produz resultados relevantes e analisa loginutils / login.c realmente parece que o valor e todo o temporizador são codificados:
enum { TIMEOUT = 60, EMPTY_USERNAME_COUNT = 10, /* Some users found 32 chars limit to be too low: */ USERNAME_SIZE = 64, TTYNAME_SIZE = 32, };
[…]
static void alarm_handler(int sig UNUSED_PARAM) { /* This is the escape hatch! Poor serial line users and the like * arrive here when their connection is broken. * We don't want to block here */ ndelay_on(STDOUT_FILENO); /* Test for correct attr restoring: * run "getty 0 -" from a shell, enter bogus username, stop at * password prompt, let it time out. Without the tcsetattr below, * when you are back at shell prompt, echo will be still off. */ tcsetattr_stdin_TCSANOW(&G.tty_attrs); printf("\r\nLogin timed out after %u seconds\r\n", TIMEOUT); fflush_all(); /* unix API is brain damaged regarding O_NONBLOCK, * we should undo it, or else we can affect other processes */ ndelay_off(STDOUT_FILENO); _exit(EXIT_SUCCESS); }
[…]
int login_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int login_main(int argc UNUSED_PARAM, char **argv) {
[…]
/* We install timeout handler only _after_ we saved G.tty_attrs */ signal(SIGALRM, alarm_handler); alarm(TIMEOUT);
Note como a última parte não é recuada, parece não haver if
em torno dela, então ela sempre roda. Como você provavelmente poderia fazer é descomentar as duas últimas linhas e compilar busybox
se isso for possível.
Idéia alternativa
# <action>: Valid actions include: sysinit, respawn, askfirst, wait, once,
# restart, ctrlaltdel, and shutdown.
#
# Note: askfirst acts just like respawn, but before running the specified
# process it displays the line "Please press Enter to activate this
# console." and then waits for the user to press enter before starting
# the specified process.
Você pode simplesmente alterar respawn
para askfirst
. Dessa forma, /bin/login
após o tempo limite expira simplesmente ao prompt Please press Enter…
em vez de iniciar /bin/login
imediatamente.