LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-13-2003, 12:48 AM   #1
KendersPlace
Member
 
Registered: Feb 2003
Location: Phoenix, AZ - USA
Distribution: RedHat 8, Micro$haft
Posts: 33

Rep: Reputation: 15
Question Setting and killing processes?


Two questions please...

1.
How can I kill a process using it's name, vise it's process ID? If I have five instances of "myscript" running, I'd like to kill all of them using their name and not the idividual PIDs as I can't see any other way to do it.

2.
Can I specify a parameter in a bash script that will always give it the same process ID ever time it is run (and possibly die out if a process w/ that ID is already running). I'd like to set my bash script to always have PID 20000 or something.

Thanks in advance!!
 
Old 03-13-2003, 06:09 AM   #2
amit_rb
LQ Newbie
 
Registered: Mar 2003
Posts: 5

Rep: Reputation: 0
In case of problem 1, try
killall myscript
This gracefully kills all myscript instances.
Enjoy !!! Penguin
 
Old 03-13-2003, 07:32 AM   #3
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
2) no, you can't , PIDs are generated by the kernel when a process is started and PID numbers cannot be selected by a user process
 
Old 03-15-2003, 08:37 PM   #4
KendersPlace
Member
 
Registered: Feb 2003
Location: Phoenix, AZ - USA
Distribution: RedHat 8, Micro$haft
Posts: 33

Original Poster
Rep: Reputation: 15
Very helpful to my problem. Thank you very much for your help.

-K
 
  


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
Killing running processes hitest SUSE / openSUSE 4 09-03-2005 03:22 PM
Killing processes hongman Linux - Newbie 3 02-28-2005 06:27 PM
killing all of a user's processes thebeaglebeagle Linux - Software 1 09-04-2003 12:33 PM
killing processes adriaanbw Linux - Software 3 05-24-2003 11:46 PM
Vm: Killing Processes tbhebe Linux - General 3 03-07-2002 10:51 AM


All times are GMT -5. The time now is 01:48 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