aboutsummaryrefslogtreecommitdiff
path: root/sbin/init
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2009-06-14 17:00:35 +0000
committerEd Schouten <ed@FreeBSD.org>2009-06-14 17:00:35 +0000
commit4ae35b5d2ad8492bff7e5ee9f940d647e6ce3cbf (patch)
treee28abd0f50c9dc30488e9aafd5a242e9601c370d /sbin/init
parente49d35049d38b3688a106d3707a03135e26aa728 (diff)
Notes
Diffstat (limited to 'sbin/init')
-rw-r--r--sbin/init/init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 8c0b68057fdd..baf29bbd21af 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -1495,9 +1495,16 @@ death(void)
/* NB: should send a message to the session logger to avoid blocking. */
logwtmp("~", "shutdown", "");
+ /*
+ * Also revoke the TTY here. Because runshutdown() may reopen
+ * the TTY whose getty we're killing here, there is no guarantee
+ * runshutdown() will perform the initial open() call, causing
+ * the terminal attributes to be misconfigured.
+ */
for (sp = sessions; sp; sp = sp->se_next) {
sp->se_flags |= SE_SHUTDOWN;
kill(sp->se_process, SIGHUP);
+ revoke(sp->se_device);
}
/* Try to run the rc.shutdown script within a period of time */
@@ -1566,6 +1573,7 @@ runshutdown(void)
sigaction(SIGTSTP, &sa, (struct sigaction *)0);
sigaction(SIGHUP, &sa, (struct sigaction *)0);
+ revoke(_PATH_CONSOLE);
if ((fd = open(_PATH_CONSOLE, O_RDWR)) == -1)
warning("can't open %s: %m", _PATH_CONSOLE);
else {