From 2e0d46f2539189e8773f4827c20548bd275e2529 Mon Sep 17 00:00:00 2001 From: Daniel Joseph Barnhart Clark Date: Fri, 25 Aug 2006 06:12:43 +0000 Subject: EncapPackages: Add bcfg2-client "daemon" start to bcfg2-site git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2108 ce84e21b-d406-0410-9b95-82705330c041 --- encap/TODO | 16 ++-- encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall | 81 ------------------ .../bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl | 99 ++++++++++++++++++++++ encap/src/bcfg2-site/site-settings.conf-example | 1 + encap/src/encap-profiles/bcfg2-0.8.3pre3.ep | 6 ++ encap/src/encap-profiles/makeself-2.1.4.ep | 1 - 6 files changed, 112 insertions(+), 92 deletions(-) delete mode 100755 encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall create mode 100755 encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl (limited to 'encap') diff --git a/encap/TODO b/encap/TODO index 5c4978aca..2205b2a92 100644 --- a/encap/TODO +++ b/encap/TODO @@ -1,25 +1,21 @@ - * Add daemontools bcfg2-client service startup to either bcfg2-site, or - makeself install script. - * makeself-dist: create/test - * Handle TODO items in ./src/encap-profiles/makeself-2.1.4.ep * End result will be .run distribution that installs all client stuff * gamin and glib (server requirements) will be manual install items * Double-check all permissions, and make sure they are not effected by the environment's umask - * Big documentation update - - * Build everywhere, basic test and post binaries - - * Announce to mailing list: + * Small documentation update + + * Send blurb to desai for 0.8.3 announcement: * daemontools & ostiary stuff * encap support for Solaris (sparc and x86) * Binary epkg archive at http://www.pobox.com/users/dclark/mirror/bcfg2-encaps - * Fix epkg README/Makefile links on dclark.us + * Build everywhere, basic test + + * Big documentation update * Handle removals nicely (preremove/postremove scripts) * Work towards full compliance with encap 2.1 spec diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall b/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall deleted file mode 100755 index 4ed875e4c..000000000 --- a/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh -e - -umask 002 -BASEDIR="${ENCAP_TARGET}" # Usually /usr/local -PKGDIR="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" # Ususally /usr/local/encap/ -LOG="${PKGDIR}/postinstall.log" -MKINSTALLDIRS="${PKGDIR}/mkinstalldirs" -exec > $LOG 2>&1 - -printf "Running ${ENCAP_PKGNAME} postinstall script...\n" -date - -chmod 755 ${MKINSTALLDIRS} -${MKINSTALLDIRS} "${BASEDIR}/etc/default/bcfg2-client/env" -${MKINSTALLDIRS} "${BASEDIR}/etc/default/bcfg2-server/env" -${MKINSTALLDIRS} "${BASEDIR}/sbin" - -rmcp() { - SRCFILENAME="`basename ${1}`" - if [ -d "${2}" ]; then - DESTDIRNAME="$2" - else - DESTDIRNAME="`dirname ${2}`" - fi - TARGETNAME="$DESTDIRNAME/$SRCFILENAME" - if [ -h "$TARGETNAME" ]; then rm "$TARGETNAME"; fi - if [ -f "$TARGETNAME" ]; then rm "$TARGETNAME"; fi - cp "$1" "$2" -} - -if [ -f ${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_BCFG2 ]; then - printf "INFO: bcfg2 client options have been updated by bcfg2 -\n" - printf "INFO: not replacing that configuration.\n" -elif [ -f ${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_SITE ]; then - printf "INFO: bcfg2 client options have been previously updated -\n" - printf "INFO: not replacing that configuration.\n" -else - DIR="etc/default/bcfg2-client" - rmcp $PKGDIR/$DIR/env/RUN_INTERVAL_SECONDS ${BASEDIR}/$DIR/env/ - rmcp $PKGDIR/$DIR/env/OPTIONS ${BASEDIR}/$DIR/env/ - touch ${BASEDIR}/$DIR/.SENTINEL_SITE -fi - -if [ -f ${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_BCFG2 ]; then - printf "INFO: bcfg2 server options have been updated by bcfg2 -\n" - printf "INFO: not replacing that configuration.\n" -elif [ -f ${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_SITE ]; then - printf "INFO: bcfg2 server options have been previously updated -\n" - printf "INFO: not replacing that configuration.\n" -else - DIR="etc/default/bcfg2-server" - rmcp $PKGDIR/$DIR/env/OPTIONS ${BASEDIR}/$DIR/env/ - touch ${BASEDIR}/$DIR/.SENTINEL_SITE -fi - -if [ -f ${BASEDIR}/etc/.SENTINEL_BCFG2 ]; then - printf "INFO: bcfg2.conf and/or ostiary.cfg may have been updated by\n" - printf "INFO: bcfg2 - not replacing that configuration.\n" -elif [ -f ${BASEDIR}/etc/.SENTINEL_SITE ]; then - printf "INFO: bcfg2.conf and/or ostiary.cfg may have been previously\n" - printf "INFO: updated - not replacing that configuration.\n" -else - rmcp $PKGDIR/etc/bcfg2.conf ${BASEDIR}/etc/ - rmcp $PKGDIR/etc/ostiary.cfg ${BASEDIR}/etc/ - touch ${BASEDIR}/etc/.SENTINEL_SITE -fi - -if [ -f ${BASEDIR}/sbin/.SENTINEL_BCFG2 ]; then - printf "INFO: ost-bcfg2.sh may have been updated by bcfg2 -\n" - printf "INFO: not replacing that configuration with this script.\n" -elif [ -f ${BASEDIR}/sbin/.SENTINEL_SITE ]; then - printf "INFO: ost-bcfg2.sh may have been previously updated -\n" - printf "INFO: not replacing that configuration with this script.\n" -else - rmcp $PKGDIR/sbin/ost-bcfg2.sh ${BASEDIR}/sbin/ - touch ${BASEDIR}/sbin/.SENTINEL_SITE -fi - -printf "Finished ${ENCAP_PKGNAME} postinstall script.\n" - -exit 0 diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl new file mode 100755 index 000000000..a02c265cb --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall.tmpl @@ -0,0 +1,99 @@ +#include "site-settings.conf" +#compiler-settings +cheetahVarStartToken = @ +commentStartToken = // +#end compiler-settings +#!/bin/sh -e + +umask 002 +BASEDIR="${ENCAP_TARGET}" # Usually /usr/local +PKGDIR="${ENCAP_SOURCE}/${ENCAP_PKGNAME}" # Ususally /usr/local/encap/ +LOG="${PKGDIR}/postinstall.log" +MKINSTALLDIRS="${PKGDIR}/mkinstalldirs" +exec > $LOG 2>&1 + +printf "Running ${ENCAP_PKGNAME} postinstall script...\n" +date + +chmod 755 ${MKINSTALLDIRS} +${MKINSTALLDIRS} "${BASEDIR}/etc/default/bcfg2-client/env" +${MKINSTALLDIRS} "${BASEDIR}/etc/default/bcfg2-server/env" +${MKINSTALLDIRS} "${BASEDIR}/sbin" + +rmcp() { + SRCFILENAME="`basename ${1}`" + if [ -d "${2}" ]; then + DESTDIRNAME="$2" + else + DESTDIRNAME="`dirname ${2}`" + fi + TARGETNAME="$DESTDIRNAME/$SRCFILENAME" + if [ -h "$TARGETNAME" ]; then rm "$TARGETNAME"; fi + if [ -f "$TARGETNAME" ]; then rm "$TARGETNAME"; fi + cp "$1" "$2" +} + +if [ -f ${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_BCFG2 ]; then + printf "INFO: bcfg2 client options have been updated by bcfg2 -\n" + printf "INFO: not replacing that configuration.\n" +elif [ -f ${BASEDIR}/etc/default/bcfg2-client/.SENTINEL_SITE ]; then + printf "INFO: bcfg2 client options have been previously updated -\n" + printf "INFO: not replacing that configuration.\n" +else + DIR="etc/default/bcfg2-client" + rmcp $PKGDIR/$DIR/env/RUN_INTERVAL_SECONDS ${BASEDIR}/$DIR/env/ + rmcp $PKGDIR/$DIR/env/OPTIONS ${BASEDIR}/$DIR/env/ + touch ${BASEDIR}/$DIR/.SENTINEL_SITE +fi + +if [ -f ${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_BCFG2 ]; then + printf "INFO: bcfg2 server options have been updated by bcfg2 -\n" + printf "INFO: not replacing that configuration.\n" +elif [ -f ${BASEDIR}/etc/default/bcfg2-server/.SENTINEL_SITE ]; then + printf "INFO: bcfg2 server options have been previously updated -\n" + printf "INFO: not replacing that configuration.\n" +else + DIR="etc/default/bcfg2-server" + rmcp $PKGDIR/$DIR/env/OPTIONS ${BASEDIR}/$DIR/env/ + touch ${BASEDIR}/$DIR/.SENTINEL_SITE +fi + +if [ -f ${BASEDIR}/etc/.SENTINEL_BCFG2 ]; then + printf "INFO: bcfg2.conf and/or ostiary.cfg may have been updated by\n" + printf "INFO: bcfg2 - not replacing that configuration.\n" +elif [ -f ${BASEDIR}/etc/.SENTINEL_SITE ]; then + printf "INFO: bcfg2.conf and/or ostiary.cfg may have been previously\n" + printf "INFO: updated - not replacing that configuration.\n" +else + rmcp $PKGDIR/etc/bcfg2.conf ${BASEDIR}/etc/ + rmcp $PKGDIR/etc/ostiary.cfg ${BASEDIR}/etc/ + touch ${BASEDIR}/etc/.SENTINEL_SITE +fi + +if [ -f ${BASEDIR}/sbin/.SENTINEL_BCFG2 ]; then + printf "INFO: ost-bcfg2.sh may have been updated by bcfg2 -\n" + printf "INFO: not replacing that configuration with this script.\n" +elif [ -f ${BASEDIR}/sbin/.SENTINEL_SITE ]; then + printf "INFO: ost-bcfg2.sh may have been previously updated -\n" + printf "INFO: not replacing that configuration with this script.\n" +else + rmcp $PKGDIR/sbin/ost-bcfg2.sh ${BASEDIR}/sbin/ + touch ${BASEDIR}/sbin/.SENTINEL_SITE +fi + +//if int(@BCFG2_CLIENT_RUN_INTERVAL_SECONDS) > 0 +if [ ! -h /service/bcfg2-client ]; then + if [ -d /usr/local/var/svc.d/bcfg2-client ]; then + ln -s /usr/local/var/svc.d/bcfg2-client /service/bcfg2-client + else + printf "ERROR: /usr/local/var/svc.d/bcfg2-client does not exist.\n" + exit 1 + fi +else + printf "INFO: /service/bcfg2-client already exists, not replacing...\n" +fi +//end if + +printf "Finished ${ENCAP_PKGNAME} postinstall script.\n" + +exit 0 diff --git a/encap/src/bcfg2-site/site-settings.conf-example b/encap/src/bcfg2-site/site-settings.conf-example index c29ab36e2..dd7b0425e 100644 --- a/encap/src/bcfg2-site/site-settings.conf-example +++ b/encap/src/bcfg2-site/site-settings.conf-example @@ -18,6 +18,7 @@ #set global $BCFG2_SERVER = "config.localdomain.com" #set global $BCFG2_PORT = "6" #set global $OSTIARY_PORT = "7" +## How often to run the bcfg2 client, or "0" to disable #set global $BCFG2_CLIENT_RUN_INTERVAL_SECONDS = "3600" ## Initial options for bcfg(1). The bcfg2 client is started with these options ## on installation and periodically based on BCFG2_CLIENT_RUN_INTERVAL_SECONDS, diff --git a/encap/src/encap-profiles/bcfg2-0.8.3pre3.ep b/encap/src/encap-profiles/bcfg2-0.8.3pre3.ep index 90fe1183d..0772a7218 100644 --- a/encap/src/encap-profiles/bcfg2-0.8.3pre3.ep +++ b/encap/src/encap-profiles/bcfg2-0.8.3pre3.ep @@ -2,6 +2,12 @@ + + + + + + -