Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This script will start the services:

#!upstart

description "example.com"
author      "Geert"

script
  for service in "website" "feeds" "jobs"
  do
    exec start service.example.com service=$service
  done
end script

The service script looks like this:

#!upstart

description "service.example.com"
author      "Geert"

start on (local-filesystems and net-device-up IFACE=eth0) 
stop  on shutdown

respawn                # restart when job dies

instance $service

script
  exec /home/fs/.nvm/v0.6.7/bin/coffee /home/fs/Dropbox/work/2012/krafters/$service.coffee
end script

The problem I have is that it only seems to be creating the website service.

initctl list | grep example
example.com stop/waiting
service.example.com (website) start/running, process 22787
share|improve this question

1 Answer 1

Firstly, Upstart job configuration files (.conf files) are not scripts in the conventional sense: the first line you have ('#!upstart') is completely redundant and will be treated only as a comment.

Your problem is the use of 'exec' in the first .conf file with the for loop: exec replaces the currently running shell with whatever argument you give exec so only the first entry in the for loop will be run.

To fix this, simply remove 'exec' in the first .conf file.

share|improve this answer

Your Answer

 
discard

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.