- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Expect "spawn" command hangs
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
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
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
11-18-2013 07:15 AM
11-18-2013 07:15 AM
Expect "spawn" command hangs
Expect version 5.45
All dependencies for Expect loaded properly.
I have just loaded expect and eventually want to use it connect to an sFTP server that I do not manage. The vendor who manages the sFTP server uses only password authentication, not key exchange.
I've tested a simple script (see below) and will expand on it when I get it to work.
Manually connecting to the sFTP server works fine.
When running the Expect script, it hangs at the spawn command until I issue a control C, which of course also terminates the program. I have tested this with several spawned commands including telnet, and ksh. It doesn't seem to matter what it tries to spawn, it still hangs.
I have googled this issue and found only two similar issues, one was related to a bug in Cygwin, the other was resolved by spawning a ksh shell and then using "send" to send a telnet command. But the Cygwin bug does not apply to HPUX and spawning a shell results in the same problem.
I suspect an HPUX bug, but can't confirm that and don't know what to do if it is.
Any help would be greatly appreciated.
Here is the basic script (user name, password, and server redacted):
#!/usr/local/bin/expect -d
spawn "user@server.com"
expect "password:"
send "password\n"
expect "sftp>"
send "mget *.* \r"
expect "sftp>"
send "quit \r
And here is the debug:
expect version 5.45
argv[0] = /usr/local/bin/expect argv[1] = -d argv[2] = ./sftptest
set argc 0
set argv0 "./sftptest"
set argv ""
executing commands from command file ./sftptest
spawn sftp user@server.com
parent: waiting for sync byte
<----- Hangs here forever until I issue Control C
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {9247}
sighandler: handling signal(2)
async event handler: Tcl_Eval(exit 130)
--------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2013 08:24 AM
11-20-2013 08:24 AM
Re: Expect "spawn" command hangs
We too have suffered the same issue (HP-UX 11.31, expect 5.45, tcltk 8.5.15) - "expect spawn sftp..." hangs!
Investigation of the probem lead us to beleive the issue is with tcl (expect calls tcl to accomplish various tasks) because if you try to run an external command in the tcl shell (tclsh) then the comman does not execute, it hangs as per the expect spawn symptoms.
eg tclsh % ls <--- hangs
Also we have a server running HP-UX 11.31, expect 5.45, tcltk 8.5.8 and this combination does not suffer from the problem - expect spawn and tclsh external commands all run as expected.
So on the problem server we removed tcltk 8.5.15 and installed 8.5.8.
Our expect scripts now execute as expected.
So what version of tcltk are you running? If tcltk 8.5.15, can you install an older version?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2013 08:31 AM
11-20-2013 08:31 AM
Re: Expect "spawn" command hangs
We are in fact running tcl 8.5.15.
Thanks! I will try to load an earlier version. I will let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2013 08:34 AM
11-20-2013 08:34 AM
Re: Expect "spawn" command hangs
The HP porting site only seems to have 8.5.15.
I prefer the depot package instead of trying to build it.
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2013 02:26 PM
11-20-2013 02:26 PM
Re: Expect "spawn" command hangs
Thanks again!
I was unable to locat a depot file for tcl 8.5.8, but I was able to download, configure, and install 8.5.8 from the source code. I had to rename some files (tclsh8.5 was renamed tclsh, and was libtcl8.5.so to libtcl.so and a couple other girations...) but all is working now.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2014 02:39 AM
02-14-2014 02:39 AM
Re: Expect "spawn" command hangs
Hi John,
I am also facing same problem for expect...
(HP-UX 11.31, expect 5.45, tcltk 8.5.15 and all dependencies for tcltk installed ) - "expect spawn sftp..." hangs!
Please can you let me know in detail how you got the tcltk 8.5.8 source code working on HP-UX 11.31. As when i tried to
build TK 8.5.8 getting error as below, But i have successfully build the TCL 8.5.8.
100 errors detected in the compilation of "/tmp/tcltk-8.5.8-src/unix/../generic/tk3d.c".
Compilation terminated.
*** Error exit code 4
Thanks,
Narendra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2014 10:16 AM
02-16-2014 10:16 AM
Re: Expect "spawn" command hangs
Hello Narendra,
I did not have any issues compiling tcl8.5.8.
Make sure that you have all the dependencies loaded properly.
I just downloaded the source and ran "configure", "make", and "make install".
After the compile, I did have to rename some files for expect to work properly.
/usr/local/bin/tclsh8.5 -->tclsh
/usr/local/lib/libtcl8.5.so --> libtcl.so
Had to copy libtcl.so to /usr/lib/hpux32
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2014 11:07 PM
07-21-2014 11:07 PM
Re: Expect "spawn" command hangs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2014 12:56 PM
07-22-2014 12:56 PM
Re: Expect "spawn" command hangs
No. I had to download and compile it.
You should be able to google "download tcl 8.5.8" and find it. It will have to be built and compiled, though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2016 05:48 AM
02-26-2016 05:48 AM
Re: Expect "spawn" command hangs
I know it is an old post, but installing the tcl/tk 8.5.19 seems to resolve the problem as well,
On some systems it still might cause a coredump, but this is due to a bug which is resolved by renaming /usr/local/lib/history.tcl