Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4369
  • Last Modified:

How to kill SSH Defunct process

Hi All,

Currently we have issues with defunct processes. These defunct processes slows down the performance of the database servers. I know defunct can be killed by either rebooting the server or kill the parent process. My problem is as this is a database server, we have some processes related to database too running as defunct.

My request is to kill only SSH defunct processes. Do we any script to do so.

Kindly assist.

Cheers,
Bull
0
tkstkstks
Asked:
tkstkstks
  • 2
2 Solutions
 
michofreihaCommented:
I  advice to list them all first and them kill them one by one
to list all SSh processes:

ps -aux | grep SSH

You'll get the PID of each one and kill them one by one

kill -9 PID
0
 
omarfaridCommented:
If you can not kill a defunct process, then you have to reboot.
0
 
tkstkstksAuthor Commented:
I have almost 250 defunct process running, i don't have time to kill each one by one.
0
 
omarfaridCommented:
can you reboot?

try

ps -ef | grep defunct | grep -v grep | awk ' { print $2 } ' | while read pid
do
  kill -9 $pid
done
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now