summaryrefslogtreecommitdiffstats
path: root/encap/src/encap-profiles/bcfg2-0.9.2.ep
diff options
context:
space:
mode:
authorDaniel Joseph Barnhart Clark <dclark@pobox.com>2007-02-25 15:58:21 +0000
committerDaniel Joseph Barnhart Clark <dclark@pobox.com>2007-02-25 15:58:21 +0000
commitc57b749af348f76b30c20774444ed48b200a1f2e (patch)
tree046e7c94cba56f128e1a8c46dbe4e0636507e1db /encap/src/encap-profiles/bcfg2-0.9.2.ep
parent2984f41369d090210041b865c0b3f7cc5cd67745 (diff)
downloadbcfg2-c57b749af348f76b30c20774444ed48b200a1f2e.tar.gz
bcfg2-c57b749af348f76b30c20774444ed48b200a1f2e.tar.bz2
bcfg2-c57b749af348f76b30c20774444ed48b200a1f2e.zip
EncapPackages: Updates for runit encap
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2868 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'encap/src/encap-profiles/bcfg2-0.9.2.ep')
-rw-r--r--encap/src/encap-profiles/bcfg2-0.9.2.ep20
1 files changed, 10 insertions, 10 deletions
diff --git a/encap/src/encap-profiles/bcfg2-0.9.2.ep b/encap/src/encap-profiles/bcfg2-0.9.2.ep
index c78c59171..b32a799a2 100644
--- a/encap/src/encap-profiles/bcfg2-0.9.2.ep
+++ b/encap/src/encap-profiles/bcfg2-0.9.2.ep
@@ -394,16 +394,16 @@ if [ "${RUN_INTERVAL_SECONDS}x" = "x" ]; then
RUN_INTERVAL_SECONDS=3600
fi
-# loop forever
-while :
-do
- printf "*** starting /usr/local/bin/bcfg2 ${OPTIONS} ...\n"
- /usr/local/bin/bcfg2 ${OPTIONS}
- printf "*** sleeping ${RUN_INTERVAL_SECONDS} seconds ...\n"
- sleep ${RUN_INTERVAL_SECONDS}
-done
-
-exit 0
+# Run bcfg2 and then sleep (runsv takes care of starting up script
+# again after it exits). Need to exec sleep so runit can exit
+# cleanly while the sleep is in progress; see:
+# http://comments.gmane.org/gmane.comp.sysutils.supervision.general/1373
+# for more information on why this is required (short reason: runit is
+# more anal about making sure things are logged than daemontools)
+printf "*** starting /usr/local/bin/bcfg2 ${OPTIONS} ...\n"
+/usr/local/bin/bcfg2 ${OPTIONS}
+printf "*** sleeping ${RUN_INTERVAL_SECONDS} seconds ...\n"
+exec sleep ${RUN_INTERVAL_SECONDS}
]]></include_file>
<include_file name="etc/sv/bcfg2-client/run" mode="0755"><![CDATA[