Find the answer to your Linux question:
Results 1 to 3 of 3
Hi all! I was wondering if there is a command in order to kill a user-space process regarding its PID number. Thanks!...
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    6

    How to kill a user space process

    Hi all!

    I was wondering if there is a command in order to kill a user-space process regarding its PID number.

    Thanks!

  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    658
    The command you are after is "kill"

    Code:
    chris@angua:~$ sleep 60 &
    [1] 9659
    chris@angua:~$ ps
      PID TTY          TIME CMD
     9583 pts/1    00:00:00 bash
     9659 pts/1    00:00:00 sleep
     9660 pts/1    00:00:00 ps
    chris@angua:~$ kill 9659
    chris@angua:~$
    [1]+  Terminated              sleep 60
    This quick demo creates a long running sleep process (ok, 60 seconds, but close enough) and runs it in the background. Then, while it is running, it is killed by using it's PID. The last line is the background process reporting that it has completed and giving the reason.

    If the process does not respond to a simple kill command then you can use "kill -9", however this is not recommended unless it is the only option because it does not give the command a chance to clean up what it was working on.

    I think you can only kill your own processes unless you are root. The permissions may be more complex than that, but I've not really looked into it.

    Let us know how you get on,

    Chris...
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

  3. #3
    Just Joined!
    Join Date
    Jul 2008
    Posts
    6
    Thank for your reply!

    I have tried to use "kill <PID>" or "kill -9 <PID>" but nothing happened.

    I should notice at this point that I am using Linux on an embedded board.

    Here are the running processes using the 'top' command:

    Code:
      PID USER   STATUS     RSS  PPID &#37;CPU %MEM COMMAND
        2 root     RWN        0     1 99.2  0.0 ksoftirqd/0
      269 root     R        388   255  0.5  1.3 top
        3 root     SW<        0     1  0.1  0.0 events/0
      255 root     S        420     1  0.0  1.4 sh
        1 root     S        348     0  0.0  1.2 init
      250 root     S        320     1  0.0  1.1 inetd
      246 root     S        312     1  0.0  1.0 udhcpc
      227 root     S        300     1  0.0  1.0 syslogd
      253 root     S        292     1  0.0  1.0 crond
      230 root     S        260     1  0.0  0.8 klogd
        4 root     SW<        0     1  0.0  0.0 khelper
       49 root     SW<        0     5  0.0  0.0 kseriod
       61 root     SW         0     5  0.0  0.0 pdflush
       62 root     SW         0     5  0.0  0.0 pdflush
       63 root     SW<        0     5  0.0  0.0 kswapd0
       64 root     SW<        0     5  0.0  0.0 aio/0
      159 root     SW         0     1  0.0  0.0 mtdblockd
        5 root     SW<        0     1  0.0  0.0 kthread
       44 root     SW<        0     5  0.0  0.0 kblockd/0
       47 root     SW<        0     5  0.0  0.0 khubd
    My main purpose is to kill the "ksoftirq/0" process which spends more than 99% of the CPU load.

    I read somewhere that this is a Linux kernel soft IRQ process and that high softirq loads can totally kill userland.
    That's sounds reasonable to me because a process that uses more than 99% of the CPU doesn't leave any load for other processes to run.

    Any help or suggestion would be more than welcomed.
    Thank you.

Posting Permissions

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