LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-11-2007, 11:38 AM   #1
Hewson
Member
 
Registered: Feb 2007
Location: /home
Distribution: Kubuntu and CentOS
Posts: 214

Rep: Reputation: 32
tcl/expect telnet spawns randomly close


Greetings all,

I'm just about at wits end. I have a series of expect scripts that telnet into windows and linux boxes. Most of the time these scripts will run fine, but every fourth or fifth run a telnet session will close with out warning. This behavior is unpredictable and inconsistent. It may happen in part of my script once and another part of script at another time. I'm getting a little desperate. I'm running wireshark & exp_internal to try and pinpoint the problem no luck.

any hints/advice/thoughts/questions would be appreciated.

feeling stumped.

steve


here is an output example: ('@'s are part of the welcome banner after logging in)
expect: read eof
expect: set expect_out(spawn_id) "exp9"
expect: set expect_out(buffer) ".\r\n\r\n\r\n\r\n @@ @@ @@ @@@@@@ @@@ \r\n @@ @@
@@ @@ \r\n @@ @@ @@ @@ @@@@@@ @@ @@ \r\n @@ @@ @@@@@@ @@ @@@@@@@
@@ @@ @@ \r\n @@@@@@ @@
\r\n @@ @@ @@ @@@@@ @@@@@ @@@@@ @@@@@ @@ @@@@@ @@@@@ @@ @@ @@ @@ \r\n @@ @@@@@ @@ @@
@ @@ @@ \r\n @@ @@@@ @@@ @@ @@ @@ @@ @@@ @@ @@@ @@@@ @@ @@@@ @@@@ \r\n
\nConnection closed by foreign host.\r\r\n"
write() failed to write anything - will sleep(1) and retry...
send: sending "\r" to { exp9 send: spawn id exp9 not open
while executing
"send "\r""
(procedure "gleanPrompt" line 10)
invoked from within
"gleanPrompt $spawn_id"
(procedure "connectTelnet" line 56)
invoked from within
"connectTelnet $host"
invoked from within
"set telnetSpawnId [connectTelnet $host]"
(file "loadSettings.exp" line 47)
 
Old 05-12-2007, 10:25 AM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Would you be able to supply the script's code?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
expect (Tcl) question kristof_v Programming 2 01-24-2013 05:32 AM
TCL/expect - parent hangs when child dies Hewson Programming 1 03-27-2007 08:44 PM
telnet server not reliable for expect script powah Linux - Software 0 11-16-2005 11:07 AM
Installation of Expect 5.x tcl private headers Anarchon Linux - Software 0 07-08-2005 09:02 AM
TCL, Expect, for Rsync - Please Help dholingw Programming 2 02-08-2004 10:27 AM


All times are GMT -5. The time now is 04:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration