Expect-5.32.1 and Hangups when Spawning a Shell

Rob spamrefuse at yahoo.com
Wed Dec 14 18:46:59 PST 2005


Martin McCormick wrote:
> 	Has anyone seen a condition in FreeBSD4.7 in which
> expect-5.32.1 randomly hangs when spawning a shell?
> 
> 	I got this idea from running autoexpect:
> 
> spawn $env(SHELL)
> 
> 	Then, I would look for the prompt and begin
executing
> commands.
> 
> 	About every 20 or 30 times, no shell spawns and the
script
> just hangs there with 1 virtual terminal seized
until someone kills
> the process.  Since the particular expect script is
run automaticly,
> one can run out of tty's in a few weeks if this
happens often enough
> or one doesn't clean house regularly.
> 
> 	What I recently tried is to set conservative mode
to 1 so it
> will output data more slowly although I can't
imagine how this really
> helps.
> 
> 	Strangely enough, it has been several days since I
made the
> change and I haven't had to zap one single expect
script.
> 
> 	Is that just coincidence or could the timing of the
spawn
> command actually matter?  Remember, this is before
the shell ever
> starts.
> 
> 	Here is what the beginning of the script now looks
like:
> 
> #!/usr/local/bin/expect -f
> 
> if {$force_conservative} {
> 	set send_slow {1 .1}
> 	proc send {ignore arg} {
> 		sleep .1
> 		exp_send -s -- $arg
> 	}
> }
> 
> spawn $env(SHELL)
> match_max 100000
> expect -exact "bash-2.05b# "
> 
> 	When it fails, the prompt never appears.
> 
> 	Any ideas as to why this occasionally happens or
whether my
> slow-down of the "typed" output should help is much
appreciated.


Ports has now a more recent expect (5.43.0), which I
use
on FreeBSD 4.11-RELEASE. I use expect to automatically
spawn
an ssh tunnel connection, which needs the password to
be fed.
No problems here.

Maybe you could upgrade expect?
And how about FreeBSD upgrade to 4.11, 5.3 or even
6.0?

Rob.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the freebsd-questions mailing list