From c4ca31e04c604a0d3428faabd0ee443d17ecc7e7 Mon Sep 17 00:00:00 2001 From: Daniel Joseph Barnhart Clark Date: Wed, 21 Feb 2007 13:58:32 +0000 Subject: EncapPackages: Made runit support Upstart (used instead of /etc/inittab in recent Ubuntu releases) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2861 ce84e21b-d406-0410-9b95-82705330c041 --- encap/src/encap-profiles/runit-1.7.2.ep | 37 +++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'encap') diff --git a/encap/src/encap-profiles/runit-1.7.2.ep b/encap/src/encap-profiles/runit-1.7.2.ep index afd02bca9..d2765f657 100644 --- a/encap/src/encap-profiles/runit-1.7.2.ep +++ b/encap/src/encap-profiles/runit-1.7.2.ep @@ -84,11 +84,24 @@ exec env - PATH=$PATH \ runsvdir -P /usr/local/var/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' ]]> - + + /dev/null @@ -98,7 +111,7 @@ then else echo 'Adding runsvdir to inittab...' rm -f /etc/inittab'{new}' - cat /etc/inittab boot.inittab > /etc/inittab'{new}' + cat /etc/inittab inittab.boot > /etc/inittab'{new}' mv -f /etc/inittab'{new}' /etc/inittab kill -HUP 1 echo 'init should start runsvdir now. @@ -140,7 +153,14 @@ test -d /usr/local/var/service || mkdir /usr/local/var/service test -d /usr/local/etc || mkdir /usr/local/etc test -d /usr/local/etc/default || mkdir /usr/local/etc/default test -d /usr/local/etc/sv || mkdir /usr/local/etc/sv -cd ${ENCAP_SOURCE}/${ENCAP_PKGNAME} && ./inittab-install +if [ -f /etc/inittab ]; then + printf "Installing to /etc/inittab ...\n" + cd ${ENCAP_SOURCE}/${ENCAP_PKGNAME} && ./inittab-install +fi +if [ -d /etc/event.d ]; then + printf "Installing to /etc/event.d/SV (Upstart) ...\n" + cd ${ENCAP_SOURCE}/${ENCAP_PKGNAME} && cp upstart.boot /etc/event.d/SV +fi printf "Finished runit postinstall script.\n" ]]> @@ -148,7 +168,16 @@ printf "Finished runit postinstall script.\n" #!/bin/sh printf "Running runit preremove script...\n" date -cd ${ENCAP_SOURCE}/${ENCAP_PKGNAME} && ./inittab-remove +if [ -f /etc/inittab ]; then + printf "Removing from /etc/inittab ...\n" + cd ${ENCAP_SOURCE}/${ENCAP_PKGNAME} && ./inittab-remove +fi +if [ -d /etc/event.d ]; then + if [ -f /etc/event.d/SV ]; then + printf "Removing /etc/event.d/SV (Upstart) ...\n" + rm /etc/event.d/SV + fi +fi printf "Finished runit preremove script.\n" ]]> -- cgit v1.2.3-1-g7c22