Expect Issue Serial Forground Execution vs Concurrent Background Execution

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Expect Issue Serial Forground Execution vs Concurrent Background Execution
# 1  
Old 09-14-2009
Expect Issue Serial Forground Execution vs Concurrent Background Execution

I have an expect script that interrogates several hundred unix servers for both access and directories therein using "ssh user@host ls -l /path". The combination of host/path are unique but the host may be interrogated multiple times if there are multiple paths to test.

The expect script is run from a wrapper script that reads thru a file containing the host/path pairs. When I spawn off the expect script in the background without waiting for completion the result are, in some cases, quite different from when the expect script is run one at a time.

The error encountered when spawning off many expect scripts is "ssh_exchange_identification: Connection closed by remote host" which never happens when the expect script is run sequentially with implied wait.

Is the problem that a given server is being hit too fast with multiple ssh connection attempts or something else?

Any and all thoughts appreciated.

# 2  
Old 09-14-2009
You may well be right, but it's easy to test...try putting some sleeps in your script, and also use send_slow to send text at more like user typing speed.
Do you have a limit on the number of connections that you can connect to on any specific remote host, so it disconnected those it doesn't want?
# 3  
Old 09-14-2009
Are there more than 10 directories on one host, or possibly other users using SSH, or sitting on an open connection? (I'm guilty of leaving ssh bash shells open for days; others probably are too.)

The config file has parameters MaxSessions and MaxStartups that could be affecting you. Especially if someone lowered their default values of 10 in /etc/ssh/sshd_config.

See man sshd_config.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

EXPECT | Shutdown MITEL by Serial.

Hi everybody, I'm from Spain so excuse my english. I'm Trying to Shutdown the Mitel 3300 CXI by serial port. I'm trying to do this with the EXPECT software. The problem is: The connection is done. The "shutdown" is done BUT the Mitel auto-boot if the script does not type... (0 Replies)
Discussion started by: Jonsaldana
0 Replies

2. Shell Programming and Scripting

Python Thread Execution Issue . . .

Greetings! I set up a basic threading specimen which does the job:#!/usr/bin/python import threading class a(threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): print("thread a finished") class b(threading.Thread): ... (0 Replies)
Discussion started by: LinQ
0 Replies

3. Shell Programming and Scripting

Expect script Execution Problems .. Help!!!

Hi Guys, I am writing the expect script which take input from the txt file and check whether that file is present over the Sftp or not.If yes then delete other wise check the next one.. I am able to do comparison online for single file... Please also note still i didn't try to implement... (1 Reply)
Discussion started by: hackerdilli
1 Replies

4. Shell Programming and Scripting

Multiple Interval cron issue with order of execution

55,0 5,6 * * * myScript This cron task will execute on 5:00AM, 5:55AM, 6:00AM and 6:55AM. Is there any possibility to make it run only in the order specified such as 5:55AM and 6:00AM (basically only on the 2 intervals) ? (1 Reply)
Discussion started by: vikram3.r
1 Replies

5. Shell Programming and Scripting

Concurrent execution

Hi all, I have a folder with sql files that need to be inserted in a DB with SQL*Plus. The thing is that it takes too long to insert them all one by one, so I want to insert them five at a time. Currently what I use is this: for $FILENAME in *.sql do sqlplus -s $DBUSER@$SID << EOF ... (0 Replies)
Discussion started by: Tr0cken
0 Replies

6. Shell Programming and Scripting

Execution issue with shell script - works in a different environment

Hi I get the following error while executing the shell script. I did not get an error when I ran the script in a different environment (unix server). str-token.ksh: 0403-057 Syntax error at line 20 : `(' is not expected. This is the line which gives error string=(${pos_array}) Please find... (3 Replies)
Discussion started by: hidnana
3 Replies

7. UNIX for Dummies Questions & Answers

Profile execution issue

Hi I have a profile execution issue, I log on to a linux machine , then i do sudo to another user as sudo su - <username> , then <username> .profile executes properly but when I type something I loose all environment varaible and my prompt changes to '$' loosing the PS1 value that I have... (1 Reply)
Discussion started by: malavm
1 Replies

8. Shell Programming and Scripting

Background execution of a script

Hi All, Have a script called FTPIN-xx.sh. It does stuff and when all is done, it is to execute another. However, I'd like to have it execute the second script in the background or in a fashion that would allow my script to complete without having to wait. I'm robbing the command from how I... (2 Replies)
Discussion started by: Cameron
2 Replies

9. UNIX for Dummies Questions & Answers

execution without using (./)

I want to execute a shell script without ./ symbol. For example: ./my_script ===== my_script (both of them can execute my script) both of them are the same as result. (2 Replies)
Discussion started by: mehmetned
2 Replies

10. Programming

execution in background

hey im having trouble understanding how to execute commands in the background. i did some research and saw that you only have to fork and not wait for the child to finish. in another case you have to change the process group. i ve really tried both of them but i just cant get them to work. ... (0 Replies)
Discussion started by: mile1982
0 Replies
Login or Register to Ask a Question