--- ctdb-1.0.80.orig/debian/copyright +++ ctdb-1.0.80/debian/copyright @@ -0,0 +1,122 @@ +This package was debianized by: + + Mathieu Parent on Tue, 15 Jan 2008 23:43:47 +0100. + +It was downloaded from: + + + +Upstream Authors: + + Andrew Tridgell + Ronnie Sahlberg + Michael Adam + Peter Somogyi + Volker Lendecke + +Copyright: + + Copyright (C) Andrew Tridgell 2006-2008 + Copyright (C) Ronnie sahlberg 2007 + +License: + + 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 3 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, see http://www.gnu.org/licenses/. + +The Debian packaging is: + + Copyright (C) 2008-2009, Mathieu Parent + +and is licensed under the GPL version 3 or (at your option) any later version, +see above. + +=============================================================================== +This package also include the following libraries : + +In the following text, GPL3+ refers to : + 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 3 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. + + You should have received a copy of the GNU General Public License + along with this program; if not, see http://www.gnu.org/licenses/. + +On Debian systems, the complete text of the GNU General Public License +version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +In the following text, LGPL3+ refers to : + 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 3 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +On Debian systems, the complete text of the GNU Lesser General Public License +version 3 can be found in `/usr/share/common-licenses/LGPL-3'. + +------------------------------------------------------------------------------- +- lib/events/: GPL3+ +-- (C) Andrew Tridgell 2003-2007 +-- (C) Stefan Metzmacher 2005 + +------------------------------------------------------------------------------- +- lib/replace/: LGPL3+ +-- (C) The Regents of the University of California 1994 +-- (C) The PostgreSQL Global Development Group 1996-2007 +-- (C) Andrew Tridgell 1992-1998,2004,2005,2006 +-- (C) Kungliga Tekniska Högskolan 1997 +-- (C) Jelmer Vernooij 2006-2007 +-- (C) Jeremy Allison 1998-2002,2007 +-- (C) Internet Software Consortium 1996-2001 +-- (C) Patrick Powell 1995 +-- (C) Free Software Foundation, Inc. 1992-2000 + +------------------------------------------------------------------------------- +- lib/talloc/ : LGPL3+ +-- (C) Andrew Tridgell 2004-2005 +-- (C) Stefan Metzmacher 2006 + +------------------------------------------------------------------------------- +- lib/tdb/ is LGPL3+ ; +-- (C) Andrew Tridgell 1999-2005 +-- (C) Paul `Rusty' Russell 2000 +-- (C) Jeremy Allison 2000-2006 +-- (C) Andrew Esh 2001 +-- (C) Tim Potter 2004-2006 + +------------------------------------------------------------------------------- +- lib/util/: GPL3+ +-- (C) Volker Lendecke 2007 +-- (C) Concurrent Computer Corporation 2002 +-- (C) Andrew Tridgell 1998,2004-2005 +-- (C) Jelmer Vernooij 2005 + +------------------------------------------------------------------------------- +- ib/: GPL3+ +-- (C) Sven Oehme 2006 +-- (C) Peter Somogyi + --- ctdb-1.0.80.orig/debian/ctdb.docs +++ ctdb-1.0.80/debian/ctdb.docs @@ -0,0 +1 @@ +web --- ctdb-1.0.80.orig/debian/control +++ ctdb-1.0.80/debian/control @@ -0,0 +1,43 @@ +Source: ctdb +Section: net +Priority: extra +Maintainer: Debian Samba Maintainers +Uploaders: Mathieu Parent +Build-Depends: debhelper (>= 5), quilt (>= 0.40), libpopt-dev +Homepage: http://ctdb.samba.org/ +Standards-Version: 3.8.1 +XS-DM-Upload-Allowed: yes +Vcs-Svn: svn://svn.debian.org/pkg-samba/trunk/ctdb/ +Vcs-Browser: http://svn.debian.org/wsvn/pkg-samba/trunk/ctdb/ + +Package: ctdb +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base, lsof, ethtool, iproute, psmisc, tdb-tools +Suggests: logrotate +Description: clustered database to store temporary data + CTDB is a cluster implementation of the TDB database used by Samba and other + projects to store temporary data. If an application is already using TDB for + temporary data it is very easy to convert that application to be cluster aware + and use CTDB instead. + . + CTDB provides the same types of functions as TDB but in a clustered fashion, + providing a TDB-style database that spans multiple physical hosts in a cluster. + . + Features include: + * CTDB provides a TDB that has consistent data and consistent locking across + all nodes in a cluster. + * CTDB is very fast. + * In case of node failures, CTDB will automatically recover and repair all TDB + databases that it manages. + * CTDB is the core component that provides pCIFS ("parallel CIFS") with + Samba3/4. + * CTDB provides HA features such as node monitoring, node failover, and IP + takeover. + * CTDB provides a reliable messaging transport to allow applications linked + with CTDB to communicate to other instances of the application running on + different nodes in the cluster. + * CTDB has pluggable transport backends. Currently implemented backends are + TCP and Infiniband. + * CTDB supports a system of application specific management scripts, allowing + applications that depend on network or filesystem resources to be managed in + a highly available manner on a cluster. --- ctdb-1.0.80.orig/debian/ctdb.links +++ ctdb-1.0.80/debian/ctdb.links @@ -0,0 +1 @@ + --- ctdb-1.0.80.orig/debian/watch +++ ctdb-1.0.80/debian/watch @@ -0,0 +1,5 @@ +version=3 +opts=filenamemangle=s/^.*ctdb-([\d\.]+)/ctdb-$1/ \ +http://git.samba.org/?p=sahlberg/ctdb.git;a=tags \ +/\?p=sahlberg/ctdb.git;a=shortlog;h=refs/tags/ctdb-([\d\.]+) \ +debian debian/uupdate-wrapper --- ctdb-1.0.80.orig/debian/ctdb.logrotate +++ ctdb-1.0.80/debian/ctdb.logrotate @@ -0,0 +1,8 @@ +/var/log/log.ctdb { + weekly + missingok + rotate 7 + copytruncate + compress + notifempty +} --- ctdb-1.0.80.orig/debian/uupdate-wrapper +++ ctdb-1.0.80/debian/uupdate-wrapper @@ -0,0 +1,23 @@ +#!/bin/sh + +version=$2 +file=$3 + +#remove git log (only used by uscan) +rm $file +#pull source from git +git clone git://git.samba.org/sahlberg/ctdb.git;h=ctdb-$version +mv ctdb ctdb-$version.orig +#clean source +rm -rf ctdb-$version.orig/.git +#autogen +cd ctdb-$version.orig +./autogen.sh +cd .. +#remove included popt +rm -rf ctdb-$version.orig/lib/popt +#tar.gz +tar cfz ctdb_$version.orig.tar.gz ctdb-$version.orig +#remove orig directory +rm -rf ctdb-$version.orig + --- ctdb-1.0.80.orig/debian/changelog +++ ctdb-1.0.80/debian/changelog @@ -0,0 +1,154 @@ +ctdb (1.0.80-1) unstable; urgency=low + + * new upstream release + - 30_install_notify.sh_executable.diff included (this is upstream bug + https://bugzilla.samba.org/show_bug.cgi?id=6250) in 1.0.79 + - pkg-config shipped (Closes: #503209) + + -- Mathieu Parent Wed, 06 May 2009 16:49:02 +0200 + +ctdb (1.0.78-1) unstable; urgency=low + + * new upstream release + - updated 02_ctdb_diagnostics.diff + - updated ctdb.init (from 1.0.75 and 1.0.78) + * fix debian/uupdate-wrapper to use "git clone" instead of "git-clone" + * Updated Standards-Version to 3.8.1: no changes + * ctdb.init: update as in https://bugzilla.samba.org/show_bug.cgi?id=6225 + - Default-Stop: 0 1 6 + - renamed functions: start -> start_server, stop -> stop_server + * debian/copyright: adding Michael Adam to upstream authors + * added 30_install_notify.sh_executable.diff: to install /etc/ctdb/notify.sh + as executable (it is a shell script) + + -- Mathieu Parent Tue, 07 Apr 2009 19:24:10 +0200 + +ctdb (1.0.73-1) unstable; urgency=low + + * new upstream release + - most patches integrated. Thanks to Michael Adam. + - 06_services_names.diff: removed, distribution specific service names are + now known by scripts (samba, apache2) + - 25_popt_lib.diff: removed, integrated + - 30_ctdb_log.diff: removed, integrated (with some changes) + - debian/rules: use --with-logdir instead of --logdir + - 50_ctdbd_manpage_warning.diff: removed, integrated + * remove obsolete debian/README.build + + -- Mathieu Parent Fri, 06 Mar 2009 21:08:01 +0100 + +ctdb (1.0.71-2) unstable; urgency=low + + * upload to unstable + + -- Mathieu Parent Mon, 16 Feb 2009 20:27:04 +0100 + +ctdb (1.0.71-1) experimental; urgency=low + + * new upstream version + - from 1.0.71: 06_services_names.diff: samba patch not needed anymore + * updated debian/watch + * debian/copyright: updated, corrects lintian warning: + copyright-with-old-dh-make-debian-copyright + * 50_ctdbd_manpage_warning.diff: correct ctdbd(1) manpage warning + * debian/rules: install upstream changelog (taken from specfile) + * debian/copyright: refers to versionned license version + * Updated init script to better match upstream's one + + -- Mathieu Parent Tue, 03 Feb 2009 19:10:04 +0100 + +ctdb (1.0.65-1) experimental; urgency=low + + * New upstream git version + - from 1.0.63: make it possible to set the script log level in CTDB + sysconfig + - from 1.0.65: default debug level is 2 (NOTICE) and not 0 (ERROR) + * Maintenance enhancements: + * Added debian/watch, which points to latest sahlberg's version + * Added debian/uupdate-wrapper, called by uscan for new upstream version + * debian/rules: removed get-orig-source target in favour of uscan + * removed debian/build-orig (was used by get-orig-source target) + * Updated init script to better match upstream's one + * 02_ctdb_diagnostics.diff: + - keep rpm queries + - part concerning dpkg has been integrated upstream + * refreshed all patches + * 30_ctdb_log.diff: updated to prepare upstream inclusion + * debian/rules: added check-external-libs to check orig tarball for popt + * 02_ctdb_diagnostics.diff partially applied upstream (from 1.60) + + -- Mathieu Parent Sat, 15 Nov 2008 16:31:49 +0100 + +ctdb (1.0.47+git200807111148-1) unstable; urgency=low + + * New upstream git snapshot + * From 1.0.43: added CTDB_VALGRIND option to ctdb.init + * From 1.0.46: new option CTDB_SAMBA_SKIP_SHARE_CHECK + * From 1.0.46: make LVS a capability so that we can see which nodes are + configured with LVS and which are not using LVS + * From 1.0.47: Complete rewrite of onnode: Remove manpage links + * Bump standards version to 3.8.0 (no changes needed) + * Remove patch 04_install_chmod, applied upstream + (see https://bugzilla.samba.org/show_bug.cgi?id=5216) + * Remove ctdb.TODO: was only containing lintian warnings + + -- Mathieu Parent Fri, 11 Jul 2008 22:08:16 +0200 + +ctdb (1.0.42+git200806131353-1) unstable; urgency=low + + * New upstream git snapshot + * From 1.0.35: Add ability to disable recmaster and lmaster roles through + sysconfig file and command line arguments + * From 1.0.38: Use tdbdump to verify that all persistent database files are + good before we start the daemon. + * Added symlinks from onnode manpage to onnode.rsh and onnode.ssh ones: + remove two lintian warnings + * Fixed bashism in /etc/init.d/ctdb script, we don't use the suggested patch + as we don't want to depend on gettext (Closes: #486027). + * use svn-buildpackage (upstream tarball is now in svn) + + -- Mathieu Parent Sat, 14 Jun 2008 12:33:25 +0200 + +ctdb (1.0.34+git200804242206-1) unstable; urgency=low + + * New upstream git snapshot + * added CTDB_START_AS_DISABLED parameter to ctdb.init + * removed 03_web.diff, replaced by sed replaces in debian/rules + + -- Mathieu Parent Mon, 12 May 2008 22:58:07 +0200 + +ctdb (1.0.31+git200803251111-1) unstable; urgency=low + + * new upstream git snapshot, from git://git.samba.org/sahlberg/ctdb.git + * changed maintener name to CamelCase + + -- Mathieu Parent Wed, 26 Mar 2008 19:15:44 +0100 + +ctdb (1.0.28+git200802191444-1) unstable; urgency=low + + * new upstream git snapshot + * dropped 05_nice_service.diff, merged upstream + * updated 04_install_chmod.patch, half has been merged upstream + * updated 06_services_names, nfs is not patched anymore + * new patch 30_ctdb_log (thanks to danp) + * fixed missing copyright + ** remove popt from upstream tarball (changing get-orig-source target) + ** added 25_popt_lib to build with system popt lib + ** completed copyright file + + -- Mathieu Parent Wed, 13 Feb 2008 21:43:33 +0100 + +ctdb (1.0.28+git200802081512-1) unstable; urgency=low + + * Initial release (Closes: #460114) + * 02_ctdb_diagnostics.diff: adapt ctdb_diagnostics to debian + * 03_web.diff: correct various paths in documentation + * 04_install_chmod.patch: correct Makefile to install proper execution + permissions + * 05_nice_service.diff: create a nice_service function + * 06_services_names.diff: correct services names + * init script with start/stop/status + * logrotate for /var/log/log.ctdb + + -- Mathieu Parent Tue, 15 Jan 2008 23:16:44 +0100 + --- ctdb-1.0.80.orig/debian/svn-deblayout +++ ctdb-1.0.80/debian/svn-deblayout @@ -0,0 +1,3 @@ +origDir=../ctdb-upstream +buildArea=../../build-area + --- ctdb-1.0.80.orig/debian/compat +++ ctdb-1.0.80/debian/compat @@ -0,0 +1 @@ +5 --- ctdb-1.0.80.orig/debian/ctdb.init +++ ctdb-1.0.80/debian/ctdb.init @@ -0,0 +1,342 @@ +#!/bin/sh +# +############################## +# ctdb: Starts the clustered tdb daemon +# +# chkconfig: - 90 36 +# +# description: Starts and stops the clustered tdb daemon +# pidfile: /var/run/ctdbd/ctdbd.pid +# + +### BEGIN INIT INFO +# Provides: ctdb +# Required-Start: $network $local_fs $remote_fs +# Required-Stop: $network $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: start and stop ctdb service +# Description: initscript for the ctdb service +### END INIT INFO + + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +DAEMON=/usr/sbin/ctdbd +NAME=ctdb +DESC="Clustered TDB" + +test -x $DAEMON || exit 0 + +#LSB +if [ -f /lib/lsb/init-functions ] ; then + . /lib/lsb/init-functions +fi +if ! type 'log_daemon_msg' >/dev/null; then + log_daemon_msg () { + if [ -z "${1:-}" ]; then + return 1 + fi + + if [ -z "${2:-}" ]; then + echo -n "$1:" + return + fi + + echo -n "$1: $2" + } +fi +if ! type 'log_progress_msg' >/dev/null; then + log_progress_msg () { + if [ -z "${1:-}" ]; then + return 1 + fi + echo -n " $@" + } +fi +if ! type 'log_end_msg' >/dev/null; then + log_end_msg () { + # If no arguments were passed, return + if [ -z "${1:-}" ]; then + return 1 + fi + + retval=$1 + + if [ $1 -eq 0 ]; then + echo "." + elif [ $1 -eq 255 ]; then + /bin/echo -e " (warning)." + else + /bin/echo -e " failed!" + fi + return $retval + } +fi + +# Source function library. +if [ -f /etc/init.d/functions ] ; then + . /etc/init.d/functions +elif [ -f /etc/rc.d/init.d/functions ] ; then + . /etc/rc.d/init.d/functions +fi + +#gettext +if [ -f /usr/bin/gettext.sh ] ; then + . /usr/bin/gettext.sh +fi +if ! type 'eval_gettext' >/dev/null; then + eval_gettext() { + echo -n "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1") + } +fi + +[ -f /etc/rc.status ] && { + . /etc/rc.status + rc_reset + LC_ALL=en_US.UTF-8 +} + +# Avoid using root's TMPDIR +unset TMPDIR + +[ -z "$CTDB_BASE" ] && { + export CTDB_BASE="/etc/ctdb" +} + +. $CTDB_BASE/functions +loadconfig network +loadconfig ctdb + +set -e + +# check networking is up (for redhat) +[ "${NETWORKING}" = "no" ] && exit 0 + +[ -z "$CTDB_RECOVERY_LOCK" ] && { + echo "You must configure the location of the CTDB_RECOVERY_LOCK" + exit 1 +} +CTDB_OPTIONS="$CTDB_OPTIONS --reclock=$CTDB_RECOVERY_LOCK" + +# build up CTDB_OPTIONS variable from optional parameters +[ -z "$CTDB_LOGFILE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --logfile=$CTDB_LOGFILE" +[ -z "$CTDB_NODES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --nlist=$CTDB_NODES" +[ -z "$CTDB_SOCKET" ] || CTDB_OPTIONS="$CTDB_OPTIONS --socket=$CTDB_SOCKET" +[ -z "$CTDB_PUBLIC_ADDRESSES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --public-addresses=$CTDB_PUBLIC_ADDRESSES" +[ -z "$CTDB_PUBLIC_INTERFACE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --public-interface=$CTDB_PUBLIC_INTERFACE" +[ -z "$CTDB_SINGLE_PUBLIC_IP" ] || CTDB_OPTIONS="$CTDB_OPTIONS --single-public-ip=$CTDB_SINGLE_PUBLIC_IP" +[ -z "$CTDB_DBDIR" ] || CTDB_OPTIONS="$CTDB_OPTIONS --dbdir=$CTDB_DBDIR" +[ -z "$CTDB_DBDIR_PERSISTENT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --dbdir-persistent=$CTDB_DBDIR_PERSISTENT" +[ -z "$CTDB_EVENT_SCRIPT_DIR" ] || CTDB_OPTIONS="$CTDB_OPTIONS --event-script-dir $CTDB_EVENT_SCRIPT_DIR" +[ -z "$CTDB_TRANSPORT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --transport $CTDB_TRANSPORT" +[ -z "$CTDB_DEBUGLEVEL" ] || CTDB_OPTIONS="$CTDB_OPTIONS -d $CTDB_DEBUGLEVEL" +[ -z "$CTDB_NOTIFY_SCRIPT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --notification-script=$CTDB_NOTIFY_SCRIPT" +[ -z "$CTDB_START_AS_DISABLED" ] || [ "$CTDB_START_AS_DISABLED" != "yes" ] || { + CTDB_OPTIONS="$CTDB_OPTIONS --start-as-disabled" +} +[ -z "$CTDB_CAPABILITY_RECMASTER" ] || [ "$CTDB_CAPABILITY_RECMASTER" != "no" ] || { + CTDB_OPTIONS="$CTDB_OPTIONS --no-recmaster" +} +[ -z "$CTDB_CAPABILITY_LMASTER" ] || [ "$CTDB_CAPABILITY_LMASTER" != "no" ] || { + CTDB_OPTIONS="$CTDB_OPTIONS --no-lmaster" +} +[ -z "$CTDB_LVS_PUBLIC_IP" ] || { + CTDB_OPTIONS="$CTDB_OPTIONS --lvs --single-public-ip=$CTDB_LVS_PUBLIC_IP" +} +[ -z "$CTDB_SCRIPT_LOG_LEVEL" ] || { + CTDB_OPTIONS="$CTDB_OPTIONS --script-log-level=$CTDB_SCRIPT_LOG_LEVEL" +} + +detect_init_style +export CTDB_INIT_STYLE + +if [ "x$CTDB_VALGRIND" = "xyes" ]; then + init_style="valgrind" +else + init_style="$CTDB_INIT_STYLE" +fi + +set_retval() { + return $1 +} + +running() { + ctdb ping > /dev/null 2>&1 || return 1 + return 0 +} + +start_server() { + # check all persistent databases that they look ok + case $init_style in + ubuntu) + PERSISTENT_DB_DIR="/var/lib/ctdb/persistent" + ;; + *) + PERSISTENT_DB_DIR="/var/ctdb/persistent" + ;; + esac + [ -z "$CTDB_DBDIR" ] || { + PERSISTENT_DB_DIR="$CTDB_DBDIR/persistent" + } + mkdir -p $PERSISTENT_DB_DIR 2>/dev/null + for PDBASE in `ls $PERSISTENT_DB_DIR/*.tdb.[0-9] 2>/dev/null`; do + /usr/bin/tdbdump $PDBASE >/dev/null 2>/dev/null || { + echo "Persistent database $PDBASE is corrupted! CTDB will not start." + return 1 + } + done + + case $init_style in + valgrind) + valgrind -q --log-file=/var/log/ctdb_valgrind /usr/sbin/ctdbd --nosetsched $CTDB_OPTIONS + RETVAL=0 + ;; + suse) + startproc /usr/sbin/ctdbd $CTDB_OPTIONS + rc_status -v + RETVAL=$? + ;; + redhat) + daemon ctdbd $CTDB_OPTIONS + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1 + ;; + ubuntu) + start-stop-daemon --start --quiet --background --exec /usr/sbin/ctdbd -- $CTDB_OPTIONS + RETVAL=$? + ;; + esac + + sleep 1 + # set any tunables from the config file + set | grep ^CTDB_SET_ | cut -d_ -f3- | + while read v; do + varname=`echo $v | cut -d= -f1` + value=`echo $v | cut -d= -f2` + ctdb setvar $varname $value || RETVAL=1 + done || exit 1 + + return $RETVAL +} + +stop_server() { + ctdb shutdown + RETVAL=$? + count=0 + if [ "$init_style" = "valgrind" ]; then + # very crude method + sleep 2 + pkill -9 -f valgrind + else if [ "$init_style" = "ubuntu" ]; then + start-stop-daemon --stop --quiet --exec /usr/sbin/ctdbd + RETVAL=$? + fi + fi + while killall -q -0 ctdbd; do + sleep 1 + count=`expr $count + 1` + [ $count -gt 10 ] && { + eval_gettext "killing ctdbd " + killall -q -9 ctdbd + pkill -9 -f $CTDB_BASE/events.d/ + } + done + case $init_style in + suse) + # re-set the return code to the recorded RETVAL + # in order to print the correct status message + set_retval $RETVAL + rc_status -v + ;; + redhat) + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ctdb + echo "" + ;; + esac + return $RETVAL +} + +case "$1" in + start) + log_daemon_msg "Starting $DESC " "$NAME" + # Check if it's running first + if running ; then + log_progress_msg "already running" + log_end_msg 0 + exit 0 + fi + if start_server && running ; then + # It's ok, the server started and is running + log_end_msg 0 + else + # Either we could not start it or it is not running + # after we did + log_end_msg 1 + fi + ;; + stop) + log_daemon_msg "Stopping $DESC" "$NAME" + if running ; then + # Only stop the server if we see it running + stop_server + log_end_msg $? + else + # If it's not running don't do anything + log_progress_msg "not running" + log_end_msg 0 + exit 0 + fi + ;; + restart|reload|force-reload) + log_daemon_msg "Restarting $DESC" "$NAME" + running && stop_server + start_server + running + log_end_msg $? + ;; + status) + log_daemon_msg "Checking status of $DESC" "$NAME" + if running ; then + log_progress_msg "running" + echo + ctdb status + log_end_msg 0 + else + log_progress_msg "not running" + log_end_msg 1 + exit 1 + fi + ;; + condrestart) + if running ; then + log_daemon_msg "Restarting $DESC" "$NAME" + stop_server + start_server + log_end_msg $? + fi + ;; + cron) + # used from cron to auto-restart ctdb + if ! running ; then + log_daemon_msg "Starting $DESC " "$NAME" + if start_server && running ; then + # It's ok, the server started and is running + log_end_msg 0 + else + # Either we could not start it or it is not running + # after we did + log_end_msg 1 + fi + fi + ;; + *) + eval_gettext "Usage: $0 {start|stop|restart|status|cron|condrestart}" >&2 + echo >&2 + exit 1 + ;; +esac + +exit $? --- ctdb-1.0.80.orig/debian/rules +++ ctdb-1.0.80/debian/rules @@ -0,0 +1,138 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +# Set the host and build architectures for use with config.cache loading, +# cross-building, etc. +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) + +export DEB_HOST_GNU_TYPE +export DEB_BUILD_GNU_TYPE +export DEB_HOST_ARCH_OS + +CFLAGS = -g -Wall + +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +include /usr/share/quilt/quilt.make + +DESTDIR=$(CURDIR)/debian/ctdb + +conf_args = \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var/lib \ + --with-logdir=/var/log + +configure: patch configure-stamp +configure-stamp: + dh_testdir + CFLAGS="$(CFLAGS)" ./configure $(conf_args) + touch configure-stamp + +#Architecture +build: check-external-libs build-arch build-indep + +build-arch: build-arch-stamp +build-arch-stamp: patch configure-stamp + + [ ! -f Makefile ] || $(MAKE) + +build-indep: build-indep-stamp +build-indep-stamp: patch configure-stamp + + touch $@ + +clean: clean-patched unpatch + +clean-patched: + dh_testdir + dh_testroot + rm -f build-arch-stamp build-indep-stamp configure-stamp + rm -f utils/smnotify/smnotify.h utils/smnotify/gen_smnotify.c + + rm -rf $(DESTDIR) + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +install: install-indep install-arch +install-indep: + dh_testdir + dh_testroot + dh_clean -k -i + dh_installdirs -i + + dh_install -i + +install-arch: + dh_testdir + dh_testroot + dh_clean -k -s + dh_installdirs -s + + # Create the target build directory hierarchy + mkdir -p $(DESTDIR)/etc/init.d + mkdir -p $(DESTDIR)/etc/default + $(MAKE) DESTDIR=$(DESTDIR) install + install -m644 config/ctdb.sysconfig $(DESTDIR)/etc/default/ctdb + dh_install -s +binary-common: + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + #patch doc + sed -i 's|/etc/sysconfig/|/etc/default/|' $(DESTDIR)/usr/share/doc/ctdb/web/*.html + #upstream changelog + grep -A 10000 '%changelog' packaging/RPM/ctdb.spec > $(DESTDIR)/usr/share/doc/ctdb/changelog + dh_installexamples + dh_installlogrotate + #install init script + DH_OPTIONS= dh_installinit -pctdb --no-start --no-restart-on-upgrade + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb +# Build architecture independant packages using the common target. +binary-indep: build-indep install-indep + $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common + +# Build architecture dependant packages using the common target. +binary-arch: build-arch install-arch + $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common + +binary: binary-arch binary-indep + +check-external-libs: + if [ -e lib/popt ]; then \ + echo " *****************************************"; \ + echo " ** **"; \ + echo " ** tar contains external libraries! **"; \ + echo " ** **"; \ + echo " *****************************************"; \ + echo "The tarball should be made by using uscan or"; \ + echo "debian/uupdate-wrapper"; \ + echo ""; \ + exit 1; \ + fi + +.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure patch unpatch --- ctdb-1.0.80.orig/debian/patches/series +++ ctdb-1.0.80/debian/patches/series @@ -0,0 +1 @@ +02_ctdb_diagnostics.diff --- ctdb-1.0.80.orig/debian/patches/02_ctdb_diagnostics.diff +++ ctdb-1.0.80/debian/patches/02_ctdb_diagnostics.diff @@ -0,0 +1,21 @@ +Goal: adapt ctdb_diagnostics to debian + +/etc/sysconfig/ is replaced by /etc/default/ + +Author: Mathieu Parent + +Upstream status: Debian specific + +Index: b/tools/ctdb_diagnostics +=================================================================== +--- a/tools/ctdb_diagnostics ++++ b/tools/ctdb_diagnostics +@@ -6,7 +6,7 @@ + + # list of config files that must exist and that we check are the same + # on all nodes +-CONFIG_FILES_MUST="/etc/krb5.conf /etc/hosts /etc/ctdb/nodes /etc/sysconfig/ctdb /etc/resolv.conf /etc/nsswitch.conf /etc/sysctl.conf /etc/samba/smb.conf /etc/fstab /etc/multipath.conf /etc/pam.d/system-auth /etc/sysconfig/nfs /etc/exports /etc/vsftpd/vsftpd.conf" ++CONFIG_FILES_MUST="/etc/krb5.conf /etc/hosts /etc/ctdb/nodes /etc/default/ctdb /etc/resolv.conf /etc/nsswitch.conf /etc/sysctl.conf /etc/samba/smb.conf /etc/fstab /etc/multipath.conf /etc/pam.d/system-auth /etc/default/nfs /etc/exports /etc/vsftpd/vsftpd.conf" + + # list of config files that may exist and should be checked that they + # are the same on all nodes