lkml.org 
[lkml]   [1996]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: funny behaviour of shutdown
   Date: 	Tue, 16 Apr 1996 18:31:07 +0400 (MSD)
From: inr-linux-kernel@ms2.inr.ac.ru (A.Kuznetsov)

Very long ago, line marked by exclamations was missing
in tty_io.c.

void disassociate_ctty(int on_exit)
{
struct tty_struct *tty = current->tty;
struct task_struct *p;

if (tty) {
!!!!! if (on_exit && tty->driver.type != TTY_DRIVER_TYPE_PTY)
tty_vhangup(tty);
} else {
....

When it was inserted (I forgot patch level number),
my "shutdown" stopped to make any tty output after kill(-1, SIGKILL)

It was added deliberately as a security feature. The idea is that when
the controlling process dies, the tty should get hung up. This prevents
surviving processes from either maliciously or accidentally being able
to send/receive characters to the tty. For example, without this the
next person who is logging in to have access to a leftover program,
confusing the person and perhaps allowing that user to access files
owned by the previous user. It's also very useful way of cleaning up
after users on a dialup server.

As far as shutdown is concerned, it's clear how this causes a problem.
What I'd suggest doing to work around this is to reopen the tty after
kill() call.

- Ted


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.033 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site