SSH scripts hanging

From: irish1028 (irish1028@keltic.org)
Date: 04/02/03

  • Next message: Len Zaifman: "Re: compile problems IRIX openssh-3.6p1"
    From: irish1028@keltic.org (irish1028)
    Date: 2 Apr 2003 07:14:52 -0800
    
    

    I have been having a a problem recently with a script set to SSH into
    a snort sensor and stop-snort--->retrieve logs--->delete logs. I have
    four sensors three of which are running Redhat 7.2. The 7.2 sensors
    are running openssh 2.9p2. We have been running one sensor on Redhat
    8.0 openssh version 3.1p1. When the script is executed everything
    terminates properly except the Redhat 8.0 sensor. After we run the
    script there is still an ssh process on the client and on the sensor
    itself the daemon process has not terminated. The script executes fine
    but at the end of the day I have 60+ orphaned processes. I have read
    miscellanous information about this problem being a feature...not a
    bug. I will include the portion of the script below. Can anyone help
    me handle this better? I have tried many little fixes such as shopt -s
    huponexit etc...
    Thanks very much.

    echo "Removing Log files from Sensor 1 and Sensor 2"
    ssh idssensor1.null.com rm -f /var/snort/sensor1/snort0.log
    /var/snort/sensor1/portscan0.log /var/snort/sensor2/snort0.log
    /var/snort/sensor2/portscan0.log < /dev/null >& /dev/null &
    echo "Done...."
    echo "Removing Log files from Sensor 3"
    ssh idssensor2.null.com rm -f /var/snort/sensor3/snort0.log
    /var/snort/sensor3/portscan0.log < /dev/null >& /dev/null &
    echo "Done...."
    echo "Removing Log files from Sensor 4 and Sensor 5"
    ssh idssensor4.null.com rm -f /var/snort/sensor4/snort0.log
    /var/snort/sensor4/portscan0.log /var/snort/sensor5/snort0.log
    /var/snort/sensor5/portscan0.log < /dev/null >& /dev/null &
    echo "Done...."

    When I do a ps -ef

    below is the result.

    root 1392 1391 0 09:22 tty1 00:00:00 -bash
    root 1627 1 0 09:45 ? 00:00:00 ssh
    idssensor4.null.com rm -f /var/snort/sensor4/snort0.log
    /var/snort/sens
    root 1760 628 0 10:11 ? 00:00:00 /usr/sbin/sshd
    root 1761 1760 0 10:11 pts/0 00:00:00 -bash
    root 1816 1761 0 10:13 pts/0 00:00:00 ps -ef


  • Next message: Len Zaifman: "Re: compile problems IRIX openssh-3.6p1"

    Relevant Pages

    • Re: temperature (OUTPUT)
      ... When I run the script, I see a temperature of 37 degrees on hdisk0 ... Sensor = thermal sensor ... echo "ENVSTATUS $MM" ...
      (AIX-L)
    • Re: temperature (OUTPUT)
      ... When I run the script, I see a temperature of 37 degrees on hdisk0 ... Sensor = thermal sensor ... echo "ENVSTATUS $MM" ...
      (AIX-L)
    • Re: Send commands to ssh
      ... can i also echo a script? ... Everything ssh reads from STDIN gets executed line by line on the remote ...
      (comp.os.linux.misc)
    • Re: Send commands to ssh
      ... can i also echo a script? ... ssh reads commands from STDIN: ...
      (comp.os.linux.misc)
    • gfb: help with ssh script
      ... I am trying to run a simple script that would log into the host specified in ... then run a few commands to collect the information. ... do echo $i ... It seems it initially echos each line in 'list', but then proceeds to ssh ...
      (SunManagers)