1757081 Members
2466 Online
108858 Solutions
New Discussion юеВ

Re: Inactivity Logout

 
SOLVED
Go to solution
Hakki Aydin Ucar
Honored Contributor

Re: Inactivity Logout

>Jim: The 60 second warning does not appear if I'm using bash but the session terminates all the same!

So , 60 seconds is something hard coded OR default in somewhere as countdown to the termination ?
Jim Walls
Trusted Contributor

Re: Inactivity Logout

I haven't done an accurate timing for bash... but what appeared to happen was that after between two and three minutes the session terminated without warning.

In the sh-posix case it appears to emit the warning 60 seconds after the $TMOUT period has elapsed and then terminate 60 seconds after the warning.

I'll do a better timing with bash to confirm.
Jim Walls
Trusted Contributor

Re: Inactivity Logout

OK! Here is the session log for bash:


First: Call ssh and prime a call on date for when we return

[jimw@jimwpc3 ~]$ ssh pocuast2;date
Last login: Thu Sep 2 20:02:24 2010 from 10.81.105.17
Value of TERM has been set to "xterm".
WARNING: YOU ARE SUPERUSER !!
[root@pocuast2 /root ] exec bash
[root@pocuast2 root] date;export TMOUT=120
Thu Sep 2 21:05:57 NZST 2010
[root@pocuast2 root]
[root@pocuast2 root] timed out waiting for input: auto-logout
Connection to pocuast2 closed.
Thu Sep 2 21:08:00 NZST 2010
[jimw@jimwpc3 ~]$

As you can see, the total duration was about a little over TWO minutes.

Next I logged a sh-posix session:

[jimw@jimwpc3 ~]$ ssh pocuast2;date
Last login: Thu Sep 2 21:05:13 2010 from 10.81.105.17
Value of TERM has been set to "xterm".
WARNING: YOU ARE SUPERUSER !!
[root@pocuast2 /root ] date;export TMOUT=120
Thu Sep 2 21:17:24 NZST 2010
[root@pocuast2 /root ]
Shell will time out in 60 seconds.
sh: Timed out waiting for input.
Connection to pocuast2 closed.
Thu Sep 2 21:20:24 NZST 2010
[jimw@jimwpc3 ~]$

As you can see, POSIX shell users get a wrning and an extra 60 seconds ;O)








Dennis Handly
Acclaimed Contributor

Re: Inactivity Logout

>Jim: Shell will time out in 60 seconds.
>...prompt. A minute later the session disconnects.

Yes.

>Hakki: 60 seconds is something hard coded

TGRACE is hard coded as 60.

>Jim: In the sh-posix case it appears to emit the warning 60 seconds after the $TMOUT period has elapsed and then terminate 60 seconds after the warning.

My experiments with real shells indicate you get TMOUT, then you get a 60 grace period. Then:
sh: Timed out waiting for input.
Hakki Aydin Ucar
Honored Contributor

Re: Inactivity Logout

>Dennis: TGRACE is hard coded as 60.

>Jim: >>

My experiments with real shells indicate you get TMOUT, then you get a 60 grace period. Then:
sh: Timed out waiting for input.


So , Timeout gracely manner is valid for POSIX and other shells like KSH;

# ksh
# echo $0
ksh
# export TMOUT=5
#
shell time out in 60 seconds
((AFTER 60 seconds, because I changed my shell from POSIX to ksh,otherwise it would be terminated))
ksh: timed out waiting for input