From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,77fbcb0bbe1b980b X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 2002-10-08 04:56:01 PST Path: archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!newspeer.radix.net!news1.radix.net!not-for-mail From: Thomas Dickey Newsgroups: comp.unix.osf.osf1 Subject: Re: unix process behaviour when terminal windows get killed? Date: 8 Oct 2002 11:51:43 GMT Organization: RadixNet Internet Services Message-ID: References: <20021007202851.28570.00000238@mb-bh.aol.com> NNTP-Posting-Host: saltmine.radix.net User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (SunOS/5.8 (sun4u)) Xref: archiver1.google.com comp.unix.osf.osf1:140 Williamcin 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 http://dickey.his.com ftp://dickey.his.com