LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 05: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, 05:27 PM   #2
vadkutya
Member
 
Registered: Apr 2008
Distribution: slackware 10.2
Posts: 117

Rep: Reputation: 17
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, 06:52 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
As said above, job id != pid
The std kill cmd only works on pids.
 
Old 05-23-2008, 02: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, 03:23 AM   #5
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
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, 02:55 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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, 03:01 PM   #7
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
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



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 08:09 PM
Pause a Job - bring back as nohup? rizhun Linux - General 3 07-20-2006 08:45 AM
I want my KILL button back gsikora Linux - Software 1 04-24-2005 02:41 AM
Alrighty, I'm back. Again. Cron Job ... sdebiasio Linux - Newbie 9 08-05-2004 08:02 AM
how to kill a print job gsikora Linux - General 4 07-31-2003 10:26 PM

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

All times are GMT -5. The time now is 02:41 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
Open Source Consulting | Domain Registration