Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I started cvs to update the mozilla source tree when cvs hanged. I tried to kill the process by using kill and kill -9 but that failed. I also tried to kill the parent bash shell and that worked but the cvs process was still there.
I have tried all I know to kill the process including kill, kill -9 and killall -9 cvs. Any help is appreciated.
Originally posted by ech310n You have an orphaned zombie process. You could try silver bullets on it, but failing that the only way is a good old fashioned reboot :-(
How annoying Reminds me of good old fashioned win98 where you had to reboot every day.
Very true...and besides that "Rebooting is a sign of weakness"....but sometimes it has to be done. Sad but true.
In future though, it might be worth doing this...
Gradually increase the strength of your kill signals rather than going in there with the sledge hammer straight away i.e. go for kill, -3, -1, -11 (beware this will often produce a core dump), -5 and then if all that fails go for the -9. You should make sure the process is given an adequate amount of time to exit and clear up after itself before wading in with the old -9 though.
It is actually a nice idea to write a bit of a wrapper script to an alias kill to it instead of using /usr/bin/kill just to automate the process a bit. Something like this might do the trick...
#!/bin/bash
if [ $1 = "-9" ]
then
echo "Kill signal of -9 is not acceptable. Overriding."
shift
fi
for PID in $*
do
PROCESS=`ps -fp$PID | grep -v STIME`
USERID=`echo $PROCESS | awk '{print $1}'`
PROCNAME=`echo $PROCESS | awk '{print $8}'`
LIVE=`ps -fp$PID | grep -c -v STIME`
if [ $LIVE -gt 0 ]
then
echo "Killing process $PID $PROCNAME for $USERID with default signal."
/bin/kill -15 $PID
sleep 2
LIVE=0
fi
LIVE=`ps -fp$PID | grep -c -v STIME`
if [ $LIVE -gt 0 ]
then
echo "Process still alive. Upping kill signal to -3"
/bin/kill -3 $PID
sleep 2
LIVE=0
fi
LIVE=`ps -fp$PID | grep -c -v STIME`
if [ $LIVE -gt "0" ]
then
echo "Process still alive. Upping kill signal to -1"
/bin/kill -1 $PID
sleep 2
LIVE=0
fi
LIVE=`ps -fp$PID | grep -c -v STIME`
if [ $LIVE -gt "0" ]
then
echo "Process still alive. Upping kill signal to -11"
/bin/kill -11 $PID
sleep 2
LIVE=0
fi
LIVE=`ps -fp$PID | grep -c -v STIME`
if [ $LIVE -gt "0" ]
then
echo "Process still alive. Upping kill signal to -5"
/bin/kill -5 $PID
sleep 2
LIVE=0
fi
LIVE=`ps -fp$PID | grep -c -v STIME`
if [ $LIVE -gt "0" ]
then
echo "Unable to kill process."
LIVE=0
fi
echo ""
done
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.