- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to kill lost telnet sessions?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 04:46 AM
тАО01-10-2003 04:46 AM
Most of the time, this is handled smoothly, however, sometimes, when the user has a lock on a record, the operating system still thinks the telnet session is active.
I have a utility to kill processes that are linked together (the telnet session, the perl script they run, the instance of the database they are in), but I am looking for something I can key off automatically (so I can get some sleep).
I have tried to read up on telnetd, etc. but have not found anything relative.
Is there some test I can run routinely to see if a telnet session is still active?
TIA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 04:53 AM
тАО01-10-2003 04:53 AM
Re: How to kill lost telnet sessions?
you can put all this stuff in script and run it at regular intervals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 05:00 AM
тАО01-10-2003 05:00 AM
Re: How to kill lost telnet sessions?
If you run 'lsof -i tcp:23', how is showed the status of the proccesses? FIN_WAIT2? In this output you have the PID of the proccess.
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 05:24 AM
тАО01-10-2003 05:24 AM
Re: How to kill lost telnet sessions?
you can find the lost telnet sessions by following command:
# netstat -a|grep FIN
Using the below script to disconnect the connections
--------------
#!/usr/bin/ksh
#
# "flush_stale_finw2" -- Wolffman 6/2/98
#
# Script to flush stale FIN_WAIT_2 sockets.
# Script execution with the "-f" option results in
# HP machine sending TCP RST along with clean release
# and freeing of associated connection resources.
# (Essentially, returning kernel memory back for reuse.)
#
# Suggestion: invoke via "cron" job during off hours
#
#
#
# Usage: flush_stale_finw2 # To list sockets in FIN_WAIT_2 state
# flush_stale_finw2 -f # To actually force their removal
#
#
if test "$1" = "-f"
then
/usr/bin/ndd -get /dev/tcp tcp_status | grep FIN_WAIT_2 |
awk '{ printf "ndd -set /dev/tcp tcp_discon 0x%s\n", $1 }' > /tmp/finw2
/sbin/chmod 700 /tmp/finw2
/usr/bin/ksh -x /tmp/finw2
/sbin/rm /tmp/finw2
else
/usr/bin/ndd -get /dev/tcp tcp_status | grep FIN_WAIT_2
fi
--------------
Regards ...
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 05:35 AM
тАО01-10-2003 05:35 AM
Re: How to kill lost telnet sessions?
Chuck J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 05:53 AM
тАО01-10-2003 05:53 AM
Re: How to kill lost telnet sessions?
if you have access to the knowledge db you can check
http://support.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=KBRCKBRC00002518
for explanations (and a more current version) of this script.
But I don't think this script would help in this situation. Check if there are session in status FIN_WAIT2. Normally if a client just crashes it does not send a fin package so the server would not get in status FIN_WAIT2. I think the session would stay in status ESTABLISHED. Check status with
$ netstat -an
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 06:25 AM
тАО01-10-2003 06:25 AM
Re: How to kill lost telnet sessions?
please read the answert of Jochen and check his document. I'm not realy sure about the script I posted.
Best regards,
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 06:49 AM
тАО01-10-2003 06:49 AM
Re: How to kill lost telnet sessions?
I'm not sure if this works in your case too but I think the auto-logout feature of some shells is more appropriate to end lost (and therefore idle) sessions:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x5be5d211e18ad5118ff10090279cd0f9,00.html
Jochen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 07:21 AM
тАО01-10-2003 07:21 AM
Re: How to kill lost telnet sessions?
last -R
this will show you the last time people logged in and connections that are still active
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 10:24 AM
тАО01-10-2003 10:24 AM
Re: How to kill lost telnet sessions?
In my program, I have to enter a username, and it will list for me the terminals that they are connected to and the subprocesses run under that.
There is nothing there (but may be a flag I am not seeing) to show whether or not the terminal is TRULY active.
Right now, I react to user complaint that they cannot access a record, because it says they are already in it. When I research further, they will currently have one telnet session active, but when I look in the system, they will have 2,3, or more active sessions.
I will try some of the responses, but the really fun part of this problem is how intermittent it is!
BTW, I have seen this be worse with users coming in over cable modem using VPN software, in case anyone is wondering
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2003 11:13 AM
тАО01-10-2003 11:13 AM
SolutionFrom the HP on-line docs:
"tcp_keepalive_interval tcp_ip_abort_interval tcp_ip_abort_cinterval
tcp_keepalive_detached_interval
The parameter tcp_keepalive_interval determines the amount of time that TCP waits for an idle connection with no unacknowledged data before sending keepalive packets. The default is 2 hours.
"
see man getsockopt for all the gory details on how this is implemented. Also, if you are running gated, you have to tell it to pay attention to the keepalive signals.
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2003 07:23 AM
тАО01-13-2003 07:23 AM
Re: How to kill lost telnet sessions?
$ swlist -l product |grep -i arpa
If it is smaller then PHNE_21606 (on 11.0) install a more current version of the ARPA transport patch (reboot required). It could be that out of order fins might bite your system ...
Regards,
Jochen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2003 06:45 AM
тАО01-14-2003 06:45 AM
Re: How to kill lost telnet sessions?
I have a better idea, so let me continue to refine:
1. I believe that for some reason, the connection is staying "ESTABLISHED", when I look using the netstat command.
2. Subprocesses (database instance and PERL login script) also remain active. I think that will negate the lowered use of the shell's TMOUT. However, NO ONE uses the shell, so it won't hurt to lower it to 15 minutes.
3. I am looking for the tcp_keepalive_interval, since I believe that may be what I am looking for.
My simple thought is that the daemon telnetd must test the connection SOMEHOW, and that is what I am looking to change. It is almost like sending a "Are You There?" packet, but not quite.
Oh, and just so I clear this up, we are on 10.2.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2003 06:57 AM
тАО01-14-2003 06:57 AM
Re: How to kill lost telnet sessions?
HTH
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2003 07:03 AM
тАО01-14-2003 07:03 AM
Re: How to kill lost telnet sessions?
I believe what will help me is a utility called "nettune". It allows me to get to the tcp_keep* settings.
I am going to lower the two hour default, and for a very short confirm time.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2003 07:56 AM
тАО01-14-2003 07:56 AM
Re: How to kill lost telnet sessions?
At 10.20, you need to change tcp_keepstart to a much lower value with
nettune -s tcp_keepstart nnnn
On one of our servers, we set this to 300 (5 minutes).
You'll also have to include this in a system startup script in order for it to be set after a reboot.
Regards,
John