From: Evan Broder Date: Tue, 4 Nov 2008 09:09:27 +0000 (-0500) Subject: Initial invirt-cluster-config package for configuring cman and clvm X-Git-Tag: 0.0.1^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-cluster-config.git/commitdiff_plain/9d1dcefa8207897bc949c116b9e4ddbac797461a Initial invirt-cluster-config package for configuring cman and clvm svn path=/trunk/packages/invirt-cluster-config/; revision=1520 --- 9d1dcefa8207897bc949c116b9e4ddbac797461a diff --git a/cluster.conf.mako b/cluster.conf.mako new file mode 100644 index 0000000..44b1541 --- /dev/null +++ b/cluster.conf.mako @@ -0,0 +1,12 @@ +<% +from invirt.config import structs as cfg +%>\ + + + + +% for id, host in enumerate(cfg.hosts): + +% endfor + + \ No newline at end of file diff --git a/cman.mako b/cman.mako new file mode 100644 index 0000000..9bd9a00 --- /dev/null +++ b/cman.mako @@ -0,0 +1,4 @@ +<% +import os +%>\ +NODENAME="${os.uname()[1].split('.')[0]}" \ No newline at end of file diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..6fe4f3e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +invirt-cluster-config (0.0.1) unstable; urgency=low + + * Initial Release. + + -- Evan Broder Sat, 01 Nov 2008 15:43:41 -0400 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..81fba8b --- /dev/null +++ b/debian/control @@ -0,0 +1,14 @@ +Source: invirt-cluster-config +Section: servers +Priority: extra +Maintainer: Invirt project +Build-Depends: cdbs, debhelper (>= 5), config-package-dev, lvm2 +Standards-Version: 3.8.0 + +Package: invirt-cluster-config +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, invirt-base, + invirt-storage-config, cman, clvm +Description: Cluster configuration for the Invirt project + This package should be installed on all Invirt host machines to + configure Redhat Clustering and clustering LVM diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..381dc35 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,17 @@ +This software was written for the XVM project +of the MIT Student Information Processing Board. + +Copyright : + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + +On Debian systems, the complete text of the GNU General Public License +can be found in the file /usr/share/common-licenses/GPL. diff --git a/debian/invirt-cluster-config.init b/debian/invirt-cluster-config.init new file mode 100644 index 0000000..49e720a --- /dev/null +++ b/debian/invirt-cluster-config.init @@ -0,0 +1,16 @@ +#!/bin/bash +### BEGIN INIT INFO +# Provides: invirt-cluster-config +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Invirt clustering configuration +# Description: Configure Redhat clustering and clustering LVM +### END INIT INFO + +PACKAGE=invirt-cluster-config +GEN_FILES=(/etc/default/cman /etc/cluster/cluster.conf) + +. /lib/init/config-init.sh +config_init "$1" diff --git a/debian/invirt-cluster-config.install b/debian/invirt-cluster-config.install new file mode 100644 index 0000000..ac5cb1c --- /dev/null +++ b/debian/invirt-cluster-config.install @@ -0,0 +1,2 @@ +cluster.conf.mako etc/cluster +cman.mako etc/default \ No newline at end of file diff --git a/debian/invirt-cluster-config.postinst b/debian/invirt-cluster-config.postinst new file mode 100644 index 0000000..4939055 --- /dev/null +++ b/debian/invirt-cluster-config.postinst @@ -0,0 +1,40 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +case "$1" in + configure) + invoke-rc.d cman restart + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..4597cfa --- /dev/null +++ b/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +DEB_DIVERT_EXTENSION = .invirt +DEB_TRANSFORM_FILES_invirt-cluster-config += \ + /etc/lvm/lvm.conf.invirt + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk diff --git a/debian/transform_lvm.conf.invirt b/debian/transform_lvm.conf.invirt new file mode 100755 index 0000000..faa7592 --- /dev/null +++ b/debian/transform_lvm.conf.invirt @@ -0,0 +1,6 @@ +#!/usr/bin/perl -0p +s/^( *locking_type = )1.*$/$1 = 2/m or die; +s/^( *fallback_to_clustered_locking = ).*$/$1 = 0/m or die; +s/^( *fallback_to_local_locking = ).*$/$1 = 0/m or die; +s/^( *)# *(locking_library.*)$/$1$2/m or die; +s/^( *)# *(library_dir.*)$/$1$2/m or die;