Bug 39178 - Telnet to local host is inconsistant
Telnet to local host is inconsistant
Product: Red Hat Linux
Classification: Retired
Component: telnet (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-05-04 22:36 EDT by Need Real Name
Modified: 2007-04-18 12:33 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-08-05 04:17:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-05-04 22:36:46 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (Windows NT 5.0; U)

Description of problem:
Linux 7.0 is not responding to a local telnet session consistantly.
I run the following script and get various reactions:
1 is to hang after login waiting for a prompt to be returned.
2. It runs to completion without a problem.
I'm running the stock perl shipped with 7.0 and Net::Telnet from CPAN.
I run the follwing script:
use Net::Telnet ();
$controller - 'linux.strings.com';
@respstring = remotex($controller,$cmd);
print @respstring;
sub remotex
$dump_log = "/tmp/dump_log";
$input_log = "/tmp/input_log";
$output_log = "/tmp/output_log";

my $username = "davidk";
my $password = "asdfghj";
my ($host,$command) = @_;
print("host=$host, command=$command\n");

my $tel = new Net::Telnet ( Host => $host,
Dump_log => $dump_log,
Input_log => $input_log,
Output_log => $output_log,
Timeout => 300,
Prompt => '/\{CDSQA\] /');
#Prompt => '/bash-2.04\$/');
#Prompt => '/tcsh /');

$tel -> login($username, $password);
my @result = $tel -> cmd($command);
return @result;
I might have made a typo but it works. 
If I set the prompt to [CDSQA] with bash shell it does not work - occasionally does - same with the other settings I'll mention - for bash.2-04 
(I'm too tired to check but the bash is the same as the one returned from csh.cshrc.  For the tcsh  prompt I modified the csh.cshrc to change 
prompt to tcsh  if the tcsh is users shell.
   These would not work consistantly when telneting to my own local host.  Even to other hosts its inconsistant but very much inconsistant - 
mostly does not work on the local lhost.  
    I thought that the /etc/csh.cshrc when I used bash was screwing things up so I experimented with setting the prompt there but it did not 
consistantly.  The underneath mechanics seem to want to set the prompt on a local login to bash-2.04 ~$.  The best working combination I 
could get was to set the user shell to tcsh and modify the /etc/csh.cshrc to set the prompt to tcsh  .  That worked the best for a local login but 
would still sometimes fail.  
I could not find a simmilar bug after a number of searches.

How reproducible:

Steps to Reproduce:
1. run bash shell
2. Keep /etc/csh.cshrc as usual
3. run script
4. ? I run the script as root but login with a non-priv user davidk, asdfghj but this does not matter. I get the same behavior regardless of the 
that runs the script priv or non-priv.
5. -later, modify csh.cshrc to give a simple consistant prompt like tcsh  .  Better but still inconsistant. 
6. I have not been able to do anything to make this consistant.

Actual Results:  I get timed out waiting for prompt.

Expected Results:  Should run the ls command - does inconsistantly

Additional info:

For Reproducibility - its very reproducable.

I'm having this problem 4 linux 7.0 systems at work.  We run our app and nothing else.  When I run the script its the only thing running other 
than system processes.  On my home linux system which is very clean I get the same results.
Comment 1 Need Real Name 2001-05-07 21:28:39 EDT
   All the shell items mentioned above are misleading - sorry.  I never knew about /etc/csh.cshrc and got confused.  So that aside and the prompts 
running properly in bash or tcsh the inconsistancy still exists.  
   If I run with Dump_log setup there are 3 things that happen.
1. user name goes to the remote - password: is not seen comming back.
2. user name goes to the remote - wassword: is sent back - the prompt is not sent.
3. Runs correctly.
If I run the same script on solaris with Perl 5.005 it runs correctly all the time.  
If I run the same script on solaris to linux it runs correctly.
If I run from linux to solaris it runs correctly.
If I run from linux to another linux machine its inconsistant.
If I run from linux to the same linux machine its inconsistant.
The timeout happens in the sub waitfor in Telnet.pm
Comment 2 David Kirkpatrick 2001-05-09 13:00:37 EDT
I think the problem is Linux not responding fast enough to requests.  If I pad the Telnet.pm with sleeps between login/waitfor and password/waitfor the 
script performs well.  The results are still under test but so far I have had a run of 100 times in a row where it did not hang and executed correctly.  
Solaris can handle this and linux should also.  Again this happens between linux machines  - either one machine accessing itself or one linux machine to 
Comment 3 Pekka Savola 2001-09-06 03:39:09 EDT
Linux box might be doing reverse-DNS lookups or ident-queries.  If there are
with either of these on the connecting box, it might take a while?  Or do the
waits happen
after these have already been done?

Note You need to log in before you can comment on or make changes to this bug.