From: Thomas Dickey <dickey@saltmine.radix.net>
Subject: Re: unix process behaviour when terminal windows get killed?
Date: 8 Oct 2002 11:51:43 GMT [thread overview]
Message-ID: <anugsf$q0f$4@news1.radix.net> (raw)
In-Reply-To: 20021007202851.28570.00000238@mb-bh.aol.com
Williamcin <williamcin@aol.com> wrote:
> Hi,
> I wonder if someone could tell exactly what would happen in the following
> scenario?
> During the day, we use the terminal emulator (both native MS telnet and
> TeraTerm) from our PC to connect to our Tru64 Unix 5.1A system and run a
> character-based in-house application.
> Everything runs ok until the end of the day when people finished their work and
> some people just kill the terminal windows by clicking the "X" on the top right
> hand corner of the window. Most of the time, killing the windows like that will
> kill the Unix process as well (I have assumed that a 'kill -9' signal is sent
> over to the Unix and kill that process) but sometimes the Unix process attached
> to that terminal will go into infinite loop and use 99.9% of the CPU. We have
> to kill that process manually (takes a look time) to get the system back.
> Questions:
> 1. exactly what would happen to the Unix process when someone just kill the
> terminal windows by clicking the "X"
Actually I would expect a SIGHUP to be sent rather than a SIGTERM.
The trouble with the former is that it can be blocked (as you see), or that the
application may have detached itself in some way from the terminal that gets
the SIGHUP. If its input is closed and the application doesn't check for that
condition (feof(stdin) or ferror(stdin), it'll loop as you observe.
--
Thomas E. Dickey <dickey@radix.net> <dickey@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com
next prev parent reply other threads:[~2002-10-08 11:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-08 0:28 unix process behaviour when terminal windows get killed? Williamcin
2002-10-08 7:04 ` Paul Pluzhnikov
2002-10-08 11:51 ` Thomas Dickey [this message]
2002-10-11 3:00 ` Williamcin
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox