From 7a90ea4debcdcb729197fbd926e8a0e840b312a6 Mon Sep 17 00:00:00 2001 From: Daniel Joseph Barnhart Clark Date: Thu, 24 Aug 2006 02:59:47 +0000 Subject: EncapPackages: Restructuring directory layout git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2100 ce84e21b-d406-0410-9b95-82705330c041 --- encap/README | 30 ++ encap/bcfg2-0.8.3pre3.ep | 343 --------------------- encap/epkg/Makefile | 43 +++ encap/epkg/README | 23 ++ encap/src/bcfg2-site/Makefile | 61 ++++ .../bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl | 9 + .../bcfg2-site/bcfg2-site-RENAME/encapname.tmpl | 2 + .../bcfg2-site-RENAME/etc/bcfg2.conf.tmpl | 10 + .../etc/default/bcfg2-client/.SENTINEL_SITE | 0 .../etc/default/bcfg2-client/env/OPTIONS.tmpl | 2 + .../bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl | 2 + .../etc/default/bcfg2-server/.SENTINEL_SITE | 0 .../etc/default/bcfg2-server/env/OPTIONS.tmpl | 2 + .../bcfg2-site-RENAME/etc/ostiary.cfg.tmpl | 29 ++ encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall | 0 encap/src/bcfg2-site/bcfg2-site-RENAME/preinstall | 0 .../bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh | 26 ++ .../bcfg2-site-RENAME/var/encap/bcfg2-site-RENAME | 0 encap/src/bcfg2-site/site-settings.conf | 46 +++ encap/tools/README | 30 -- encap/tools/bcfg2-site/Makefile | 61 ---- .../bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl | 9 - .../bcfg2-site/bcfg2-site-RENAME/encapname.tmpl | 2 - .../bcfg2-site-RENAME/etc/bcfg2.conf.tmpl | 10 - .../etc/default/bcfg2-client/.SENTINEL_SITE | 0 .../etc/default/bcfg2-client/env/OPTIONS.tmpl | 2 - .../bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl | 2 - .../etc/default/bcfg2-server/.SENTINEL_SITE | 0 .../etc/default/bcfg2-server/env/OPTIONS.tmpl | 2 - .../bcfg2-site-RENAME/etc/ostiary.cfg.tmpl | 29 -- .../tools/bcfg2-site/bcfg2-site-RENAME/postinstall | 0 .../tools/bcfg2-site/bcfg2-site-RENAME/preinstall | 0 .../bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh | 26 -- .../bcfg2-site-RENAME/var/encap/bcfg2-site-RENAME | 0 encap/tools/bcfg2-site/site-settings.conf | 46 --- encap/tools/epkg/Makefile | 43 --- encap/tools/epkg/README | 23 -- 37 files changed, 285 insertions(+), 628 deletions(-) create mode 100644 encap/README delete mode 100644 encap/bcfg2-0.8.3pre3.ep create mode 100644 encap/epkg/Makefile create mode 100644 encap/epkg/README create mode 100644 encap/src/bcfg2-site/Makefile create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/encapname.tmpl create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/etc/bcfg2.conf.tmpl create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/.SENTINEL_SITE create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/OPTIONS.tmpl create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/.SENTINEL_SITE create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/env/OPTIONS.tmpl create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/etc/ostiary.cfg.tmpl create mode 100755 encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall create mode 100755 encap/src/bcfg2-site/bcfg2-site-RENAME/preinstall create mode 100755 encap/src/bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh create mode 100644 encap/src/bcfg2-site/bcfg2-site-RENAME/var/encap/bcfg2-site-RENAME create mode 100644 encap/src/bcfg2-site/site-settings.conf delete mode 100644 encap/tools/README delete mode 100644 encap/tools/bcfg2-site/Makefile delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/encapname.tmpl delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/bcfg2.conf.tmpl delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/.SENTINEL_SITE delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/OPTIONS.tmpl delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/.SENTINEL_SITE delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/env/OPTIONS.tmpl delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/ostiary.cfg.tmpl delete mode 100755 encap/tools/bcfg2-site/bcfg2-site-RENAME/postinstall delete mode 100755 encap/tools/bcfg2-site/bcfg2-site-RENAME/preinstall delete mode 100755 encap/tools/bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh delete mode 100644 encap/tools/bcfg2-site/bcfg2-site-RENAME/var/encap/bcfg2-site-RENAME delete mode 100644 encap/tools/bcfg2-site/site-settings.conf delete mode 100644 encap/tools/epkg/Makefile delete mode 100644 encap/tools/epkg/README (limited to 'encap') diff --git a/encap/README b/encap/README new file mode 100644 index 000000000..bdb4cd1ab --- /dev/null +++ b/encap/README @@ -0,0 +1,30 @@ +bcfg2-python-apt +---------------- +Needed for bcfg2 clients that use the "Advanced Packaging Tool" (apt). + +bcfg2-server +------------ +Encaps for bcfg2 server deps. Only for GNU/Linux. + +bcfg2-site +---------- +Tools to make an encap package with your site-specific bcfg2.conf, +custom bcfg2 generators, bcfg2 client run frequency, etc. + +daemontools - http://cr.yp.to/daemontools.html +---------------------------------------------- +D. J. Bernstein's daemontools - a collection of tools for managing +UNIX services the same way across all UNIX platforms. May be useful to +set up one-time run of bcfg2 client at startup, or to run ostiary. + +epkg - http://www.encap.org/epkg +-------------------------------- +Mark D. Roth's epkg - an encap pacakage manager. Needed to build the +*.ep and *.sh files, although in most cases epkg binaries for your +platform will already exist. + +ostiary - http://ingles.homeunix.org/software/ost +------------------------------------------------- +Ray Ingles' ostiary - simple, secure remote script execution. May be +useful if you like/are used to being able to kick off a config update +on a config client from a config server, like with cfengine. diff --git a/encap/bcfg2-0.8.3pre3.ep b/encap/bcfg2-0.8.3pre3.ep deleted file mode 100644 index 1b804ef45..000000000 --- a/encap/bcfg2-0.8.3pre3.ep +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - -PLATFORM_IF_MATCH(linux) -PLATFORM_ELSE - -PLATFORM_ENDIF - - - - - - - - -: - - - -/usr/local/lib/bcfg2/bin/python setup.py build \ ---build-base=${builddir}/build - - - -/usr/local/lib/bcfg2/bin/python setup.py install \ ---prefix=${ENCAP_SOURCE}/${ENCAP_PKGNAME}/lib/bcfg2 - - - -/usr/local/lib/bcfg2/bin/python setup.py clean - - - - -/dev/null || exit 1 -for FILE in `ls lib/bcfg2/bin`; do \ - ln -sf ../lib/bcfg2/bin/${FILE} bin/${FILE}; \ - if [ ! "`printf "${FILE}" | cut -c 1-5`x" = "bcfg2x" ]; then \ - ln -sf ../lib/bcfg2/bin/${FILE} bin/b2-${FILE}; \ - fi; \ -done -# Make doc available from /usr/local/share/doc/bcfg2 -mkdir share 2>/dev/null || exit 1 -mkdir share/doc 2>/dev/null || exit 1 -mkdir share/doc/bcfg2 2>/dev/null || exit 1 -(cp ${builddir}/doc/manual.pdf share/doc/bcfg2/ || true) -cp -r ${builddir}/examples share/doc/bcfg2/ -# Make man pages available from /usr/local/man -mv lib/bcfg2/share/man . -# Make tools dirs and copy over tools -mkdir lib/bcfg2/tools || exit 1 -cp ${builddir}/tools/* lib/bcfg2/tools/ -mkdir sbin 2>/dev/null || exit 1 -mkdir share/doc/bcfg2/tools 2>/dev/null || exit 1 -# Makes tools with #! line executable -for FILE in `ls lib/bcfg2/tools`; do \ - F="lib/bcfg2/tools/${FILE}"; \ - if [ "`head -1 ${F} | grep ^#\!/`x" != "x" ]; then \ - chmod 755 ${F} ; \ - fi; \ -done -# Make executable tools available from /usr/local/sbin, and nonexecutable -# tools/tools doc available from /usr/local/share/doc/bcfg2/tools -for FILE in `ls lib/bcfg2/tools`; do \ - F="lib/bcfg2/tools/${FILE}"; \ - if [ -x ${F} ]; then \ - ln -sf ../lib/bcfg2/tools/${FILE} sbin/b2-example-tool-${FILE}; \ - else \ - ln -sf ../../../../lib/bcfg2/tools/${FILE} share/doc/bcfg2/tools/${FILE}; \ - fi; \ -done -# Make "this encap is installed" sentinal file available in /usr/local/var/encap -mkdir var 2>/dev/null || exit 1 -mkdir var/encap 2>/dev/null || exit 1 -touch var/encap/${ENCAP_PKGNAME} -]]> - - - - - - ${BASEDIR}/postinstall.log 2>&1 3>&1 -else - printf "\npostinstall: already ran\n\t${BASEDIR}/b2-regexplace.sh, not running again...\n" >> ${BASEDIR}/postinstall.log -fi -]]> - - - -description Bcfg2 - Provides a declarative interface to system configuration -prereq pkgspec >= bcfg2-zlib-1.2.3 -prereq pkgspec >= bcfg2-libiconv-1.9.2 -prereq pkgspec >= bcfg2-gettext-0.14.5 -prereq pkgspec >= bcfg2-openssl-0.9.8b -prereq pkgspec >= bcfg2-libstdc++-0.1 -prereq pkgspec >= bcfg2-libgcc-0.1 -prereq pkgspec >= bcfg2-python-2.4.3 -prereq pkgspec >= bcfg2-pyopenssl-0.6 -prereq pkgspec >= bcfg2-libxml2-2.6.26 -prereq pkgspec >= bcfg2-libxslt-1.1.17 -prereq pkgspec >= bcfg2-lxml-1.0.1 - - - diff --git a/encap/epkg/Makefile b/encap/epkg/Makefile new file mode 100644 index 000000000..6f4cf7277 --- /dev/null +++ b/encap/epkg/Makefile @@ -0,0 +1,43 @@ +# $Id$ + +.PHONY : all clean distclean install zlib libtar openssl curl fget expat epkg +.SUFFIXES : + +BASEDIR = /usr/local +ENCAPDIR = ${BASEDIR}/encap +PREFIX = /tmp/epkg-static-libs +PATH = ${PREFIX}/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/local/bin:/opt/csw/bin:/usr/sbin:/usr/bin +LDFLAGS = -L${PREFIX}/lib +CPPFLAGS = -I${PREFIX}/include +export PATH LDFLAGS CPPFLAGS + +ZLIB = zlib-1.2.3 +LIBTAR = libtar-1.2.11 +OPENSSL = openssl-0.9.8b +CURL = curl-7.15.4 +FGET = fget-1.3.3 +EXPAT = expat-2.0.0 +EPKG = epkg-2.3.9 + +all: zlib libtar openssl curl fget expat epkg + +zlib: + cd ${ZLIB} && prefix=${PREFIX} CC=gcc ./configure && $(MAKE) && $(MAKE) install + +libtar: + cd ${LIBTAR} && ./configure --disable-encap --disable-epkg-install --prefix=${PREFIX} && $(MAKE) && $(MAKE) install + +openssl: + cd ${OPENSSL} && ./config --prefix=${PREFIX} zlib no-shared && $(MAKE) && $(MAKE) install + +curl: + cd ${CURL} && ./configure --disable-ipv6 --disable-shared --prefix=${PREFIX} && $(MAKE) && $(MAKE) install + +fget: + cd ${FGET} && ./configure --disable-encap --disable-epkg-install --prefix=${PREFIX} && $(MAKE) && $(MAKE) install + +expat: + cd ${EXPAT} && ./configure --disable-shared --prefix=${PREFIX} && $(MAKE) && $(MAKE) install + +epkg: + cd ${EPKG} && ./configure && $(MAKE) && $(MAKE) install \ No newline at end of file diff --git a/encap/epkg/README b/encap/epkg/README new file mode 100644 index 000000000..99355280b --- /dev/null +++ b/encap/epkg/README @@ -0,0 +1,23 @@ +If you can't find an epkg binary compiled with all of the extra +libraries for your platform, you can use this Makefile (which will +probably require a little bit of editing for platforms other than +Solaris/x86 10) to compile it. + +You'll need to manually download the versions of packages you want to +this directory, edit the Makefile to refer to those versions, +decompress/untar the distributions, and then run make (or gmake on +non-GNU platforms) + +All of the software is available from http://www.dclark.us/mirror (or +Google for it). + +Once you have a working epkg distribution, you should: + * cd /usr/local/encap + * mkencap -c epkg-x.y.z + * Rename the tar.gz file with the appropriate encap string + (i.e. mv epkg-x.y.z.tar.gz epkg-x.y.z-encap-i386-solaris10.tar.gz) + * Upload that file to the encap repository at: + http://www.encap.org/search/upload.fcgi + * Update the ticket at http://trac.mcs.anl.gov/projects/bcfg2/ticket/74 + with a quick note stating you've done the encap upload so it can be + mirrored at http://www.dclark.us/mirror/epkg-contrib diff --git a/encap/src/bcfg2-site/Makefile b/encap/src/bcfg2-site/Makefile new file mode 100644 index 000000000..e42ff2eb6 --- /dev/null +++ b/encap/src/bcfg2-site/Makefile @@ -0,0 +1,61 @@ +# $Id$ + +# Variables + +PATH = /usr/local/lib/bcfg2/bin:/usr/local/bin:/usr/bin:/bin +CHEETAH = /usr/local/lib/bcfg2/bin/cheetah + +# Main + +.PHONY : all clean fill copy fix encap test cheetah +.SUFFIXES : + +BD = /usr/local +ED = ${BD}/encap +export ED + +all : encap + +clean : + for DIR in `find . -type d | grep -v "\.svn"`; do \ + for GLOB in \#\* \*\~ \*.out\*; do \ + (rm $${DIR}/$${GLOB} 2>/dev/null || true); \ + done; \ + done + +fill : clean + $(CHEETAH) fill -R --oext out + +copy : fill + EN=`cat bcfg2-site-RENAME/encapname.out` && \ + ( test ! -d $$ED/bcfg2-site-$${EN} || rm -rf $$ED/bcfg2-site-$${EN} ) && \ + for SRC in `find bcfg2-site-RENAME | grep -v svn | grep -v tmpl`; do \ + DEST=$$ED/`printf "$$SRC" | sed s/RENAME/$$EN/g | sed s/\.out//g`; \ + if [ -d $$SRC ]; then mkdir $$DEST; else cp $$SRC $$DEST; fi; \ + done + +fix : copy + EN="$$ED/bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \ + chown -R 0 $$EN && chgrp -R 0 $$EN && \ + find $$EN -type d | xargs -n1 chmod 0755 && \ + find $$EN -type f | xargs -n1 chmod 0644 && \ + chmod 0600 $$EN/etc/ostiary.cfg && \ + chmod 0600 $$EN/etc/bcfg2.conf && \ + chmod 0755 $$EN/sbin/ost-bcfg2.sh && \ + chmod 0755 $$EN/postinstall && \ + chmod 0755 $$EN/preinstall + +encap : fix + EN="bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \ + cd $$ED && \ + ( test ! -f $${EN}-encap-*.tar.gz || rm $${EN}-encap-*.tar.gz ) && \ + mkencap -c $$EN + EN="bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \ + mv $$ED/$${EN}-encap-*.tar.gz . + +test : + : $(PATH) + $(CHEETAH) test + +cheetah : + $(CHEETAH) $(ARGS) diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl new file mode 100644 index 000000000..e6af738ac --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl @@ -0,0 +1,9 @@ +#include "site-settings.conf" +encap 2.1 # libencap-2.3.8 +platform share +date ${DATE} +contact "${ADMIN_NAME}" <${ADMIN_EMAIL}> +description bcfg2-site-${SITE_SHORTNAME} - bcfg2 configuration for ${SITE_NAME} +prereq pkgspec >= bcfg2-0.8.2 +prereq pkgspec >= daemontools-0.76 +prereq pkgspec >= ostiary-3.4 diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/encapname.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/encapname.tmpl new file mode 100644 index 000000000..0c0296a16 --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/encapname.tmpl @@ -0,0 +1,2 @@ +#include "site-settings.conf" +${SITE_SHORTNAME}-${SITE_VERSION} diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/bcfg2.conf.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/bcfg2.conf.tmpl new file mode 100644 index 000000000..536faa82d --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/bcfg2.conf.tmpl @@ -0,0 +1,10 @@ +#include "site-settings.conf" +[communication] +protocol = xmlrpc/ssl +password = ${BCFG2_PASSWORD} + +[components] +bcfg2 = https://${BCFG2_SERVER}:${BCFG2_PORT} + +[statistics] +sendmailpath = ${SENDMAILPATH} diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/.SENTINEL_SITE b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/.SENTINEL_SITE new file mode 100644 index 000000000..e69de29bb diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/OPTIONS.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/OPTIONS.tmpl new file mode 100644 index 000000000..93d733712 --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/OPTIONS.tmpl @@ -0,0 +1,2 @@ +#include "site-settings.conf" +${BCFG2_CLIENT_OPTIONS} diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl new file mode 100644 index 000000000..e4ff48d09 --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl @@ -0,0 +1,2 @@ +#include "site-settings.conf" +${BCFG2_CLIENT_RUN_INTERVAL_SECONDS} diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/.SENTINEL_SITE b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/.SENTINEL_SITE new file mode 100644 index 000000000..e69de29bb diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/env/OPTIONS.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/env/OPTIONS.tmpl new file mode 100644 index 000000000..e4283b54e --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/env/OPTIONS.tmpl @@ -0,0 +1,2 @@ +#include "site-settings.conf" +${BCFG2_SERVER_OPTIONS} diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/ostiary.cfg.tmpl b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/ostiary.cfg.tmpl new file mode 100644 index 000000000..ebc39b61d --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/etc/ostiary.cfg.tmpl @@ -0,0 +1,29 @@ +#include "site-settings.conf" +# If present, ostiaryd will shut down once the cache of bad IPs is full. +# Under daemontools, this just has the effect of generating a service +# restart log message. +EXIT_ON_IPCACHE_FULL + +# If present, ostiaryd will not detach from the terminal it was started +# from. This is useful when running ostiaryd from programs like inetd or +# cygrunsrv or daemontools. +SKIP_DETACH + +# Port to listen on. (Can be specified on command line.) +PORT=${OSTIARY_PORT} + +# The password to remotely kill ostiaryd. Sort of useless when running under +# daemontools, since daemontools will just start ostiaryd back up. (But it +# is required to be in this file) +KILL="${OSTIARY_PASSWORD}-kill" + +# Must be at least one action. Format is: +# ACTION="secret","command (with path)",["uid"[,"gid"]] +# NOTE: There is a maximum of 31 actions +ACTION="${OSTIARY_PASSWORD}-bcfg2-dvqn","/usr/local/sbin/ost-bcfg2.sh dvqn","0","0" +ACTION="${OSTIARY_PASSWORD}-bcfg2-dvn","/usr/local/sbin/ost-bcfg2.sh dvn","0","0" +ACTION="${OSTIARY_PASSWORD}-bcfg2-dvq","/usr/local/sbin/ost-bcfg2.sh dvq","0","0" +ACTION="${OSTIARY_PASSWORD}-bcfg2-dv","/usr/local/sbin/ost-bcfg2.sh dv","0","0" +ACTION="${OSTIARY_PASSWORD}-bcfg2-vq","/usr/local/sbin/ost-bcfg2.sh vq","0","0" +ACTION="${OSTIARY_PASSWORD}-bcfg2-v","/usr/local/sbin/ost-bcfg2.sh v","0","0" +ACTION="${OSTIARY_PASSWORD}-bcfg2-restart","/usr/local/sbin/ost-bcfg2.sh restart","0","0" diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall b/encap/src/bcfg2-site/bcfg2-site-RENAME/postinstall new file mode 100755 index 000000000..e69de29bb diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/preinstall b/encap/src/bcfg2-site/bcfg2-site-RENAME/preinstall new file mode 100755 index 000000000..e69de29bb diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh b/encap/src/bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh new file mode 100755 index 000000000..55b20caac --- /dev/null +++ b/encap/src/bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# +# ost-bcfg2.sh : Control bcfg2 client via ostiary (wrapper script) +# $Id$ +# + +umask 002 +exec 2>&1 + +LOG="multilog t /usr/local/var/multilog/bcfg2-client-ostiary" +PATH=/usr/local/lib/bcfg2/bin:/command:/usr/local/bin:/usr/bin:/bin +export PATH + +case $1 in + dvqn) bcfg2 -d -v -q -n | $LOG ;; + dvn) bcfg2 -d -v -n | $LOG ;; + dvq) bcfg2 -d -v -q | $LOG ;; + dv) bcfg2 -d -v | $LOG ;; + vq) bcfg2 -v -q | $LOG ;; + v) bcfg2 -v | $LOG ;; + restart) svc -t bcfg2-client | $LOG ;; + *) printf "ERROR in $0\n" | $LOG ;; +esac + +exit 0 \ No newline at end of file diff --git a/encap/src/bcfg2-site/bcfg2-site-RENAME/var/encap/bcfg2-site-RENAME b/encap/src/bcfg2-site/bcfg2-site-RENAME/var/encap/bcfg2-site-RENAME new file mode 100644 index 000000000..e69de29bb diff --git a/encap/src/bcfg2-site/site-settings.conf b/encap/src/bcfg2-site/site-settings.conf new file mode 100644 index 000000000..c29ab36e2 --- /dev/null +++ b/encap/src/bcfg2-site/site-settings.conf @@ -0,0 +1,46 @@ +###### +###### Set these variables as appropriate for your site +###### +#### +#### Site Information +#### +#set global $ADMIN_NAME = "Local Admin Contact" +#set global $ADMIN_EMAIL = "tickets@localhost.localdomain.com" +#set global $SITE_NAME = "localdomain.com" +## SITE_SHORTNAME should be a single word with no punctuation +#set global $SITE_SHORTNAME = "localdomain" +## SITE_VERSION should be the version of this file, starting at 1 +#set global $SITE_VERSION = "1" +#### +#### Paths, Variables, and Passwords +#### +#set global $SENDMAILPATH = "/usr/sbin/sendmail" +#set global $BCFG2_SERVER = "config.localdomain.com" +#set global $BCFG2_PORT = "6" +#set global $OSTIARY_PORT = "7" +#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, +## so you probably want to include the "-n" (dry-run mode) flag, unless you +## already have a good configuration in place. You can then change the config +## file /usr/local/etc/default/bcfg2-client/env/OPTIONS via the bcfg2 "Cfg" +## functionality (possibly by kicking off a non-dry from the bcfg2 server using +## ostiary, or just by running bcfg2 manually on the client) to run in non-dry- +## run mode. +#set global $BCFG2_CLIENT_OPTIONS = "-q -v -d -n" +## Initial options for bcfg2-server(8). Note that bcfg2-server is not fully +## configured by bcfg2-site; you need to edit /usr/local/etc/bcfg2.conf to +## include the "[server]" stanza and appropriate values, as well as a "key =" +## line in the "[communications]" stanza (see bcfg2 doc for details). +#set global $BCFG2_SERVER_OPTIONS = "-v" +## You can set passwords here, and you will not be prompted for them at +## install time; however you will then have to treat your bcfg2-site +## distribution as equivalent to the bcfg2 server and ostiary passwords. +## To be prompted for passwords at install time, make these empty string ("") +#set global $BCFG2_PASSWORD = "" +#set global $OSTIARY_PASSWORD = "" +###### +###### Automatically-set variables - you shouldn't have to touch these. +###### +#from time import localtime, strftime +#set global $DATE = strftime("%a %b %d %H:%M:%S %Z %Y", localtime()) diff --git a/encap/tools/README b/encap/tools/README deleted file mode 100644 index bdb4cd1ab..000000000 --- a/encap/tools/README +++ /dev/null @@ -1,30 +0,0 @@ -bcfg2-python-apt ----------------- -Needed for bcfg2 clients that use the "Advanced Packaging Tool" (apt). - -bcfg2-server ------------- -Encaps for bcfg2 server deps. Only for GNU/Linux. - -bcfg2-site ----------- -Tools to make an encap package with your site-specific bcfg2.conf, -custom bcfg2 generators, bcfg2 client run frequency, etc. - -daemontools - http://cr.yp.to/daemontools.html ----------------------------------------------- -D. J. Bernstein's daemontools - a collection of tools for managing -UNIX services the same way across all UNIX platforms. May be useful to -set up one-time run of bcfg2 client at startup, or to run ostiary. - -epkg - http://www.encap.org/epkg --------------------------------- -Mark D. Roth's epkg - an encap pacakage manager. Needed to build the -*.ep and *.sh files, although in most cases epkg binaries for your -platform will already exist. - -ostiary - http://ingles.homeunix.org/software/ost -------------------------------------------------- -Ray Ingles' ostiary - simple, secure remote script execution. May be -useful if you like/are used to being able to kick off a config update -on a config client from a config server, like with cfengine. diff --git a/encap/tools/bcfg2-site/Makefile b/encap/tools/bcfg2-site/Makefile deleted file mode 100644 index e42ff2eb6..000000000 --- a/encap/tools/bcfg2-site/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# $Id$ - -# Variables - -PATH = /usr/local/lib/bcfg2/bin:/usr/local/bin:/usr/bin:/bin -CHEETAH = /usr/local/lib/bcfg2/bin/cheetah - -# Main - -.PHONY : all clean fill copy fix encap test cheetah -.SUFFIXES : - -BD = /usr/local -ED = ${BD}/encap -export ED - -all : encap - -clean : - for DIR in `find . -type d | grep -v "\.svn"`; do \ - for GLOB in \#\* \*\~ \*.out\*; do \ - (rm $${DIR}/$${GLOB} 2>/dev/null || true); \ - done; \ - done - -fill : clean - $(CHEETAH) fill -R --oext out - -copy : fill - EN=`cat bcfg2-site-RENAME/encapname.out` && \ - ( test ! -d $$ED/bcfg2-site-$${EN} || rm -rf $$ED/bcfg2-site-$${EN} ) && \ - for SRC in `find bcfg2-site-RENAME | grep -v svn | grep -v tmpl`; do \ - DEST=$$ED/`printf "$$SRC" | sed s/RENAME/$$EN/g | sed s/\.out//g`; \ - if [ -d $$SRC ]; then mkdir $$DEST; else cp $$SRC $$DEST; fi; \ - done - -fix : copy - EN="$$ED/bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \ - chown -R 0 $$EN && chgrp -R 0 $$EN && \ - find $$EN -type d | xargs -n1 chmod 0755 && \ - find $$EN -type f | xargs -n1 chmod 0644 && \ - chmod 0600 $$EN/etc/ostiary.cfg && \ - chmod 0600 $$EN/etc/bcfg2.conf && \ - chmod 0755 $$EN/sbin/ost-bcfg2.sh && \ - chmod 0755 $$EN/postinstall && \ - chmod 0755 $$EN/preinstall - -encap : fix - EN="bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \ - cd $$ED && \ - ( test ! -f $${EN}-encap-*.tar.gz || rm $${EN}-encap-*.tar.gz ) && \ - mkencap -c $$EN - EN="bcfg2-site-`cat bcfg2-site-RENAME/encapname.out`" && \ - mv $$ED/$${EN}-encap-*.tar.gz . - -test : - : $(PATH) - $(CHEETAH) test - -cheetah : - $(CHEETAH) $(ARGS) diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl b/encap/tools/bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl deleted file mode 100644 index e6af738ac..000000000 --- a/encap/tools/bcfg2-site/bcfg2-site-RENAME/encapinfo.tmpl +++ /dev/null @@ -1,9 +0,0 @@ -#include "site-settings.conf" -encap 2.1 # libencap-2.3.8 -platform share -date ${DATE} -contact "${ADMIN_NAME}" <${ADMIN_EMAIL}> -description bcfg2-site-${SITE_SHORTNAME} - bcfg2 configuration for ${SITE_NAME} -prereq pkgspec >= bcfg2-0.8.2 -prereq pkgspec >= daemontools-0.76 -prereq pkgspec >= ostiary-3.4 diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/encapname.tmpl b/encap/tools/bcfg2-site/bcfg2-site-RENAME/encapname.tmpl deleted file mode 100644 index 0c0296a16..000000000 --- a/encap/tools/bcfg2-site/bcfg2-site-RENAME/encapname.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -#include "site-settings.conf" -${SITE_SHORTNAME}-${SITE_VERSION} diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/bcfg2.conf.tmpl b/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/bcfg2.conf.tmpl deleted file mode 100644 index 536faa82d..000000000 --- a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/bcfg2.conf.tmpl +++ /dev/null @@ -1,10 +0,0 @@ -#include "site-settings.conf" -[communication] -protocol = xmlrpc/ssl -password = ${BCFG2_PASSWORD} - -[components] -bcfg2 = https://${BCFG2_SERVER}:${BCFG2_PORT} - -[statistics] -sendmailpath = ${SENDMAILPATH} diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/.SENTINEL_SITE b/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/.SENTINEL_SITE deleted file mode 100644 index e69de29bb..000000000 diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/OPTIONS.tmpl b/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/OPTIONS.tmpl deleted file mode 100644 index 93d733712..000000000 --- a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/OPTIONS.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -#include "site-settings.conf" -${BCFG2_CLIENT_OPTIONS} diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl b/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl deleted file mode 100644 index e4ff48d09..000000000 --- a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-client/env/RUN_INTERVAL_SECONDS.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -#include "site-settings.conf" -${BCFG2_CLIENT_RUN_INTERVAL_SECONDS} diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/.SENTINEL_SITE b/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/.SENTINEL_SITE deleted file mode 100644 index e69de29bb..000000000 diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/env/OPTIONS.tmpl b/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/env/OPTIONS.tmpl deleted file mode 100644 index e4283b54e..000000000 --- a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/default/bcfg2-server/env/OPTIONS.tmpl +++ /dev/null @@ -1,2 +0,0 @@ -#include "site-settings.conf" -${BCFG2_SERVER_OPTIONS} diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/ostiary.cfg.tmpl b/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/ostiary.cfg.tmpl deleted file mode 100644 index ebc39b61d..000000000 --- a/encap/tools/bcfg2-site/bcfg2-site-RENAME/etc/ostiary.cfg.tmpl +++ /dev/null @@ -1,29 +0,0 @@ -#include "site-settings.conf" -# If present, ostiaryd will shut down once the cache of bad IPs is full. -# Under daemontools, this just has the effect of generating a service -# restart log message. -EXIT_ON_IPCACHE_FULL - -# If present, ostiaryd will not detach from the terminal it was started -# from. This is useful when running ostiaryd from programs like inetd or -# cygrunsrv or daemontools. -SKIP_DETACH - -# Port to listen on. (Can be specified on command line.) -PORT=${OSTIARY_PORT} - -# The password to remotely kill ostiaryd. Sort of useless when running under -# daemontools, since daemontools will just start ostiaryd back up. (But it -# is required to be in this file) -KILL="${OSTIARY_PASSWORD}-kill" - -# Must be at least one action. Format is: -# ACTION="secret","command (with path)",["uid"[,"gid"]] -# NOTE: There is a maximum of 31 actions -ACTION="${OSTIARY_PASSWORD}-bcfg2-dvqn","/usr/local/sbin/ost-bcfg2.sh dvqn","0","0" -ACTION="${OSTIARY_PASSWORD}-bcfg2-dvn","/usr/local/sbin/ost-bcfg2.sh dvn","0","0" -ACTION="${OSTIARY_PASSWORD}-bcfg2-dvq","/usr/local/sbin/ost-bcfg2.sh dvq","0","0" -ACTION="${OSTIARY_PASSWORD}-bcfg2-dv","/usr/local/sbin/ost-bcfg2.sh dv","0","0" -ACTION="${OSTIARY_PASSWORD}-bcfg2-vq","/usr/local/sbin/ost-bcfg2.sh vq","0","0" -ACTION="${OSTIARY_PASSWORD}-bcfg2-v","/usr/local/sbin/ost-bcfg2.sh v","0","0" -ACTION="${OSTIARY_PASSWORD}-bcfg2-restart","/usr/local/sbin/ost-bcfg2.sh restart","0","0" diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/postinstall b/encap/tools/bcfg2-site/bcfg2-site-RENAME/postinstall deleted file mode 100755 index e69de29bb..000000000 diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/preinstall b/encap/tools/bcfg2-site/bcfg2-site-RENAME/preinstall deleted file mode 100755 index e69de29bb..000000000 diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh b/encap/tools/bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh deleted file mode 100755 index 55b20caac..000000000 --- a/encap/tools/bcfg2-site/bcfg2-site-RENAME/sbin/ost-bcfg2.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -# -# ost-bcfg2.sh : Control bcfg2 client via ostiary (wrapper script) -# $Id$ -# - -umask 002 -exec 2>&1 - -LOG="multilog t /usr/local/var/multilog/bcfg2-client-ostiary" -PATH=/usr/local/lib/bcfg2/bin:/command:/usr/local/bin:/usr/bin:/bin -export PATH - -case $1 in - dvqn) bcfg2 -d -v -q -n | $LOG ;; - dvn) bcfg2 -d -v -n | $LOG ;; - dvq) bcfg2 -d -v -q | $LOG ;; - dv) bcfg2 -d -v | $LOG ;; - vq) bcfg2 -v -q | $LOG ;; - v) bcfg2 -v | $LOG ;; - restart) svc -t bcfg2-client | $LOG ;; - *) printf "ERROR in $0\n" | $LOG ;; -esac - -exit 0 \ No newline at end of file diff --git a/encap/tools/bcfg2-site/bcfg2-site-RENAME/var/encap/bcfg2-site-RENAME b/encap/tools/bcfg2-site/bcfg2-site-RENAME/var/encap/bcfg2-site-RENAME deleted file mode 100644 index e69de29bb..000000000 diff --git a/encap/tools/bcfg2-site/site-settings.conf b/encap/tools/bcfg2-site/site-settings.conf deleted file mode 100644 index c29ab36e2..000000000 --- a/encap/tools/bcfg2-site/site-settings.conf +++ /dev/null @@ -1,46 +0,0 @@ -###### -###### Set these variables as appropriate for your site -###### -#### -#### Site Information -#### -#set global $ADMIN_NAME = "Local Admin Contact" -#set global $ADMIN_EMAIL = "tickets@localhost.localdomain.com" -#set global $SITE_NAME = "localdomain.com" -## SITE_SHORTNAME should be a single word with no punctuation -#set global $SITE_SHORTNAME = "localdomain" -## SITE_VERSION should be the version of this file, starting at 1 -#set global $SITE_VERSION = "1" -#### -#### Paths, Variables, and Passwords -#### -#set global $SENDMAILPATH = "/usr/sbin/sendmail" -#set global $BCFG2_SERVER = "config.localdomain.com" -#set global $BCFG2_PORT = "6" -#set global $OSTIARY_PORT = "7" -#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, -## so you probably want to include the "-n" (dry-run mode) flag, unless you -## already have a good configuration in place. You can then change the config -## file /usr/local/etc/default/bcfg2-client/env/OPTIONS via the bcfg2 "Cfg" -## functionality (possibly by kicking off a non-dry from the bcfg2 server using -## ostiary, or just by running bcfg2 manually on the client) to run in non-dry- -## run mode. -#set global $BCFG2_CLIENT_OPTIONS = "-q -v -d -n" -## Initial options for bcfg2-server(8). Note that bcfg2-server is not fully -## configured by bcfg2-site; you need to edit /usr/local/etc/bcfg2.conf to -## include the "[server]" stanza and appropriate values, as well as a "key =" -## line in the "[communications]" stanza (see bcfg2 doc for details). -#set global $BCFG2_SERVER_OPTIONS = "-v" -## You can set passwords here, and you will not be prompted for them at -## install time; however you will then have to treat your bcfg2-site -## distribution as equivalent to the bcfg2 server and ostiary passwords. -## To be prompted for passwords at install time, make these empty string ("") -#set global $BCFG2_PASSWORD = "" -#set global $OSTIARY_PASSWORD = "" -###### -###### Automatically-set variables - you shouldn't have to touch these. -###### -#from time import localtime, strftime -#set global $DATE = strftime("%a %b %d %H:%M:%S %Z %Y", localtime()) diff --git a/encap/tools/epkg/Makefile b/encap/tools/epkg/Makefile deleted file mode 100644 index 6f4cf7277..000000000 --- a/encap/tools/epkg/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# $Id$ - -.PHONY : all clean distclean install zlib libtar openssl curl fget expat epkg -.SUFFIXES : - -BASEDIR = /usr/local -ENCAPDIR = ${BASEDIR}/encap -PREFIX = /tmp/epkg-static-libs -PATH = ${PREFIX}/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/local/bin:/opt/csw/bin:/usr/sbin:/usr/bin -LDFLAGS = -L${PREFIX}/lib -CPPFLAGS = -I${PREFIX}/include -export PATH LDFLAGS CPPFLAGS - -ZLIB = zlib-1.2.3 -LIBTAR = libtar-1.2.11 -OPENSSL = openssl-0.9.8b -CURL = curl-7.15.4 -FGET = fget-1.3.3 -EXPAT = expat-2.0.0 -EPKG = epkg-2.3.9 - -all: zlib libtar openssl curl fget expat epkg - -zlib: - cd ${ZLIB} && prefix=${PREFIX} CC=gcc ./configure && $(MAKE) && $(MAKE) install - -libtar: - cd ${LIBTAR} && ./configure --disable-encap --disable-epkg-install --prefix=${PREFIX} && $(MAKE) && $(MAKE) install - -openssl: - cd ${OPENSSL} && ./config --prefix=${PREFIX} zlib no-shared && $(MAKE) && $(MAKE) install - -curl: - cd ${CURL} && ./configure --disable-ipv6 --disable-shared --prefix=${PREFIX} && $(MAKE) && $(MAKE) install - -fget: - cd ${FGET} && ./configure --disable-encap --disable-epkg-install --prefix=${PREFIX} && $(MAKE) && $(MAKE) install - -expat: - cd ${EXPAT} && ./configure --disable-shared --prefix=${PREFIX} && $(MAKE) && $(MAKE) install - -epkg: - cd ${EPKG} && ./configure && $(MAKE) && $(MAKE) install \ No newline at end of file diff --git a/encap/tools/epkg/README b/encap/tools/epkg/README deleted file mode 100644 index 99355280b..000000000 --- a/encap/tools/epkg/README +++ /dev/null @@ -1,23 +0,0 @@ -If you can't find an epkg binary compiled with all of the extra -libraries for your platform, you can use this Makefile (which will -probably require a little bit of editing for platforms other than -Solaris/x86 10) to compile it. - -You'll need to manually download the versions of packages you want to -this directory, edit the Makefile to refer to those versions, -decompress/untar the distributions, and then run make (or gmake on -non-GNU platforms) - -All of the software is available from http://www.dclark.us/mirror (or -Google for it). - -Once you have a working epkg distribution, you should: - * cd /usr/local/encap - * mkencap -c epkg-x.y.z - * Rename the tar.gz file with the appropriate encap string - (i.e. mv epkg-x.y.z.tar.gz epkg-x.y.z-encap-i386-solaris10.tar.gz) - * Upload that file to the encap repository at: - http://www.encap.org/search/upload.fcgi - * Update the ticket at http://trac.mcs.anl.gov/projects/bcfg2/ticket/74 - with a quick note stating you've done the encap upload so it can be - mirrored at http://www.dclark.us/mirror/epkg-contrib -- cgit v1.2.3-1-g7c22