From: Dave S. <kin...@ya...> - 2003-07-31 19:08:35
|
Hi! I really need some help, and am so glad that I've finally found this discussion group! I am using Perl and Expect to manage a simple test infrastructure at my company. Every so often a cron job fires off a Perl script. That script then executes other Perl scripts, which monitor tests via Expect. Most of those scripts start out by calling Expect->spawn("ssh"), to ssh to another machine and run/monitor their specific test. Occasionally though, Expect's spawn routine dies with one of two errors, both of which come from the Pty.pm module. I can't figure out what they mean or how to fix them though, which is driving me batty! 1) "Cannot open a pty". This comes from a failure of the pty_allocate function, in the "new" subroutine of Pty.pm. My Pty.pm is version 1.02. I cannot find the "pty_allocate" subroutine in any .pm or .pl file on my system, so I don't know why it is failing sometimes. 2) "Error: could not connect pty as controlling terminal!" I see this one more often. It is also in Pty.pm, in the make_slave_controlling_terminal subroutine. According to the code, it comes from a failure to open /dev/tty. Can anyone help me? Expect is about the only tool I can use for my testing infrastructure (that I know about at least). But these occasional failures make my infrastructure itself unreliable. I could really use some assistance. Thanks so much, Dave __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Roland G. <RGi...@cp...> - 2003-08-01 06:45:34
|
> 1) "Cannot open a pty". > This comes from a failure of the pty_allocate > function, in the "new" subroutine of Pty.pm. My Pty.pm > is version 1.02. I cannot find the "pty_allocate" > subroutine in any .pm or .pl file on my system, so I > don't know why it is failing sometimes. Looks like you ran out of ptys on your system. This can happen if you have a lot of simultanious connections to spawned commands (or a lot of windows open). You didn't say what OS you are running on, you may want to look into /dev to see how pty* there are. Or into /dev/ptmx/. Go ask a local guru. BTW, the pty_allocate() is written in C and in an .XS module... > 2) "Error: could not connect pty as controlling > terminal!" This may be related to 1) and also is very system-dependent. Maybe an OS-upgrade is in order? Oh, and I think somebody already pointed out the SSH module? Be sure to read the entry in the Expect FAQ about automating ssh. You should NOT be using Expect purely to enter passwords for login, there are better mechanisms for that... Hope this helps, Roland -- RGi...@cp... |
From: Dave S. <kin...@ya...> - 2003-08-01 17:51:44
|
I am running FreeBSD. I've also used the MAKEDEV command to make as many ptys on my machine as it can support, which is supposedly 256. I know that I am not using that many though. I am not using Expect purely for interaction with the ssh login prompt. I also need it to send commands to programs that run within the ssh shell, and to read back the output of those commands. If you know of another way to do this (besides the already mentioned Net::SSH), I'd be grateful for the info. Thanks, Dave --- Roland Giersig <RGi...@cp...> wrote: > > 1) "Cannot open a pty". > > This comes from a failure of the pty_allocate > > function, in the "new" subroutine of Pty.pm. My > Pty.pm > > is version 1.02. I cannot find the "pty_allocate" > > subroutine in any .pm or .pl file on my system, so > I > > don't know why it is failing sometimes. > > Looks like you ran out of ptys on your system. This > can happen if you > have a lot of simultanious connections to spawned > commands (or a lot of > windows open). You didn't say what OS you are > running on, you may want > to look into /dev to see how pty* there are. Or into > /dev/ptmx/. Go ask > a local guru. > > BTW, the pty_allocate() is written in C and in an > .XS module... > > > > 2) "Error: could not connect pty as controlling > > terminal!" > > This may be related to 1) and also is very > system-dependent. Maybe an > OS-upgrade is in order? > > Oh, and I think somebody already pointed out the SSH > module? Be sure to > read the entry in the Expect FAQ about automating > ssh. You should NOT be > using Expect purely to enter passwords for login, > there are better > mechanisms for that... > > Hope this helps, > > Roland > -- > RGi...@cp... > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual > Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |