Thanks Dr Nic. I looked at the monit docs for stop/start ordering and I tried the "depends on..". It worked with the older stemcells - bosh-stemcell-2427-vsphere-esxi-ubuntu.tgz. But on the newer stemcell bosh-stemcell-2624-vsphere-esxi-ubuntu-trusty-go_agent.tgz it doesn't.
The monit file:
--
check process hadoop-datanode
with pidfile /var/vcap/sys/run/hadoop-datanode/hadoop-datanode.pid
start program "/var/vcap/jobs/hadoop-datanode/bin/monit_debugger hadoop-datanode_ctl '/var/vcap/jobs/hadoop-datanode/bin/hadoop-datanode_ctl start'"
stop program "/var/vcap/jobs/hadoop-datanode/bin/monit_debugger hadoop-datanode_ctl '/var/vcap/jobs/hadoop-datanode/bin/hadoop-datanode_ctl stop'"
<% if File.exist?("/var/vcap/jobs/hadoop-namenode") %>
depends on hadoop-namenode
<% end %>
group vcap
On the older stemcell, the ruby templating was getting replaced correctly & I was seeing the "depends on hadoop-namenode" in the monitrc. But on the newer stemcell, I dont see the "depends on", it was as if the /var/vcap/jobs/hadoop-namenode did not exist..