Results 1 to 10 of 10

Thread: kill zombie process's

  1. #1
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,187

    kill zombie process's

    just needed a place to put this script so i can find it easier, should i need to.
    it kills zombie process's.

    Code:
    #!/bin/sh
     kill -HUP `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'`

  2. #2
    Join Date
    Jun 2006
    Location
    Switzerland
    Beans
    Hidden!
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: kill zombie process's

    It doesn't kill them all ;(

  3. #3
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,187

    Re: kill zombie process's

    1
    Last edited by kerry_s; August 20th, 2008 at 01:37 AM.

  4. #4
    Join Date
    May 2008
    Beans
    4

    Re: kill zombie process's

    Ubuntu 8.04 sucks!!! Way too CPU intensive --
    and what the hell is a zombie shell doing on install?
    BUSTED!!!!!
    no real answers on this one - --

  5. #5
    Join Date
    Jun 2006
    Location
    Switzerland
    Beans
    Hidden!
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: kill zombie process's

    G4:
    I'm looking forward to your improved Ubuntu release/derivate

  6. #6
    Join Date
    May 2008
    Beans
    32
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: kill zombie process's

    Quote Originally Posted by kerry_s View Post
    just needed a place to put this script so i can find it easier, should i need to.
    it kills zombie process's.

    Code:
    #!/bin/sh
     kill -HUP `ps -A -ostat,ppid,pid,cmd | grep -e '^[Zz]' | awk '{print $2}'`
    Nice . . . . maybe add a couple of echo statement so everyone can see how the scripts works. Just a thought.

    You never know when a script will harm rather than hurt.
    A torn jacket is soon mended; but hard words bruise the heart of a child.
    ~ H. W. Longfellow (1807-1882)

  7. #7
    Join Date
    Jul 2006
    Location
    Here
    Beans
    11,187

    Re: kill zombie process's

    Quote Originally Posted by GhettoYhetti View Post
    Nice . . . . maybe add a couple of echo statement so everyone can see how the scripts works. Just a thought.

    You never know when a script will harm rather than hurt.
    you did notice the date? that was from way back 2007.
    i don't really come across any zombie process's these days.

  8. #8
    Join Date
    Oct 2008
    Location
    Bogotá, Colombia
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: kill zombie process's

    Quote Originally Posted by kerry_s View Post
    you did notice the date? that was from way back 2007.
    i don't really come across any zombie process's these days.

    Yes, it does.
    Ubuntu 11.04 has reported at least 3 zombie processes. Reported in here :
    https://bugs.launchpad.net/ubuntu/+s...st/+bug/753984
    and https://bugs.launchpad.net/ubuntu/+s...st/+bug/739780

  9. #9
    Join Date
    Oct 2008
    Location
    Bogotá, Colombia
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: kill zombie process's

    It seems that the problem with the script is the column in which awk works (I think the only thing it's done with awk is print though)

    Coming to my point you can first find the parent of the zombie process. Like this :

    ps -fe | grep defunct

    that will show you the zombie processes without the header: UID PID PPID C STIME TTY TIME CMD. So that the third column is the parent.

    Now you can check the children of the process with:

    ps -fe | awk '$3==2372 { print $0}'

    Where 2372 was the parent of the zombie process, or change to column $2 to check the parent name.

    If you still decide to go on you will have to kill the parent.... (also mix all the command in one line)
    Last edited by leonbravo; June 23rd, 2011 at 02:23 AM.

  10. #10
    Join Date
    May 2008
    Beans
    32
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: kill zombie process's

    Didn't mean to stir up trouble. Yes I did notice the date. I just make it a habit of placing echoes in scripts. Especially anything that does kills, removing, etc.

    I agree that zombies are a rare thing nowadays, but I came across 2 in 10.10 that I wanted to research different removal methods.

    Again I meant nothing negative in my comment. I actually used it.
    A torn jacket is soon mended; but hard words bruise the heart of a child.
    ~ H. W. Longfellow (1807-1882)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •