0

I have a script that is using several ssh sessions to upload files to remote hosts. It has been working for years. For some reason recently it stopped working, because 2 of the processes die (they go defunct).

How to find out why are they dying?

Below is output from ps

root@vm-img1-en:~# ps aux | grep ssh | grep root
root      2389  0.0  0.1   4648  1048 ?        Ss   01:01   0:00 /usr/sbin/sshd
root      2517  0.0  0.3   7576  2464 ?        Ss   01:01   0:00 sshd: root@pts/0
root      2563  0.0  0.3   7576  2460 ?        Ss   01:01   0:00 sshd: root@pts/1
root      2873  0.0  0.5   8820  3828 ?        Ss   01:07   0:01 sshd: root@pts/2
root      3702  0.0  0.3   4668  2048 pts/1    S+   01:23   0:00 /usr/bin/ssh -o StrictHostKeyChecking=no -o BatchMode=yes -T -l rdamuq -p 22 vm-ss3.ba.nc
root      3713  0.1  0.7   7504  4904 pts/1    S+   01:23   0:00 /usr/bin/ssh -o StrictHostKeyChecking=no -o BatchMode=yes -T -l rdamuq -p 22 vm-ss1.fl.nc
root      3716  0.0  0.2   4648  1992 pts/1    S+   01:23   0:00 /usr/bin/ssh -o StrictHostKeyChecking=no -o BatchMode=yes -T -l rdamuq -p 22 vm-ss1.ba.nc
root      3717  0.0  0.2   4532  1984 pts/1    S+   01:23   0:00 /usr/bin/ssh -o StrictHostKeyChecking=no -o BatchMode=yes -T -l rdamuq -p 22 vm-img1-skbg.sf.nc
root      3728  0.0  0.2   4532  1984 pts/1    S+   01:23   0:00 /usr/bin/ssh -o StrictHostKeyChecking=no -o BatchMode=yes -T -l rdamuq -p 22 vm-img1.ow.nc
root      3733  0.0  0.2   4652  1992 pts/1    S+   01:23   0:00 /usr/bin/ssh -o StrictHostKeyChecking=no -o BatchMode=yes -T -l rdamuq -p 22 vm-ss2.ba.nc
root      3744  0.0  0.2   4536  1984 pts/1    S+   01:23   0:00 /usr/bin/ssh -o StrictHostKeyChecking=no -o BatchMode=yes -T -l rdamuq -p 22 vm-ss1.fr.nc
root      3749  0.0  0.0      0     0 pts/1    Z+   01:23   0:00 [ssh] <defunct>
root      3750  0.0  0.0      0     0 pts/1    Z+   01:23   0:00 [ssh] <defunct>
root      3751  0.0  0.2   4532  1984 pts/1    S+   01:23   0:00 /usr/bin/ssh -o StrictHostKeyChecking=no -o BatchMode=yes -T -l rdamuq -p 22 vm-img1.su.nc
5
  • I notice that all the surviving ssh processes are to different hosts. What hosts were the two defunct ones to? Is there any chance they're just dying of natural causes, and going zombie because their parent's no longer around? – MadHatter Feb 4 '15 at 9:33
  • run them under the script command, each to a different file, to see what is happening – Skaperen Feb 4 '15 at 10:43
  • @Skaperen well the thing is I have to reverse engineer that script. I had the same idea initially. – Radoslav Stefanov Feb 4 '15 at 21:11
  • @MadHatter I don't think this is the problem. Process that is starting all the SSH processes is up. Or you mean parent of those SSH processes that are defunct? – Radoslav Stefanov Feb 4 '15 at 21:14
  • Not all the extant ssh -o Strict... processes have the same PPID, so yes, I meant the PPID of the zombies. – MadHatter Feb 4 '15 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.