f



Intermittent failure on remote ssh echo command with exist status 143 (aka SIGTERM)

I use remote ssh echo command as heartbeat to probe remote server is alive. After days of running, I get an intermittent ssh exit status 143 (143 - 128 = 15 ) which is SIGTERM.

The remote echo command over ssh runs every minute using key authentication:


/usr/bin/ssh -v -o ServerAliveInterval=60 -i ~/.ssh/public-key.rsa -l foo <remote-ipaddress> echo

I am unable to recreate it in standalone script, but happens in production. Any help in this regard is appreciated.


#!/bin/bash
# secondary network interfaces: 10.0.0.1 and 10.0.0.2

if [ -z "$1" ]
then
    echo "missing required peer IP address"
    exit
fi

peeripaddr=$1

while :
do
   /usr/bin/ssh -v -o ServerAliveInterval=60 -i ~/.ssh/public-key.rsa -l foo $peeripaddr echo

   rc=$?
   if [ $rc -gt 0 ]
   then
       echo "ssh echo command has failed rc=$rc"
       exit
   fi

   echo "sleeping 5 seconds..."
   sleep 5

0
regmemail
5/17/2016 3:29:23 PM
comp.security.ssh 4228 articles. 0 followers. terra1024 (490) is leader. Post Follow

1 Replies
405 Views

Similar Articles

[PageSpeed] 8

On Tuesday, May 17, 2016 at 10:29:25 AM UTC-5, regm...@gmail.com wrote:
> I use remote ssh echo command as heartbeat to probe remote server is alive. After days of running, I get an intermittent ssh exit status 143 (143 - 128 = 15 ) which is SIGTERM.
> 
> The remote echo command over ssh runs every minute using key authentication:
> 
> 
> /usr/bin/ssh -v -o ServerAliveInterval=60 -i ~/.ssh/public-key.rsa -l foo <remote-ipaddress> echo
> 
> I am unable to recreate it in standalone script, but happens in production. Any help in this regard is appreciated.
> 
> 
> #!/bin/bash
> # secondary network interfaces: 10.0.0.1 and 10.0.0.2
> 
> if [ -z "$1" ]
> then
>     echo "missing required peer IP address"
>     exit
> fi
> 
> peeripaddr=$1
> 
> while :
> do
>    /usr/bin/ssh -v -o ServerAliveInterval=60 -i ~/.ssh/public-key.rsa -l foo $peeripaddr echo
> 
>    rc=$?
>    if [ $rc -gt 0 ]
>    then
>        echo "ssh echo command has failed rc=$rc"
>        exit
>    fi
> 
>    echo "sleeping 5 seconds..."
>    sleep 5

I am running on Linux CentOS 5.x and openssh 7.1.P2 (Both client and server)
0
sileshikassa
5/17/2016 3:31:30 PM
Reply: