LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 05-22-2008, 06:08 PM   #1
manojg
Member
 
Registered: May 2004
Posts: 78

Rep: Reputation: 15
How to kill a back-grounded job?


Hi,

I have a similar problem. A job is running in background. I tried to kill by kill -9 #jobID but it is not working. Is there any way to kill the job?

Thanks.
 
Old 05-22-2008, 06:27 PM   #2
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 16
Quote:
Originally Posted by manojg View Post
Hi,

I have a similar problem. A job is running in background. I tried to kill by kill -9 #jobID but it is not working. Is there any way to kill the job?

Thanks.
i have never heard that this is possibile. i don't believe it. if you are root and type kill -9 $PID you're sending the process a signal SIGKILL which can not be caught or ignored. the process WILL be KILLED. as normale user, however, you will only be able to kill the processes you started.

vadkutya
 
Old 05-22-2008, 07:52 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,417

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
As said above, job id != pid
The std kill cmd only works on pids.
 
Old 05-23-2008, 03:01 AM   #4
toaravind
LQ Newbie
 
Registered: May 2008
Posts: 21

Rep: Reputation: 0
Few other commands to kill a process 1) kill <PID> 2) kill -9 <PID> 3) killall <PID> 4) skill -9 <PID> 5) pkill -9 <PID>. As Chris mentioned it will work only with PID
 
Old 05-23-2008, 04:23 AM   #5
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
You can stop all jobs you can stop using
Quote:
kill -9 -1
But you should NEVER use this command if you are root!! If you do, there is a very good chance it will make your system crash in no time at all.
 
Old 05-23-2008, 03:55 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
I split your question plus the responses out of the
other thread.

And please don't dig up 4 year old corpses of threads
because they kind of match your question...



Cheers,
Tink
 
Old 05-23-2008, 04:01 PM   #7
SlowCoder
Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Fedora (Desktop), CentOS (Server), Knoppix (Diags)
Posts: 934

Rep: Reputation: 38
Quote:
Originally Posted by manojg View Post
Hi,

I have a similar problem. A job is running in background. I tried to kill by kill -9 #jobID but it is not working. Is there any way to kill the job?

Thanks.
Assuming you're confusing the job ID with the PID, you can get the PID from 'ps'.

If that's not your problem, you may have a zombie process. http://en.wikipedia.org/wiki/Zombie_process
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you start a job without getting the job number spit back out? BrianK Linux - General 5 12-13-2007 09:09 PM
Pause a Job - bring back as nohup? rizhun Linux - General 3 07-20-2006 09:45 AM
I want my KILL button back gsikora Linux - Software 1 04-24-2005 03:41 AM
Alrighty, I'm back. Again. Cron Job ... sdebiasio Linux - Newbie 9 08-05-2004 09:02 AM
how to kill a print job gsikora Linux - General 4 07-31-2003 11:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration