Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to kill SSH Defunct process

Posted on 2008-10-13
4
Medium Priority
?
4,192 Views
Last Modified: 2013-12-16
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
Comment
Question by:tkstkstks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:michofreiha
ID: 22703979
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
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 375 total points
ID: 22704486
If you can not kill a defunct process, then you have to reboot.
0
 

Author Comment

by:tkstkstks
ID: 22704620
I have almost 250 defunct process running, i don't have time to kill each one by one.
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 375 total points
ID: 22704693
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

Google Certified Professional - Cloud Architect

This course (1 of 3) is designed to help students who are interested in Google Cloud Platform (GCP) to become familiar with the platform, navigate the console and learn its capabilities. It will also prepare students for the Google Cloud Architect certification exam.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question