Keeping Telnet Session Open

From: Crist Clark (crist.clark@globalstar.com)
Date: Thu Jan 26 2006 - 20:26:04 EST


Porting some scripts over from HPUX. This one seems to depend on some
interesting behavior from the HP telnet. It does something like,

        telnet host > logfile &

And the idea is that this process just sits in the background writing
output from "host" to the log file.

This doesn't work on Solaris (we're using 9). The Solaris telnet, when
backgrounded in this manner, will immediately tell the other end it's
done (you can watch the TCP FIN go out right away), and things close
right up.

Yes, this doesn't work for a reason. Telnet is a tool for _interactive_
sessions. But before I makes some heads explode by telling them to import
non-Sun software (netcat) or write this all in Perl or something else
that can handle the TCP connectivity natively, does anyone have a way
to trick the telnet into keeping the connection open? I tried something
like,

        mkfifo -m 600 /tmp/.dumfifo
        telnet host < /tmp/.dumfifo > logfile &

Hoping that the telnet would stay alive waiting for input on the FIFO,
but it doesn't even start until it gets something pushed down the pipe
and then quits. Maybe I'm missing some variant on that which could help?

-- 
Crist J. Clark                               crist.clark@globalstar.com
Globalstar Communications                                (408) 933-4387
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:38:46 EDT