Starting multiple upstart instances automatically
We use PHP gearman workers to run various tasks in parallel. Everything works just fine, and I have silly little shell script to spin them up when I want them. Being a programmer (and therefore lazy), I wanted to see if I could spin these up via an upstart script. I figured out how to use the instance stanza, so I could start them with an instance number: description "Async insert workers" author "Mike Grunder" env SCRIPT_PATH="/path/to/my/script" instance $N script php $SCRIPT_PATH/worker.php end script And this works great, to start them like so: sudo start async-worker N=1 sudo start async