Re: expect + telnet hangs on AIX



Don Libes <libes@xxxxxxxx> wrote in message news:<s6afyxxe0vx.fsf@xxxxxxxxxxxxxxxxxx>...
> kkivi@xxxxxxxxxx (Konstantin Kivi) writes:
>
> > >
> > > Use autoexpect <URL: http://wiki.tcl.tk/autoexpect >.
> > > It's ideal help in such situations.
> >
> > Unfortunataly, it hangs too, after writing that script.exp is
> > created.
> >
> > It's interesting that ps doesn't show any 'expect' instances,
> > only 'sh'. When I kill 'sh' the session is still hanging. I have
> > to kill ssh client from my cleint maachine.
>
> Your description is too vague. Let's start over - can you get Expect
> to interact with any program properly? Is it only telnet that
> misbehaves? Is it only telnet to a particular host that misbehaves?
> And what versions of Expect and AIX are you using?
>
> Don


Don,

AIX version is 5.3

[grs1]/grs1/home/tst > expect -v
expect version 5.43.0
[grs1]/grs1/home/tst >
[grs1]/grs1/home/tst > ldd `which expect`
/usr/local/bin/expect needs:
/usr/lib/libc.a(shr.o)
/usr/local/lib/libtcl8.4.so
/unix
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libdl.a(shr.o)
[grs1]/grs1/home/tst >

here is sample client
==============================
#!/bin/sh

echo ==
while read aaa ; do
if [ "$aaa" = "quit" ] ; then
exit 1;
fi
echo $aaa $aaa
echo ==
done
===========================

here is sample script
========================
spawn exp.sh

expect "==" { sleep .1 ; send "bbb\r" }
expect "==" { sleep .1 ; send "quit\r" }
======================================
This script hangs 80% of the time

When running expect -d it never hangs


If I add
puts "bye"
at the end of samle script it hangs 25 % times

If I run it with nohup it never hangs.


Sincerely yours, Konstantin Kivi <konst at sirena2000.ru>
.



Relevant Pages

  • Re: Script hangs, but only one one machine
    ... The following test-script hangs for around 15 second at two steps. ... The script hangs around 15 seconds after "Setze Umgebungsvariable" and another 15 seconds after "Starte wscript.network zum Setzen des ... "in a timely manner" (even if that program has not asked for the notification), your script hangs until the notification times out. ...
    (microsoft.public.scripting.wsh)
  • Re: expect + telnet hangs on AIX
    ... Is it only telnet to a particular host that misbehaves? ... >> This script hangs 80% of the time ... >> When running expect -d it never hangs ... 'close stdout ' ...
    (comp.lang.tcl)
  • Re: ExecQuery hangs whole script but GetObject is fine
    ... Please can you write a small script that attempts this ExecQuery, ... ensure it hangs three times on the rogue machine and works three times ... > executing the query and the query hangs and thus the whole script ... > of the DCs as a domain admin but in the scheduled task that the script ...
    (microsoft.public.win32.programmer.wmi)
  • Re: T2000 wont shutdown
    ... few scripts later S91afbinit hangs. ... Killing that, and then S91zuluinit hangs. ... last one that's responsible for the script still running. ... Now it won't boot :-( A boot -s doesn't work either, ...
    (comp.unix.solaris)
  • Re: ActiveX task hangs in DTS
    ... it hangs when its executed manually and if scheduled. ... the script is simple, see below: ... > Which version of SQL Server and what service pack? ...
    (microsoft.public.sqlserver.dts)