Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have a supervisor's config file like this:

command=my_program_1 X

command=my_program_1 Y


command=my_program_2 X

command=my_program_2 Y





So what I'm dong is defining two types of programs (my_program_(X|Y)) that runs with two sets of different parameters (X&Y). Then I group programs on the type of program they are running (type(X|Y)), and then I have one other group (type) that includes all defined programs above (there could be other unrelated programs in the config file).

The problem with this is, that supervisor will start each program twice since it appears in two different groups. So my question is: is there a way to have one program in multiple groups but only start it once (or however times the program defines itself (via "numprocs"))?

edit: Is there really no one who can help?

share|improve this question

You could replace the program with a shell script that will create a lock or semaphore to start one or a limited number of instances.

share|improve this answer
So you would replace supervisor? – Jan Hančič Apr 23 '12 at 7:32
Depends, if it does not fit the bill, yes. If you needed it for other functionality/reasons, I would adapt it to the current requirements. – Mircea Vutcovici Apr 23 '12 at 15:07
It fits the bill perfectly. So what you are proposing isn't really an answer ... – Jan Hančič Apr 24 '12 at 6:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.