Dead SSH Connections from script

From: Richard Hobbs (richard.hobbs_at_crl.toshiba.co.uk)
Date: 07/19/04

  • Next message: MKlinke: "Re: Spamassassin milter modifying message body"
    To: "'General Red Hat Linux discussion list'" <redhat-list@redhat.com>
    Date: Mon, 19 Jul 2004 17:26:06 +0100
    
    

    Hello,

    This script is causing problems... for some reason it keeps leaving dead SSH
    connections around, which actually caused the server to run out of file
    handles, reporting (too many open files).

    Is there something wrong with the script??

    Thanks in advance to anyone who can help, here's the script:

    ======================================================================
    #!/bin/csh -f

    set NPARAMS = 1
    if ($#argv != $NPARAMS) then
            echo "Usage: $0 <list of automount hosts>"
            exit 1
    endif
    set HOSTLIST = $1
    shift
    set P1 = $1
    set P2 = $2

    set FILENAME=/project2/remote/automountresults`date "+%Y%m%d%H%M%S"`.txt
    echo Automount auto.rmt results > $FILENAME
    foreach host (`cat $HOSTLIST`)
            echo $host
            echo $host >> $FILENAME
            /usr/bin/scp /project2/remote/auto.rmt $host":/tmp/"
            /usr/bin/scp /project2/remote/automountconfig $host":/tmp/"
            /usr/bin/ssh root@$host /tmp/automountconfig >> $FILENAME
    end
    ======================================================================

    Thanks,
    Hobbs.

    --
    Richard Hobbs (Systems Administrator)
    Toshiba Research Europe Ltd. - Speech Technology Group
    Web: http://www.toshiba-europe.com/research/
    Email: richard.hobbs@crl.toshiba.co.uk
    Tel: +44 1223 376940        Mobile: +44 7811 803377
    http://unixforum.co.uk  http://hififorum.co.uk
    _____________________________________________________________________
    This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com
    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: MKlinke: "Re: Spamassassin milter modifying message body"

    Relevant Pages

    • Re: Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
      (perl.beginners)
    • Re: Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script Runs perfectly fine from the command prompt. ... # This is the main Apache HTTP server configuration file. ... LoadModule actions_module modules/mod_actions.so ...
      (perl.beginners)
    • Same Internal Server Error from last two days
      ... I am trying to run a Hello World Perl Script in Apache 2.2. ... But its constantly giving me Internal Server Error.The script ... # have to place corresponding `LoadModule' lines at this location so the ...
      (perl.beginners)
    • Re: Regarding a selection for mobile code/scripting language
      ... Client Side scripting, so the server can send script commands to the client. ... I decided they should be scripted and mobile code. ...
      (Vuln-Dev)
    • Re: HTTPSConnection script fails, but only on some servers (long)
      ... (HTTP/CONNECT + switch to HTTPS) ... wget and my python script. ... >>The python script works with server A, ... the problem seems to depend on both the client ...
      (comp.lang.python)