Comment 11 for bug 1124384

Revision history for this message
Scott Moser (smoser) wrote : Re: reload-configuration can confuse upstart

Ok, another recreate that is possibly simpler to debug. Below, we create 2 jobs, one invokes reload-configuration, the other just writes something to /run. We add those jobs to a pristine raring container, start it, and expect them to run. Only the first will run. I've explicitly ran 'start console' from the first so you can log in, otherwise you wont get a getty, so you can't log in to look around.

cat <<"EOF" | tee job1.conf
description "invoke reload for fun"
start on filesystem
console output
task
script
  read x y < /proc/uptime
  cmd="initctl reload-configuration"
  (
  echo "==== up $x: running $cmd ==="
  initctl reload-configuration
  echo "got $?"
  ) 2>&1 | tee /run/job1.log
  sh -c 'sleep 5; start console' &
end script
EOF

cat <<"EOF" | tee job2.conf
description "do something around rc.local"
start on stopped rc RUNLEVEL=[2345]
console output
task
script
  read x y < /proc/uptime
  echo "==== up $x: touching /run/did-something ===" | tee /run/job2.log
  echo "$x" > /run/did-something
end script
EOF

# precise base
sudo apt-get install lxc
sname="raring-amd64-source"
cname="raring-amd64"

sudo lxc-create -n raring-amd64-source -t ubuntu -- --arch=amd64 raring
sudo lxc-clone -o $sname -n $cname
sudo cp job1.conf job2.conf /var/lib/lxc/$cname/rootfs/etc/init/
sudo lxc-start -n $cname

## now log in as 'ubuntu'. You *should* see a file /run/did-something.