LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-04-2012, 06:06 AM   #1
linux833
Member
 
Registered: Jul 2011
Posts: 40

Rep: Reputation: Disabled
Can application stick with same PID once running.


Hello friends,
i have application that i run time to time and need to get same
PID each time it's running. the reason of that it take full CPU and i have to run cpulimit each time and found the PID.

is it possible to configure system to give this application same PID each time it's running.

thanks alot.


linux833.
 
Old 09-04-2012, 06:09 AM   #2
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,722

Rep: Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261
no, it is not possible. You need another solution. The usual way is to store the actual pid in a file (when you start the process) and use that file to identify the process. (or you can use pgrep)
 
1 members found this post helpful.
Old 09-04-2012, 06:21 AM   #3
linux833
Member
 
Registered: Jul 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
no, it is not possible. You need another solution. The usual way is to store the actual pid in a file (when you start the process) and use that file to identify the process. (or you can use pgrep)
Thanks pan64 for your reply,
so, is there automated way to do it instead of each time, as you mention.
could you please guide me for that.

your help is appreciated.

linux833.
 
Old 09-04-2012, 06:41 AM   #4
pan64
Senior Member
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,722

Rep: Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261Reputation: 1261
see for example daemon
 
Old 09-04-2012, 06:58 AM   #5
linux833
Member
 
Registered: Jul 2011
Posts: 40

Original Poster
Rep: Reputation: Disabled
thanks pan64 for your help, i will try to get script to pgrep and execute cpulimit.

thanks again.

linux833
 
Old 09-04-2012, 09:17 AM   #6
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,377

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
Often it is a good idea to set up a process that "owns" the working-processes as its children. It sets whatever CPU limits etc. that the children may require, and handles such issues as child-dies and so on. (The init process in any Linux system is a good example of a "father daemon" which is dedicated to doing that ... and in fact, a copy of it can be used to do that. "It's just another process.")
 
1 members found this post helpful.
  


Reply

Tags
pid


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Which is the java application pid? newbie14 Linux - Newbie 7 05-11-2012 09:55 AM
Multiple instances of the same application with different PID's pjoshi Linux - Newbie 4 11-25-2009 03:36 AM
Generate pid file for application kirukan Programming 1 08-07-2009 11:35 AM
more then one smb pid running. . . kashifazizawan Linux - Server 3 09-02-2008 02:26 AM
Getting PID of running process in C/C++ laikos Programming 9 03-15-2004 03:33 AM


All times are GMT -5. The time now is 02:30 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration