mirror of
https://github.com/troglobit/finit.git
synced 2026-11-08 16:11:10 +00:00
Avoid 2 sec block of Finit when stopping TTYs
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
e791e3dbe9
commit
4cc3aed139
1 file changed
+6
-2
@@ -223,9 +223,13 @@ void tty_stop(finit_tty_t *tty)
|
|||||||
if (!tty->pid)
|
if (!tty->pid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* XXX: TTY handling should be refactored to regular services,
|
||||||
|
* XXX: that way we could rely on the state machine to properly
|
||||||
|
* XXX: send SIGTERM, wait for max 2 sec to collect PID before
|
||||||
|
* XXX: sending SIGKILL.
|
||||||
|
*/
|
||||||
_d("Stopping TTY %s", tty->name);
|
_d("Stopping TTY %s", tty->name);
|
||||||
kill(tty->pid, SIGTERM);
|
|
||||||
do_sleep(2);
|
|
||||||
kill(tty->pid, SIGKILL);
|
kill(tty->pid, SIGKILL);
|
||||||
waitpid(tty->pid, NULL, 0);
|
waitpid(tty->pid, NULL, 0);
|
||||||
tty->pid = 0;
|
tty->pid = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user