sshd with zombie process on FreeBSD 10.0-STABLE - workaround

Marcelo Gondim gondim at bsdinfo.com.br
Thu Mar 20 19:53:48 UTC 2014


Em 20/03/14 11:58, John Baldwin escreveu:
> On Wednesday, March 19, 2014 1:47:10 pm Marcelo Gondim wrote:
>> Em 19/03/14 13:01, Kevin Oberman escreveu:
>>> On Wed, Mar 19, 2014 at 6:00 AM, Marcelo Gondim
> <gondim at bsdinfo.com.br>wrote:
>>>> Hi all,
>>>>
>>>> While the solution does not appear, did the script below and put it in
>>>> crontab to automatically delete zombie sshd processes.
>>>>
>>>> the_walking_dead.sh:
>>>>
>>>> #!/bin/sh
>>>> kill -9 `ps afx|grep sshd|grep unknown|awk '{print $1}'`
>>>>
>>>>
>>>> Put this in /etc/crontab:
>>>>
>>>> 00 1 * * *    root    the_walking_dead.sh
>>>>
>>>>
>>> If 'kill -9' works, the process is not really a zombie. It simply still
> has
>>> a socket open and is waiting for it to be closed before exiting.
>>>
>>> You might takes a look at network sockets with sockstat(1) and see if you
>>> can get any indication of why these sockets are not being closed. It may
> be
>>> that the issue is not sshd but some other issue in the OS leaving sockets
>>> open.
>>>
>> Hi Kevin,
>>
>> My ps -afx below:
>>
>> [...]
>> 42139  -  Is       0:00.01 sshd: unknown [priv] (sshd)
>> 42140  -  Z        0:00.01 <defunct>
>> 42141  -  IW       0:00.00 sshd: unknown [pam] (sshd)
>> 58445  -  Is       0:00.01 sshd: unknown [priv] (sshd)
>> 58446  -  Z        0:00.02 <defunct>
>> 58447  -  IW       0:00.00 sshd: unknown [pam] (sshd)
>> 65635  -  Is       0:00.01 sshd: vinicius [priv] (sshd)
>> 65636  -  Z        0:00.01 <defunct>
>> [...]
>>
>> # sockstat | grep 42140
>> #
>>
>> # sockstat | grep 58446
>> #
>>
>> # sockstat | grep 65636
>> #
>>
>> No associated socket with zombie process.
> Do a pstree.  I bet the zombies are children of the other processes that
> are stuck on a socket as Kevin described.
>
Hi John,

My pstree with 8 zombie process: 
http://i125.photobucket.com/albums/p50/Marcelo_Gondim/ps_zps6f6d8330.png
I can not identify the problem with the pstree. Identified that the 
zombie processes are related to the sshd process.
I had 4 servers that ran 9.xand did not have this problem. When I 
upgraded these servers for 10.0, these problems happened.




More information about the freebsd-stable mailing list