Need help teminated session consumes cpu

Need help teminated session consumes cpu

am 07.09.2005 06:21:09 von ayakorn

Hello,

I create user's menu using shell script on DEC OSF/1 4.0. It works
properly. The problem is if user close telnet session by closing telnet
program (don't use function exit in our shell script), his session
still run on server and consumes a lot of cpu. How shell script detects
this behaviour and teminate itself.

Output of command 'w':
11:17 up 7 days, 14:28, 6 users, load average: 3.79, 3.20, 3.07
User tty from login@ idle JCPU PCPU what
wit p1 10.1.1.154 11:17 1:43 1:43 pg
output.txt
....

Regards,
wit

Re: Need help teminated session consumes cpu

am 08.09.2005 00:55:00 von Enrique Perez-Terron

On Wed, 07 Sep 2005 06:21:09 +0200, wrote:

> Hello,
>
> I create user's menu using shell script on DEC OSF/1 4.0. It works
> properly. The problem is if user close telnet session by closing telnet
> program (don't use function exit in our shell script), his session
> still run on server and consumes a lot of cpu. How shell script detects
> this behaviour and teminate itself.

I am no expert on the specifics of OSF/1, but with all unix variants
I have known, when the user closes the telnet session, the programs
attached to the pseudoterminal in question receive a hangup signal
(SIGHUP).

The question is why this does not hapen in this case.

I would think that it does happen, but the shell script has a trap set
for this signal (signal 1) and does not terminate.

-Enrique