Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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'm having a bit of trouble killing a process. I was using rpm to remove a package when the terminal windo froze. So I opened up a new terminal and tried to kill the rpm process but with no luck.
See what state the process is in with "ps aux ". If it's stuck in uninterruptable sleep (state D) it can't be killed, even with kill -9. I've seen this happen with corrupt RPM databases.
It is better to use kill code 15 before using kill code 9 to force the program to quit. Kill code 15 means terminate, so it is the same as hitting CTRL+C. Sending kill code 9 to a program sometimes turns it into a zombie. A zombie process will not take up resources but a reboot is the only way to get rid of it.
Some processes, you will have to terminate or kill its parent PID.
Thanks I'll remember that for next time. It's annoying when a program like rpm or yum gets zombied like this because it locks some files and the only thing I can do is reboot before I can use that program again.
Thanks I'll remember that for next time. It's annoying when a program like rpm or yum gets zombied like this because it locks some files and the only thing I can do is reboot before I can use that program again.
Zombies happen when a parent forks a child process and the child dies. The child becomes a zombie until either (1) the parent executes a wait() command on the child, or (2) the parent dies. The "parent executes a wait()" scenerio is where the somewhat morbid recommendation that "Parents should reap their dead children" comes from. The next time you zombie a process and can't seem to get rid of it, try logging off and back on again. That may kill the parent, thus freeing the zombie without a reboot. I'm not really familiar with the workings of rpm (I use Debain and dpkg/apt-get), but you can see after your first kill attempt at rpm that it looses it's controlling TTY (was "pts/1" before the kill, then "?" after the kill). I always that zombies showed up in a ps listing as "<defunct>". That's the way it's been for years on many different Unix systems I've worked with. Don't know specifically about Linux though. I haven't been using Linux all that long and haven't looked closely.
Thanks I'm going to try and reproduce it again so that I can test out the different methods of resolving it. After the first kill attempt wasn't successful I killed/closed the terminal window that had frozen, thats when the pts/1 changed to ? I was hoping at the time that killing the parent would also kill the child rpm process. It usually does but maybe this was just a freak occurence!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.