LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 01-06-2005, 12:47 AM   #1
hk_linux
Member
 
Registered: Nov 2004
Location: India
Distribution: RedHat, PCQLinux, Fedora
Posts: 95

Rep: Reputation: 15
number of running instances


hello,
Is there a way to limit the number of instances of a running script to 'n', where n is read from a configuration file.
I have a shell script which is called by many other process. But i want to limit the number of the running scripts to 'n'. I have no way of curbing at the source, because the source may be from other machines also.
The first stmt inside the script is to count the number of instances using "pidof -x". If it is greater than 'n', i am qutting. But the problem here is that, the child process of the shell script in question also gets the same name as the parent, so counting via "pidof" gives me wrong result.

Can anybody suggest a solution or give a pointer?

TIA.
 
  


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
Why are multiple instances of mysqld running? philpq Linux - Newbie 2 02-17-2005 04:01 PM
How do you determine the number of NFS instances to start? BrianK Linux - Networking 6 10-26-2004 06:23 AM
why there is a need for minor number and major number for monitor/keyboard in pc? tripathi Solaris / OpenSolaris 1 11-07-2003 10:36 AM
9 httpd instances running!?? jlinden Linux - Newbie 2 09-17-2003 12:32 PM
how to change number of running processes rsc Linux - Newbie 2 03-14-2002 06:23 PM


All times are GMT -5. The time now is 03:36 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration