Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I want to run multiple instances of my process by passing an args to startup job:

start myapp instance1
start myapp instance2 

and so on

I want to have one upstart conf file instead of having conf files as many as instances of my app. Is it possible ?

share|improve this question

I realize the question is a bit old, but I'll go ahead and answer it. :)

Yes, you can do this, and you use the upstart "instance" clause to do it.

Here is a simple example (using a PHP based job in this case).

description "Async insert workers"
author      "Mike Grunder"

env SCRIPT_PATH="/path/to/my/script"

# This is the key bit
instance $N

    php $SCRIPT_PATH/worker.php
end script

If you see in that script, you've got an instance $N line. You specify the instance like so:

start the-job N=instance1
start the-job N=instance2

Obviously you could change N to whatever you like.

Now I'm back on my quest to figure out how to start a number of them automatically! :)

share|improve this answer

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.