- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HP-UX hanging telnet session
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
Forums
Discussions
Discussions
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
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
10-18-2004 03:33 AM
10-18-2004 03:33 AM
HP-UX hanging telnet session
There any way to identify the hanging telnet sessions ?
If the user logs into the machine through telnet and closes the window without exiting properly , whether those sessions cleaned up after a specific time ?? What is the time period for that ?
We need this info because the user will be running some interactive scripts in those telnet sessions and if the user does not exit properly, we need to clean up those scripts (which will be child process of that telnet session).
Please let us know if u have any suggestions.
Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:48 AM
10-18-2004 07:48 AM
Re: HP-UX hanging telnet session
You could write a script to look for the scripts that don't have tty's associated with them, then blow them away.
I haven't seen that behavior with telnet. Are your scripts doing trap's?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 09:15 AM
10-18-2004 09:15 AM
Re: HP-UX hanging telnet session
It does help if the user is just sitting on the command prompt.
insf -e might help if the problem is being generated by bad pseudo device drivers.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 09:26 AM
10-18-2004 09:26 AM
Re: HP-UX hanging telnet session
If the telnet session exits, then all the child processes that were spawned by it should also die unless they were started with 'nohup' option.
You can probably modify the script to output the pids of the subshells into a file in some directory including it's own. Have a cronjob that checks those files periodically. If the pid of the script is not found in the 'ps -ef' list, then it can go ahead and kill rest of the pids in that file. Not a 100% sure shot, but it can be the closest you have.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 09:47 AM
10-18-2004 09:47 AM
Re: HP-UX hanging telnet session
It's possible to write a script that kills idle sessions, but I hate those.
My suggestion: Move off telnet and switch to ssh. There are good client programs like putty that can be used to talk over ssh. This will give you keepalives (you may need to configure the server to turn them on).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 05:54 PM
10-18-2004 05:54 PM
Re: HP-UX hanging telnet session
The tty for handing sessions is still "pts/tj". This remains the same even after hours.
We hav a daemon scheduled, which kills all our script running with (tty=? or ppid=1) But this is not working now as the tty remains the same and not changing to '?' even after the parent session is closed.
What could be the problem here ??
Also I have no idea how to check if the 'telnetd' supports 'keepalive'. Could anyone help me out on this..And how to change the behaviour to automatically terminate the hanging telnet sessions ?
Thanks,
Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 07:53 PM
10-18-2004 07:53 PM
Re: HP-UX hanging telnet session
Use netstat -a|grep FIN to find the lost telnet connections.
use this script sweep
#!/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
Infact the same was alreadydisccused in a previuos thread
regards
SK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2004 11:59 PM
10-18-2004 11:59 PM
Re: HP-UX hanging telnet session
WHat version of HPux are you running?
When was the last set of network patches applied?
live free or die
harry