title: Restarting Upstart instance processes
body: <p>I am running multiple instances of a worker as described in this answer: <a href="https://stackoverflow.com/questions/8681974/starting-multiple-upstart-instances-automatically">Starting multiple upstart instances automatically</a></p>
  
  <p><strong>Question: Can I restart all instances at once?</strong></p>
  
  <p>To start my workers I can do:</p>
  
  <blockquote>
    <p>initctl start my-workers</p>
  </blockquote>
  
  <p>Which then allows me to do:</p>
  
  <blockquote>
    <p>initctl status worker N=1 worker (1) start/running, process 551</p>
    
    <p>initctl status worker N=2 worker (2) start/running, process 552</p>
  </blockquote>
  
  <p>Is there a way to do something like this:</p>
  
  <blockquote>
    <p>initctl restart my-workers</p>
  </blockquote>
  
  <p>I would like to be able to restart all instances without having to know how many are running.</p>
  
  <p>Here is my my-workers.conf</p>
  
  <pre><code>start on stopped cloud-init
  stop on shutdown
  
  env NUM_WORKERS=4
  
  script
    for i in `seq 1 $NUM_WORKERS`
      do
        start worker N=$i
      done
  end script
  </code></pre>
  
  <p>And worker.conf</p>
  
  <pre><code>stop on shutdown
  
  chdir /path/to/current
  
  respawn
  
  instance $N
  
  script
    exec su -c "/home/worker/.rvm/bin/rvm-shell -c 'bundle exec rake work 2&gt;&amp;1 &gt;&gt; /var/log/worker-$N.log'" worker
  end script
  </code></pre>