aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Thibodeau <kyron@neuralbs.com>2008-08-18 01:24:04 -0400
committerEric Thibodeau <kyron@neuralbs.com>2008-08-18 01:24:04 -0400
commit11f730f49ef407d5c370f45fc1cea4d9f59d76ea (patch)
treeb0fd78fb24da3fa4b53d37fe1a3688514596af45 /overlay
parentAdded support for CPUSET (diff)
downloadclustering-livecd-11f730f49ef407d5c370f45fc1cea4d9f59d76ea.tar.gz
clustering-livecd-11f730f49ef407d5c370f45fc1cea4d9f59d76ea.tar.bz2
clustering-livecd-11f730f49ef407d5c370f45fc1cea4d9f59d76ea.zip
Multiple addition and cleanups
- added passwordless SSH for root to nodes - added some FAQs and documentation - quick update of the HOWTOs - switch to snapshot 20080816 - added torque (PBS) and underlying support modules - added a few config variables to scripts to ease future changes - created openrc-0.2.5-r1 to ease the NFSROOT howto procedure + (don't have to unpack and repack the snapshot for running ebuild * digest) * corrected invalide use of non existant functions.sh in nfsroot_setup.sh beowulf-head-0.1.ebuild: * Added the modules infrastructure to be called by dnsmasq's script callback interface * provided examples are for torque and c3. -- C3's configuration file is valid but doesn't seem to work (might be a python issue) -- torque is _still_ work in progress: + some of the setup seems to be incomplete (in the ebuild) + the profile switch was to get a better chance at a working installation (2.3.3) - Science overlay was added to pull in the modularized version of openmpi Since USE=pbs in the specs, openmpi requires Torque but Torque also require kernel (stage2). Torque is currently being built twise, once minimal for openmpi, then with kernel features in the stage2. Commenting out pbs and torque in stage2 reverts the build to a simple cluster without the whole PBS infrastructure...but it works ;)
Diffstat (limited to 'overlay')
-rw-r--r--overlay/sys-apps/openrc/Manifest2
-rw-r--r--overlay/sys-apps/openrc/openrc-0.2.5-r1.ebuild276
-rw-r--r--overlay/sys-cluster/beowulf-head/Manifest8
-rw-r--r--overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild58
-rwxr-xr-xoverlay/sys-cluster/beowulf-head/files/c3-add10
-rwxr-xr-xoverlay/sys-cluster/beowulf-head/files/c3-del4
-rw-r--r--overlay/sys-cluster/beowulf-head/files/dnsmasq-2.4-conf2
-rwxr-xr-xoverlay/sys-cluster/beowulf-head/files/node-manager25
-rwxr-xr-xoverlay/sys-cluster/beowulf-head/files/torque-add6
-rwxr-xr-xoverlay/sys-cluster/beowulf-head/files/torque-del6
10 files changed, 364 insertions, 33 deletions
diff --git a/overlay/sys-apps/openrc/Manifest b/overlay/sys-apps/openrc/Manifest
new file mode 100644
index 0000000..9f81d64
--- /dev/null
+++ b/overlay/sys-apps/openrc/Manifest
@@ -0,0 +1,2 @@
+DIST openrc-0.2.5.tar.bz2 144248 RMD160 33275cea6592abba677acd40857a0ec434eb0787 SHA1 36190b706cc7eb8dd5b612cfcbb4d0175630ecb2 SHA256 bdf89a670cf1fd8b4346b09defa3c38c584b08bec97997f095c4e798530cab80
+EBUILD openrc-0.2.5-r1.ebuild 9023 RMD160 a97fd7819621b6fb738fd013a63d46720aa6cf6f SHA1 1117c31839946029c3c93cbf1dfc2f052ffdc62c SHA256 ef943aad5690c41d5ed017e93ce2acea8f2b03a1aa50a92478da15a4e26ca90e
diff --git a/overlay/sys-apps/openrc/openrc-0.2.5-r1.ebuild b/overlay/sys-apps/openrc/openrc-0.2.5-r1.ebuild
new file mode 100644
index 0000000..d6988ca
--- /dev/null
+++ b/overlay/sys-apps/openrc/openrc-0.2.5-r1.ebuild
@@ -0,0 +1,276 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/openrc/openrc-0.2.5.ebuild,v 1.4 2008/06/09 14:38:45 cardoe Exp $
+
+inherit eutils flag-o-matic multilib toolchain-funcs
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/openrc.git"
+ EGIT_BRANCH="master"
+ inherit git
+else
+ SRC_URI="http://roy.marples.name/${PN}/${P}.tar.bz2
+ mirror://gentoo/${P}.tar.bz2
+ http://dev.gentoo.org/~cardoe/files/${P}.tar.bz2
+ http://dev.gentoo.org/~vapier/dist/${P}.tar.bz2"
+fi
+
+DESCRIPTION="OpenRC manages the services, startup and shutdown of a host"
+HOMEPAGE="http://roy.marples.name/openrc"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="debug ncurses pam unicode kernel_linux kernel_FreeBSD"
+
+RDEPEND="virtual/init
+ kernel_linux? ( >=sys-apps/module-init-tools-3.2.2-r2 )
+ kernel_FreeBSD? ( sys-process/fuser-bsd )
+ elibc_glibc? ( >=sys-libs/glibc-2.5 )
+ ncurses? ( sys-libs/ncurses )
+ pam? ( virtual/pam )
+ >=sys-apps/baselayout-2.0.0
+ !<sys-fs/udev-118-r2"
+DEPEND="${RDEPEND}
+ virtual/os-headers"
+
+pkg_setup() {
+ LIBDIR="lib"
+ [ "${SYMLINK_LIB}" = "yes" ] && LIBDIR=$(get_abi_LIBDIR "${DEFAULT_ABI}")
+
+ MAKE_ARGS="${MAKE_ARGS} LIBNAME=${LIBDIR}"
+
+ local brand="Unknown"
+ if use kernel_linux ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=Linux"
+ brand="Linux"
+ elif use kernel_FreeBSD ; then
+ MAKE_ARGS="${MAKE_ARGS} OS=FreeBSD"
+ brand="FreeBSD"
+ fi
+ export BRANDING="Gentoo ${brand}"
+
+ export DEBUG=$(usev debug)
+ export MKPAM=$(usev pam)
+ export MKTERMCAP=$(usev ncurses)
+}
+
+src_unpack() {
+ if [[ ${PV} == "9999" ]] ; then
+ git_src_unpack
+ else
+ unpack ${A}
+ fi
+ cd "${S}"
+ epatch "${FILESDIR}"/9999/*.patch
+}
+
+src_compile() {
+ # catch people running `ebuild` w/out setup
+ if [[ -z ${MAKE_ARGS} ]] ; then
+ die "Your MAKE_ARGS is empty ... are you running 'ebuild' but forgot to execute 'setup' ?"
+ fi
+
+ if [[ ${PV} == "9999" ]] ; then
+ local ver="git-$(git --git-dir=${EGIT_STORE_DIR}/${EGIT_PROJECT} rev-parse --verify ${EGIT_BRANCH} | cut -c1-8)"
+ sed -i "/^VERSION[[:space:]]*=/s:=.*:=${ver}:" Makefile
+ fi
+
+ tc-export CC AR RANLIB
+ echo emake ${MAKE_ARGS}
+ emake ${MAKE_ARGS} || die "emake ${MAKE_ARGS} failed"
+}
+
+src_install() {
+ emake ${MAKE_ARGS} DESTDIR="${D}" install || die "make install failed"
+ gen_usr_ldscript libeinfo.so
+ gen_usr_ldscript librc.so
+
+ keepdir /"${LIBDIR}"/rc/init.d
+ keepdir /"${LIBDIR}"/rc/tmp
+
+ # Backup our default runlevels
+ dodir /usr/share/"${PN}"
+ mv "${D}/etc/runlevels" "${D}/usr/share/${PN}"
+
+ # Setup unicode defaults for silly unicode users
+ use unicode && sed -i -e '/^unicode=/s:NO:YES:' "${D}"/etc/rc.conf
+
+ # Cater to the norm
+ (use x86 || use amd64) && sed -i -e '/^windowkeys=/s:NO:YES:' "${D}"/etc/conf.d/keymaps
+}
+
+add_boot_init() {
+ local initd=$1
+ # if the initscript is not going to be installed and is not
+ # currently installed, return
+ [[ -e ${D}/etc/init.d/${initd} || -e ${ROOT}/etc/init.d/${initd} ]] \
+ || return
+ [[ -e ${ROOT}/etc/runlevels/boot/${initd} ]] && return
+ elog "Auto-adding '${initd}' service to your boot runlevel"
+ ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/boot/${initd}
+}
+add_boot_init_mit_config() {
+ local config=$1 initd=$2
+ if [[ -e ${ROOT}${config} ]] ; then
+ if [[ -n $(sed -e 's:#.*::' -e '/^[[:space:]]*$/d' "${ROOT}"/${config}) ]] ; then
+ add_boot_init ${initd}
+ fi
+ fi
+}
+
+pkg_preinst() {
+ local f
+
+ # default net script is just comments, so no point in biting people
+ # in the ass by accident
+ mv "${D}"/etc/conf.d/net "${T}"/
+ [[ -e ${ROOT}/etc/conf.d/net ]] && cp "${ROOT}"/etc/conf.d/net "${T}"/
+
+ # upgrade timezone file ... do it before moving clock
+ if [[ -e ${ROOT}/etc/conf.d/clock && ! -e ${ROOT}/etc/timezone ]] ; then
+ (
+ source "${ROOT}"/etc/conf.d/clock
+ [[ -n ${TIMEZONE} ]] && echo "${TIMEZONE}" > "${ROOT}"/etc/timezone
+ )
+ fi
+
+ # /etc/conf.d/clock moved to /etc/conf.d/hwclock
+ local clock
+ use kernel_FreeBSD && clock="adjkerntz" || clock="hwclock"
+ if [[ -e ${ROOT}/etc/conf.d/clock ]] ; then
+ mv "${ROOT}"/etc/conf.d/clock "${ROOT}"/etc/conf.d/${clock}
+ fi
+ if [[ -L ${ROOT}/etc/runlevels/boot/clock ]] ; then
+ rm -f "${ROOT}"/etc/runlevels/boot/clock
+ ln -snf /etc/init.d/${clock} "${ROOT}"/etc/runlevels/boot/${clock}
+ fi
+ if [[ -L ${ROOT}${LIBDIR}/rc/init.d/started/clock ]] ; then
+ rm -f "${ROOT}${LIBDIR}"/rc/init.d/started/clock
+ ln -snf /etc/init.d/${clock} "${ROOT}${LIBDIR}"/rc/init.d/started/${clock}
+ fi
+
+ # /etc/conf.d/rc is no longer used for configuration
+ if [[ -e ${ROOT}/etc/conf.d/rc ]] ; then
+ elog "/etc/conf.d/rc is no longer used for configuration."
+ elog "Please migrate your settings to /etc/rc.conf as applicable"
+ elog "and delete /etc/conf.d/rc"
+ fi
+
+ # force net init.d scripts into symlinks
+ for f in "${ROOT}"/etc/init.d/net.* ; do
+ [[ -e ${f} ]] || continue # catch net.* not matching anything
+ [[ ${f} == */net.lo ]] && continue # real file now
+ [[ ${f} == *.openrc.bak ]] && continue
+ if [[ ! -L ${f} ]] ; then
+ elog "Moved net service '${f##*/}' to '${f##*/}.openrc.bak' to force a symlink."
+ elog "You should delete '${f##*/}.openrc.bak' if you don't need it."
+ mv "${f}" "${f}.openrc.bak"
+ ln -snf net.lo "${f}"
+ fi
+ done
+
+ # termencoding was added in 0.2.1 and needed in boot
+ has_version ">=sys-apps/openrc-0.2.1" || add_boot_init termencoding
+
+ # skip remaining migration if we already have openrc installed
+ has_version sys-apps/openrc && return 0
+
+ # baselayout boot init scripts have been split out
+ for f in $(cd "${D}"/usr/share/${PN}/runlevels/boot || exit; echo *) ; do
+ add_boot_init ${f}
+ done
+
+ # Try to auto-add some addons when possible
+ add_boot_init_mit_config /etc/conf.d/cryptfs dmcrypt
+ add_boot_init_mit_config /etc/conf.d/dmcrypt dmcrypt
+ add_boot_init_mit_config /etc/mdadm.conf mdraid
+ add_boot_init_mit_config /etc/evms.conf evms
+ [[ -e ${ROOT}/sbin/dmsetup ]] && add_boot_init device-mapper
+ [[ -e ${ROOT}/sbin/vgscan ]] && add_boot_init lvm
+ elog "Add on services (such as RAID/dmcrypt/LVM/etc...) are now stand alone"
+ elog "init.d scripts. If you use such a thing, make sure you have the"
+ elog "required init.d scripts added to your boot runlevel."
+
+ # Upgrade out state for baselayout-1 users
+ if [[ ! -e ${ROOT}${LIBDIR}/rc/init.d/started ]] ; then
+ (
+ [[ -e ${ROOT}/etc/conf.d/rc ]] && source "${ROOT}"/etc/conf.d/rc
+ svcdir=${svcdir:-/var/lib/init.d}
+ if [[ ! -d ${ROOT}${svcdir}/started ]] ; then
+ ewarn "No state found, and no state exists"
+ elog "You should reboot this host"
+ else
+ mkdir -p "${ROOT}${LIBDIR}/rc/init.d"
+ einfo "Moving state from ${ROOT}${svcdir} to ${ROOT}${LIBDIR}/rc/init.d"
+ mv "${ROOT}${svcdir}"/* "${ROOT}${LIBDIR}"/rc/init.d
+ rm -rf "${ROOT}${LIBDIR}"/rc/init.d/daemons \
+ "${ROOT}${LIBDIR}"/rc/init.d/console
+ umount "${ROOT}${svcdir}" 2>/dev/null
+ rm -rf "${ROOT}${svcdir}"
+ fi
+ )
+ fi
+
+ # Handle the /etc/modules.autoload.d -> /etc/conf.d/modules transition
+ if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
+ elog "Converting your /etc/modules.autoload.d/ files to /etc/conf.d/modules"
+ rm -f "${ROOT}"/etc/modules.autoload.d/.keep*
+ rmdir "${ROOT}"/etc/modules.autoload.d 2>/dev/null
+ if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
+ local f v
+ for f in "${ROOT}"/etc/modules.autoload.d/* ; do
+ v=${f##*/}
+ v=${v#kernel-}
+ v=${v//[^[:alnum:]]/_}
+ gawk -v v="${v}" -v f="${f##*/}" '
+ BEGIN { print "\n### START: Auto-converted from " f "\n" }
+ {
+ if ($0 ~ /^[^#]/) {
+ print "modules_" v "=\"${modules_" v "} " $1 "\""
+ gsub(/[^[:alnum:]]/, "_", $1)
+ printf "module_" $1 "_args_" v "=\""
+ for (i = 2; i <= NF; ++i) {
+ if (i > 2)
+ printf " "
+ printf $i
+ }
+ print "\"\n"
+ } else
+ print
+ }
+ END { print "\n### END: Auto-converted from " f "\n" }
+ ' "${f}" >> "${D}"/etc/conf.d/modules
+ done
+ rm -f "${f}"
+ rmdir "${ROOT}"/etc/modules.autoload.d 2>/dev/null
+ fi
+ fi
+}
+
+pkg_postinst() {
+ # Remove old baselayout links
+ rm -f "${ROOT}"/etc/runlevels/boot/{check{fs,root},rmnologin}
+
+ [[ -e ${T}/net && ! -e ${ROOT}/etc/conf.d/net ]] && mv "${T}"/net "${ROOT}"/etc/conf.d/net
+
+ # Make our runlevels if they don't exist
+ if [[ ! -e ${ROOT}/etc/runlevels ]] ; then
+ einfo "Copying across default runlevels"
+ cp -RPp "${ROOT}"/usr/share/${PN}/runlevels "${ROOT}"/etc
+ fi
+
+ # update the dependency tree bug #224171
+ [[ "${ROOT}" = "/" ]] && "${ROOT}/${LIBDIR}"/rc/bin/rc-depend -u
+
+ if [[ -d ${ROOT}/etc/modules.autoload.d ]] ; then
+ ewarn "/etc/modules.autoload.d is no longer used. Please convert"
+ ewarn "your files to /etc/conf.d/modules and delete the directory."
+ fi
+
+ elog "You should now update all files in /etc, using etc-update"
+ elog "or equivalent before restarting any services or this host."
+ elog
+ elog "Please read the migration guide available at:"
+ elog "http://www.gentoo.org/doc/en/openrc-migration.xml"
+}
diff --git a/overlay/sys-cluster/beowulf-head/Manifest b/overlay/sys-cluster/beowulf-head/Manifest
index 618925d..f043833 100644
--- a/overlay/sys-cluster/beowulf-head/Manifest
+++ b/overlay/sys-cluster/beowulf-head/Manifest
@@ -1,3 +1,9 @@
+AUX c3-add 686 RMD160 ede4fc8bb832046607e79f831942a3d0708cbcab SHA1 cb496f8137065e2559caea38d932f3a07340d170 SHA256 e0195e7b6dcc77465b768c746825bcfec0157c3a6e5e0e4e1f1336521ecef0d6
+AUX c3-del 104 RMD160 18b49c1a929b0fc08912692f41ec8df1313c940d SHA1 b7d66c89d64fcb7a32a8d62cb147dcaf2994c3e7 SHA256 f4e3e9431c40b50f1596816eaa4d1f760ab840ae555d5fa2a76a7672d0432dfa
AUX cluster.conf 2393 RMD160 2ccb24e8f2cb83d8a002fc239d0be6bb7968ed4d SHA1 ad4cc8ff8b8f2f4270755f387228efb0cc63c048 SHA256 660478b6763cc3c6190541bb46d5d17a01a5e366ac8ce84551d1ae31f2eb1673
-EBUILD beowulf-head-0.1.ebuild 6118 RMD160 603098747d9f6364ebbf366db57aff0bc2ab2f02 SHA1 a7e7bfad77e95ab6a872ee34a4412c4e57255fb3 SHA256 7220faed9f98222b04e6aa182d2bb9a6539db5ea59756980c2b7ed3be0960cf4
+AUX dnsmasq-2.4-conf 1552 RMD160 08dae8ff1cd345acedb4cbbb819f8ccf35211b8b SHA1 e770ba62ca66b61cd84409bbb22433b1dfcf9ff3 SHA256 f2b63d6fc8558c84e79b5f172c4057354bdfe000aae19f8aa1857655259a6b7f
+AUX node-manager 1574 RMD160 bda5378e456c567947504fc95a3db4163c214517 SHA1 d1ca1142b31019b9edc3827dc5c9c9ad7b1ed996 SHA256 fd2f94e4f58aea91f0d11ea87f6f18f160782721956455f3892dae5e435827db
+AUX torque-add 183 RMD160 30eae769ed05dabdc144d1e8259fd14f1f97a152 SHA1 dc2ece4b1a890557193b7dfad28e8696af7529c2 SHA256 d4ea4b509d47044f2e445b0fd36beb64eb35143ac62ccbaa4ac8905b8a12746e
+AUX torque-del 132 RMD160 bc1e0a9ccc6ce20630003f7372d62bdb705b9187 SHA1 c735f03fb6715ab601cb84f4fbc92be78ce43575 SHA256 c455764846f192930625721958532d3cee64aa75d9d83a37b67544e4c7bdee64
+EBUILD beowulf-head-0.1.ebuild 7273 RMD160 966e7332fcfdac3560b29e7e8be7dff866630c2a SHA1 911e996fae639424abec535b05e256091f13e61c SHA256 ef70453c432338f42ba9b6ccb7aa4a0a591fef5c9a7935cfd516761d73fe9eae
MISC ChangeLog 101 RMD160 d735719ccc09237e68e4e984eb5451000b06c382 SHA1 79098d1e8ae451f0430d363da6b717966ade6e78 SHA256 8dd010e2772026c4a6b86839842931b99c85c44a5e9f380864cc275b55587ac2
diff --git a/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild b/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild
index bdc1252..4e85bff 100644
--- a/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild
+++ b/overlay/sys-cluster/beowulf-head/beowulf-head-0.1.ebuild
@@ -9,7 +9,7 @@ SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~x86"
-IUSE="autofs nonfsv4"
+IUSE="autofs nonfsv4 beep pbs"
DEPEND=""
RDEPEND="net-nds/ldap-auth
@@ -18,34 +18,47 @@ RDEPEND="net-nds/ldap-auth
net-misc/sipcalc
net-fs/nfs-utils
sys-cluster/c3
- net-dns/openresolv"
+ net-dns/openresolv
+ beep? (app-misc/beep)
+ pbs? (sys-cluster/torque)"
CONFPATH="/etc/gentoo"
CONFIG_FILE="cluster.conf"
+MODULESPATH="/usr/libexec/clustering/"
+DNSMASQSCRIPT="/usr/sbin/node-manager"
inherit confutils
get_ip_config()
{
CLUSTER_ETH_IP="$(sipcalc ${CLUSTER_ETH} | egrep 'Host address\W*-' | cut -d- -f2)"
- RANGE_START="$(sipcalc ${CLUSTER_ETH} | egrep 'Host address\W*-' | cut -d- -f2)"
- IPSTART="${RANGE_START%.*}.$(( ${RANGE_START##*.} +1 ))"
- IPSTOP="$( sipcalc ${CLUSTER_ETH} | egrep 'Usable range\W*-' | cut -d- -f3)"
- SUBNET="$( sipcalc ${CLUSTER_ETH} | egrep 'Network mask\W*-' | cut -d- -f2)"
- NETADDR="$( sipcalc ${CLUSTER_ETH} | egrep 'Network address' | cut -d- -f2)"
+ IPSTART="${CLUSTER_ETH_IP%.*}.$(( ${CLUSTER_ETH_IP##*.} +1 ))"
+ IPSTOP=" $(sipcalc ${CLUSTER_ETH} | egrep 'Usable range\W*-' | cut -d- -f3)"
+ SUBNET=" $(sipcalc ${CLUSTER_ETH} | egrep 'Network mask\W*-' | cut -d- -f2)"
+ NETADDR=" $(sipcalc ${CLUSTER_ETH} | egrep 'Network address' | cut -d- -f2)"
NODECOUNT="$(sipcalc ${CLUSTER_ETH} | egrep 'Addresses in network'| cut -d- -f2)"
# We have to clean up the vars from spaces:
CLUSTER_ETH_IP=${CLUSTER_ETH_IP// }
- RANGE_START=${RANGE_START// }
IPSTART=${IPSTART// }
IPSTOP=${IPSTOP// }
SUBNET=${SUBNET// }
NETADDR=${NETADDR// }
+ NODECOUNT=$(($NODECOUNT-2)) # removing server host + broadcast
}
dnsmasq_conf()
{
+# The following (commneted) would be much cleaner but this can't work in the livecd environment since the portage tree doesn't exist
+# and the template file is thus non-existant (${FILESDIR}/...) .
+# cp ${FILESDIR}/dnsmasq-2.4-conf ${ROOT}/etc/dnsmasq.conf
+#
+# for I in PUBETH LOCALDOMAINNAME TFTPROOT IPSTART IPSTOP SUBNET CLUSTER_ETH_IP PXELINUX HOSTNAME NFSROOT NODECOUNT DNSMASQSCRIPT
+# do
+# sed -i -e"s:%%$I:${!I}:g" ${ROOT}/etc/dnsmasq.conf
+# done
+# cp
+
cat > ${ROOT}/etc/dnsmasq.conf <<-EOF
# For the sake of non-duplication of documentation, please view the dnsmasq manpage for a description of these options.
# Public interface
@@ -62,6 +75,8 @@ dnsmasq_conf()
# We need the following to retain dhcp served resolution info:
resolv-file=/etc/dnsmasq-resolv.conf
+ dhcp-script=$DNSMASQSCRIPT
+
# Some netiquette:
domain-needed
bogus-priv
@@ -190,11 +205,30 @@ pkg_setup() {
use autofs && die "We're not there yet ;)"
}
-src_install()
-{
- dodir ${CONFPATH}
+src_unpack(){
+ mkdir -p ${S}
+ cp ${FILESDIR}/node-manager ${S}/node-manager || die "Som ting Wong"
+ sed -ie "s:%%MODULESPATH:$MODULESPATH:" ${S}/node-manager
+ if use beep ; then
+ sed -ie "s:%%BEEPS:true:" ${S}/node-manager
+ else
+ sed -ie "s:%%BEEPS:false:" ${S}/node-manager
+ fi
+}
+
+src_install(){
+ dodir ${CONFPATH}
insinto ${CONFPATH}
- doins ${FILESDIR}/${CONFIG_FILE}
+ doins ${FILESDIR}/${CONFIG_FILE}
+
+ dosbin ${S}/node-manager
+
+ # add and delnode are derived from the dnsmasq add/del/old directives
+ # passed onto the node-manager script...don't change arbritrarily
+ dodir ${MODULESPATH}
+ exeinto ${MODULESPATH}
+ doexe ${FILESDIR}/c3-*
+ use pbs && doexe ${FILESDIR}/torque-*
elog "You need to edit ${CONFPATH}/${CONFIG_FILE} to your likings"
elog "Once you are done, set CONFIG_OK=\"yes\" in there and"
diff --git a/overlay/sys-cluster/beowulf-head/files/c3-add b/overlay/sys-cluster/beowulf-head/files/c3-add
index 71782e9..b05dc1a 100755
--- a/overlay/sys-cluster/beowulf-head/files/c3-add
+++ b/overlay/sys-cluster/beowulf-head/files/c3-add
@@ -1,15 +1,15 @@
#!/bin/bash
-C3CONF=./c3.conf
-TMP=/tmp/$0-$$
+C3CONF=/etc/c3.conf
+TMP=/tmp/$(basename $0)-$$
NODES=${TMP}_NODES
exec > $TMP
shopt -s xpg_echo
-echo "# This files was automatically created by $PWD/$0 and shouldn't be manually modified unless $0 is disabled."
-echo "# This file descriptor is inefficient for the sake of code simplicity"
+echo "# This file was automatically created by $PWD/$0 and shouldn't be manually modified unless $0 is disabled."
+echo "# This file structure is inefficient for the sake of code simplicity"
# define the cluster
echo "cluster gentoo {"
@@ -20,7 +20,7 @@ echo "\t$HOSTNAME"
# Extract the pre-defined nodes from the existing file
egrep -v -e"({|}|#|$HOSTNAME)" $C3CONF > $NODES
echo "\t$4" >> $NODES
-cat $NODES | sort -g
+cat $NODES | sort -g | uniq | egrep -v "(^$|^\W$)"
# End of config file:
echo "}"
diff --git a/overlay/sys-cluster/beowulf-head/files/c3-del b/overlay/sys-cluster/beowulf-head/files/c3-del
index 33990ee..af7284e 100755
--- a/overlay/sys-cluster/beowulf-head/files/c3-del
+++ b/overlay/sys-cluster/beowulf-head/files/c3-del
@@ -1,7 +1,7 @@
#!/bin/bash
-C3CONF=./c3.conf
-TMP=/tmp/$0-$$
+C3CONF=/etc/c3.conf
+TMP=/tmp/$(basename $0)-$$
grep -v $4 $C3CONF > $TMP
diff --git a/overlay/sys-cluster/beowulf-head/files/dnsmasq-2.4-conf b/overlay/sys-cluster/beowulf-head/files/dnsmasq-2.4-conf
index fa3f257..c99d2df 100644
--- a/overlay/sys-cluster/beowulf-head/files/dnsmasq-2.4-conf
+++ b/overlay/sys-cluster/beowulf-head/files/dnsmasq-2.4-conf
@@ -13,6 +13,8 @@ expand-hosts
# We need the following to retain dhcp served resolution info:
resolv-file=/etc/dnsmasq-resolv.conf
+dhcp-script=/usr/sbin/node-manager
+
# Some netiquette:
domain-needed
bogus-priv
diff --git a/overlay/sys-cluster/beowulf-head/files/node-manager b/overlay/sys-cluster/beowulf-head/files/node-manager
index 4b6c9b0..a0493bb 100755
--- a/overlay/sys-cluster/beowulf-head/files/node-manager
+++ b/overlay/sys-cluster/beowulf-head/files/node-manager
@@ -3,7 +3,7 @@
# but it can also be used to manage the manual insertion and deletion of nodes.
# Make sure dnsmasq doesn't come an play against you though.
-%%MODULESPATH
+MODULESPATH=%%MODULESPATH
BEEPS=%%BEEPS
run_modules(){
@@ -24,8 +24,10 @@ node_is_alive(){
# Nodes can either be added or removed. For a thorough description of the mechanism, see
# dnsmasq's manpage section concerning dhcp-script
old_node(){
- if [[ ! node_is_alive ]]; then
- shift
+ shift
+ if [[ node_is_alive ]]; then
+ $0 add $*
+ else
$0 del $*
fi
}
@@ -35,7 +37,14 @@ usage(){
echo "$0 <add|del|old> <MAC address> <IP address> <hostname>"
}
-(( $# != 3 )) && { usage; exit 1 };
+
+if [[ $# != 4 ]]; then
+# We just ignore the call without a hostname
+# usage;
+#
+ exit 0;
+fi
+
##### Variables #######
COMMAND=$1
@@ -50,14 +59,16 @@ STOP=2000
STEP=200
BEEP_add="$(for I in `seq $START $STEP $STOP`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)"
BEEP_del="$(for I in `seq $STOP -$STEP $START`; do echo -n " -f $I -l $PAUSE -r 1 -n"; done)"
-BEEP_add="beep ${BEEPS_add%%-n}"
-BEEP_del="beep ${BEEPS_del%%-n}"
+BEEP_add="beep ${BEEP_add%%-n}"
+BEEP_del="beep ${BEEP_del%%-n}"
##### Variables END ###
if [[ $COMMAND == "old" ]]
then
- old_node $@
+ # we background this since it performs a ping with a 1second timeout
+ # on a 256 node system, those seconds add up...
+ old_node $@ &
else
run_modules $@
fi
diff --git a/overlay/sys-cluster/beowulf-head/files/torque-add b/overlay/sys-cluster/beowulf-head/files/torque-add
index 73d8957..01f251d 100755
--- a/overlay/sys-cluster/beowulf-head/files/torque-add
+++ b/overlay/sys-cluster/beowulf-head/files/torque-add
@@ -1,7 +1,7 @@
#!/bin/bash
-TMP=/tmp/$0-$$
+TMP=/tmp/$(basename $0)-$$
NODES=$PBS_SERVER_HOME/server_priv/nodes
echo $4 >> $TMP
-cat $TMP | sort -g > $NODES
-
+cat $NODES $TMP | sort -g | uniq | egrep -v "(^$|^\W$)" > $NODES.
+mv $NODES.$$ $NODES
diff --git a/overlay/sys-cluster/beowulf-head/files/torque-del b/overlay/sys-cluster/beowulf-head/files/torque-del
index 09a8935..5648a07 100755
--- a/overlay/sys-cluster/beowulf-head/files/torque-del
+++ b/overlay/sys-cluster/beowulf-head/files/torque-del
@@ -1,7 +1,7 @@
#!/bin/bash
-TMP=/tmp/$0-$$
+TMP=/tmp/$(basename $0)-$$
NODES=$PBS_SERVER_HOME/server_priv/nodes
-grep -v $4 $NODES > $TMP
-mv $TMP $NODES
+grep -v $4 $NODES > $NODES.$$
+mv $NODES.$$ $NODES