[Pkg-samba-maint] r2942 - in branches/ctdb/lenny-backports: . debian debian/patches
mparent-guest at alioth.debian.org
mparent-guest at alioth.debian.org
Mon Jul 13 17:50:37 UTC 2009
tags 530064 pending
tags 530413 pending
tags 528976 pending
tags 503209 pending
thanks
Author: mparent-guest
Date: 2009-07-13 17:50:35 +0000 (Mon, 13 Jul 2009)
New Revision: 2942
Added:
branches/ctdb/lenny-backports/debian/patches/05-hurd.diff
branches/ctdb/lenny-backports/debian/patches/10_no-lib64.diff
branches/ctdb/lenny-backports/debian/patches/50-fix-bashism.diff
Modified:
branches/ctdb/lenny-backports/
branches/ctdb/lenny-backports/debian/changelog
branches/ctdb/lenny-backports/debian/control
branches/ctdb/lenny-backports/debian/copyright
branches/ctdb/lenny-backports/debian/ctdb.init
branches/ctdb/lenny-backports/debian/patches/02_ctdb_diagnostics.diff
branches/ctdb/lenny-backports/debian/patches/series
branches/ctdb/lenny-backports/debian/uupdate-wrapper
Log:
Backport 1.0.85-1~bpo50+1
Property changes on: branches/ctdb/lenny-backports
___________________________________________________________________
Deleted: svn:mergeinfo
-
Modified: branches/ctdb/lenny-backports/debian/changelog
===================================================================
--- branches/ctdb/lenny-backports/debian/changelog 2009-07-11 11:35:44 UTC (rev 2941)
+++ branches/ctdb/lenny-backports/debian/changelog 2009-07-13 17:50:35 UTC (rev 2942)
@@ -1,9 +1,68 @@
-ctdb (1.0.73-1~bpo50+1) lenny-backports; urgency=low
+ctdb (1.0.85-1~bpo50+1) lenny-backports; urgency=low
* Rebuild for lenny-backports.
- -- Mathieu Parent <math.parent at gmail.com> Sun, 08 Mar 2009 14:14:05 +0100
+ -- Mathieu Parent <math.parent at gmail.com> Mon, 13 Jul 2009 19:47:45 +0200
+ctdb (1.0.85-1) unstable; urgency=low
+
+ * new upstream release
+ - update ctdb.init:
+ + obsolete ipmux component removed
+ + Initscript fixes
+ + respects the $CTDBD environment variable
+ * Bump standards version to 3.8.2 (no changes needed)
+
+ -- Mathieu Parent <math.parent at gmail.com> Tue, 23 Jun 2009 21:49:50 +0200
+
+ctdb (1.0.82-2) unstable; urgency=low
+
+ * 10_no-lib64.diff updated: Don't Ship files in /usr/lib64 only on amd64
+ * 50-fix-bashism.diff (new): Fix "bashism in /bin/sh script"
+ (Closes: #530064)
+ * lsof in Suggests instead of Depends as it is only used by ctdb_diagnostics
+ * ethtool in Recommends instead of Depends as it is only used by
+ /etc/ctdb/events.d/10.interface
+ * GNU Hurd support: Closes: #530413
+ - Build-Depends on libpcap-dev [hurd-i386]
+ - Depends on iproute [!hurd-i386]
+ - 05-hurd.diff: fix configure script and support Hurd
+ - thanks to Marc Dequènes (Duck)
+
+ -- Mathieu Parent <math.parent at gmail.com> Sun, 31 May 2009 18:02:41 +0200
+
+ctdb (1.0.82-1) unstable; urgency=low
+
+ * new upstream release
+ * 10_no-lib64.diff (new): Don't Ship files in /usr/lib64 (Closes: #528976)
+
+ -- Mathieu Parent <math.parent at gmail.com> Sun, 17 May 2009 16:59:36 +0200
+
+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 <math.parent at gmail.com> 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 <math.parent at gmail.com> Tue, 07 Apr 2009 19:24:10 +0200
+
ctdb (1.0.73-1) unstable; urgency=low
* new upstream release
Modified: branches/ctdb/lenny-backports/debian/control
===================================================================
--- branches/ctdb/lenny-backports/debian/control 2009-07-11 11:35:44 UTC (rev 2941)
+++ branches/ctdb/lenny-backports/debian/control 2009-07-13 17:50:35 UTC (rev 2942)
@@ -3,17 +3,18 @@
Priority: extra
Maintainer: Debian Samba Maintainers <pkg-samba-maint at lists.alioth.debian.org>
Uploaders: Mathieu Parent <math.parent at gmail.com>
-Build-Depends: debhelper (>= 5), quilt (>= 0.40), libpopt-dev
+Build-Depends: debhelper (>= 5), quilt (>= 0.40), libpopt-dev, libpcap-dev [hurd-i386]
Homepage: http://ctdb.samba.org/
-Standards-Version: 3.8.0
+Standards-Version: 3.8.2
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
+Depends: ${shlibs:Depends}, ${misc:Depends}, lsb-base, iproute [!hurd-i386], psmisc, tdb-tools
+Recommends: ethtool
+Suggests: logrotate, lsof
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
Modified: branches/ctdb/lenny-backports/debian/copyright
===================================================================
--- branches/ctdb/lenny-backports/debian/copyright 2009-07-11 11:35:44 UTC (rev 2941)
+++ branches/ctdb/lenny-backports/debian/copyright 2009-07-13 17:50:35 UTC (rev 2942)
@@ -10,6 +10,7 @@
Andrew Tridgell
Ronnie Sahlberg
+ Michael Adam
Peter Somogyi
Volker Lendecke
Modified: branches/ctdb/lenny-backports/debian/ctdb.init
===================================================================
--- branches/ctdb/lenny-backports/debian/ctdb.init 2009-07-11 11:35:44 UTC (rev 2941)
+++ branches/ctdb/lenny-backports/debian/ctdb.init 2009-07-13 17:50:35 UTC (rev 2942)
@@ -10,34 +10,87 @@
#
### BEGIN INIT INFO
-# Provides: ctdb
-# Required-Start: $network $local_fs $remote_fs
-# Required-Stop: $network $local_fs $remote_fs
-# Default-Stop:
-# Default-Start: 2 3 4 5
-# Short-Description: start and stop ctdb service
-# Description: initscript for the ctdb service
+# 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
+DAEMON=${CTDBD:-/usr/sbin/ctdbd}
NAME=ctdb
DESC="Clustered TDB"
test -x $DAEMON || exit 0
-test -x $DAEMON_WRAPPER || exit 0
-# Source function library.
+#LSB
if [ -f /lib/lsb/init-functions ] ; then
. /lib/lsb/init-functions
-elif [ -f /etc/init.d/functions ] ; then
+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
@@ -72,12 +125,12 @@
[ -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"
}
@@ -88,7 +141,7 @@
CTDB_OPTIONS="$CTDB_OPTIONS --no-lmaster"
}
[ -z "$CTDB_LVS_PUBLIC_IP" ] || {
- CTDB_OPTIONS="$CTDB_OPTIONS --lvs"
+ 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"
@@ -108,15 +161,20 @@
}
running() {
- ps -e | awk '{print $4}' | grep "^ctdbd$" > /dev/null && return 0
- return 1
+ pkill -0 -f $DAEMON || return 1
+ return 0
}
-start() {
- killall -q ctdbd
-
+start_server() {
# check all persistent databases that they look ok
- PERSISTENT_DB_DIR="/var/lib/ctdb/persistent"
+ 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"
}
@@ -130,22 +188,24 @@
case $init_style in
valgrind)
- valgrind -q --log-file=/var/log/ctdb_valgrind /usr/sbin/ctdbd --nosetsched $CTDB_OPTIONS
+ valgrind -q --log-file=/var/log/ctdb_valgrind \
+ $DAEMON --nosetsched $CTDB_OPTIONS
RETVAL=0
;;
suse)
- startproc /usr/sbin/ctdbd $CTDB_OPTIONS
+ startproc $DAEMON $CTDB_OPTIONS
rc_status -v
RETVAL=$?
;;
redhat)
- daemon ctdbd $CTDB_OPTIONS
+ daemon $DAEMON $CTDB_OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
;;
- debian|ubuntu)
- start-stop-daemon --start --quiet --background --exec /usr/sbin/ctdbd -- $CTDB_OPTIONS
+ ubuntu)
+ start-stop-daemon --start --quiet --background \
+ --exec $DAEMON -- $CTDB_OPTIONS
RETVAL=$?
;;
esac
@@ -162,25 +222,20 @@
return $RETVAL
}
-stop() {
- ctdb shutdown
+stop_server() {
+ ctdb shutdown >/dev/null 2>&1
RETVAL=$?
count=0
- if [ "$init_style" = "valgrind" ]; then
- # very crude method
- sleep 2
- pkill -9 -f valgrind
- else if [ "$init_style" = "debian" ]; then
- start-stop-daemon --stop --quiet --exec /usr/sbin/ctdbd
+ if [ "$init_style" = "ubuntu" ]; then
+ start-stop-daemon --stop --quiet --exec $DAEMON
RETVAL=$?
- fi
fi
- while killall -q -0 ctdbd; do
+ while pkill -0 -f $DAEMON ; do
sleep 1
count=`expr $count + 1`
[ $count -gt 10 ] && {
- echo -n "killing ctdbd "
- killall -q -9 ctdbd
+ eval_gettext "killing ctdbd "
+ pkill -9 -f $DAEMON
pkill -9 -f $CTDB_BASE/events.d/
}
done
@@ -200,42 +255,29 @@
return $RETVAL
}
-restart() {
- stop
- start
-}
-
-status() {
- ctdb status
-}
-
-
case "$1" in
- start)
- log_daemon_msg "Starting $DESC " "$NAME"
+ 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 && running ; then
+ 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
- # NOTE: Some servers might die some time after they start,
- # this code does not try to detect this and might give
- # a false positive (use 'status' for that)
log_end_msg 1
fi
- ;;
- stop)
+ ;;
+ stop)
log_daemon_msg "Stopping $DESC" "$NAME"
if running ; then
# Only stop the server if we see it running
- stop
+ stop_server
log_end_msg $?
else
# If it's not running don't do anything
@@ -243,33 +285,54 @@
log_end_msg 0
exit 0
fi
- ;;
- restart|force-reload)
+ ;;
+ restart|reload|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
- running && stop
- start
+ running && stop_server
+ start_server
running
log_end_msg $?
- ;;
- status)
-
+ ;;
+ status)
log_daemon_msg "Checking status of $DESC" "$NAME"
if running ; then
log_progress_msg "running"
- echo
- status
+ echo
+ ctdb status
log_end_msg 0
else
log_progress_msg "not running"
- log_end_msg 0
- exit 3
+ 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
;;
- *)
- N=/etc/init.d/$NAME
- echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
- exit 1
- ;;
+ *)
+ eval_gettext "Usage: $0 {start|stop|restart|status|cron|condrestart}" >&2
+ echo >&2
+ exit 1
+ ;;
esac
exit $?
Modified: branches/ctdb/lenny-backports/debian/patches/02_ctdb_diagnostics.diff
===================================================================
--- branches/ctdb/lenny-backports/debian/patches/02_ctdb_diagnostics.diff 2009-07-11 11:35:44 UTC (rev 2941)
+++ branches/ctdb/lenny-backports/debian/patches/02_ctdb_diagnostics.diff 2009-07-13 17:50:35 UTC (rev 2942)
@@ -6,16 +6,16 @@
Upstream status: Debian specific
-Index: ctdb-1.0.51/tools/ctdb_diagnostics
+Index: b/tools/ctdb_diagnostics
===================================================================
---- ctdb-1.0.51.orig/tools/ctdb_diagnostics 2008-08-01 22:04:20.000000000 +0200
-+++ ctdb-1.0.51/tools/ctdb_diagnostics 2008-08-01 22:05:07.000000000 +0200
-@@ -4,7 +4,7 @@
+--- a/tools/ctdb_diagnostics
++++ b/tools/ctdb_diagnostics
+@@ -6,7 +6,7 @@
- PATH="$PATH:/sbin:/usr/sbin:/usr/lpp/mmfs/bin"
+ # 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"
--CONFIG_FILES="/etc/krb5.conf /etc/hosts /etc/ctdb/nodes /etc/sysconfig/ctdb /etc/ctdb/public_addresses /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="/etc/krb5.conf /etc/hosts /etc/ctdb/nodes /etc/default/ctdb /etc/ctdb/public_addresses /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"
-
- 2>&1
-
+ # list of config files that may exist and should be checked that they
+ # are the same on all nodes
Copied: branches/ctdb/lenny-backports/debian/patches/05-hurd.diff (from rev 2941, trunk/ctdb/debian/patches/05-hurd.diff)
===================================================================
--- branches/ctdb/lenny-backports/debian/patches/05-hurd.diff (rev 0)
+++ branches/ctdb/lenny-backports/debian/patches/05-hurd.diff 2009-07-13 17:50:35 UTC (rev 2942)
@@ -0,0 +1,434 @@
+Goal: GNU Hurd port
+
+Author: Marc Dequènes (Duck) <duck at duckcorp.org>
+
+Upstream status: TODO
+
+Index: ctdb-1.0.82/configure
+===================================================================
+--- ctdb-1.0.82.orig/configure 2009-05-24 17:51:12.000000000 +0200
++++ ctdb-1.0.82/configure 2009-05-24 18:19:57.000000000 +0200
+@@ -1865,6 +1865,11 @@
+ CTDB_SCSI_IO=
+ CTDB_PCAP_LDFLAGS=-lpcap
+ ;;
++ GNU*)
++ CTDB_SYSTEM_OBJ=common/system_gnu.o
++ CTDB_SCSI_IO=
++ CTDB_PCAP_LDFLAGS=-lpcap
++ ;;
+ *)
+ echo unknown system cant configure
+ exit
+Index: ctdb-1.0.82/configure.ac
+===================================================================
+--- ctdb-1.0.82.orig/configure.ac 2009-05-24 17:50:47.000000000 +0200
++++ ctdb-1.0.82/configure.ac 2009-05-24 18:19:50.000000000 +0200
+@@ -36,6 +36,11 @@
+ CTDB_SCSI_IO=
+ CTDB_PCAP_LDFLAGS=-lpcap
+ ;;
++ GNU*)
++ CTDB_SYSTEM_OBJ=common/system_gnu.o
++ CTDB_SCSI_IO=
++ CTDB_PCAP_LDFLAGS=-lpcap
++ ;;
+ *)
+ echo unknown system cant configure
+ exit
+Index: ctdb-1.0.82/server/ctdb_daemon.c
+===================================================================
+--- ctdb-1.0.82.orig/server/ctdb_daemon.c 2009-05-24 17:50:48.000000000 +0200
++++ ctdb-1.0.82/server/ctdb_daemon.c 2009-05-24 17:51:12.000000000 +0200
+@@ -532,6 +532,7 @@
+ int fd;
+ struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
+ struct ctdb_client *client;
++#if ! defined(__GNU__)
+ #ifdef _AIX
+ struct peercred_struct cr;
+ socklen_t crl = sizeof(struct peercred_struct);
+@@ -539,6 +540,7 @@
+ struct ucred cr;
+ socklen_t crl = sizeof(struct ucred);
+ #endif
++#endif
+
+ memset(&addr, 0, sizeof(addr));
+ len = sizeof(addr);
+@@ -551,6 +553,7 @@
+ set_close_on_exec(fd);
+
+ client = talloc_zero(ctdb, struct ctdb_client);
++#if ! defined(__GNU__)
+ #ifdef _AIX
+ if (getsockopt(fd, SOL_SOCKET, SO_PEERID, &cr, &crl) == 0) {
+ #else
+@@ -558,6 +561,7 @@
+ #endif
+ talloc_asprintf(client, "struct ctdb_client: pid:%u", (unsigned)cr.pid);
+ }
++#endif
+
+ client->ctdb = ctdb;
+ client->fd = fd;
+Index: ctdb-1.0.82/common/system_gnu.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ ctdb-1.0.82/common/system_gnu.c 2009-05-24 18:18:47.000000000 +0200
+@@ -0,0 +1,355 @@
++/*
++ ctdb system specific code to manage raw sockets on linux
++
++ Copyright (C) Ronnie Sahlberg 2007
++ Copyright (C) Andrew Tridgell 2007
++ Copyright (C) Marc Dequènes (Duck) 2009
++
++ 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/>.
++
++
++ This file is a copy of 'common/system_linux.c' adapted for Hurd needs,
++ and inspired by 'common/system_aix.c' for the pcap usage.
++*/
++
++#include "includes.h"
++#include "system/network.h"
++#include "system/filesys.h"
++#include "system/wait.h"
++#include "../include/ctdb_private.h"
++#include "lib/events/events.h"
++#include <net/ethernet.h>
++#include <netinet/ip6.h>
++#include <net/if_arp.h>
++#include <pcap.h>
++
++
++#ifndef ETHERTYPE_IP6
++#define ETHERTYPE_IP6 0x86dd
++#endif
++
++/*
++ calculate the tcp checksum for tcp over ipv6
++*/
++static uint16_t tcp_checksum6(uint16_t *data, size_t n, struct ip6_hdr *ip6)
++{
++ uint32_t phdr[2];
++ uint32_t sum = 0;
++ uint16_t sum2;
++
++ sum += uint16_checksum((uint16_t *)(void *)&ip6->ip6_src, 16);
++ sum += uint16_checksum((uint16_t *)(void *)&ip6->ip6_dst, 16);
++
++ phdr[0] = htonl(n);
++ phdr[1] = htonl(ip6->ip6_nxt);
++ sum += uint16_checksum((uint16_t *)phdr, 8);
++
++ sum += uint16_checksum(data, n);
++
++ sum = (sum & 0xFFFF) + (sum >> 16);
++ sum = (sum & 0xFFFF) + (sum >> 16);
++ sum2 = htons(sum);
++ sum2 = ~sum2;
++ if (sum2 == 0) {
++ return 0xFFFF;
++ }
++ return sum2;
++}
++
++/*
++ send gratuitous arp reply after we have taken over an ip address
++
++ saddr is the address we are trying to claim
++ iface is the interface name we will be using to claim the address
++ */
++int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
++{
++ /* We dont do grat arp on Hurd yet */
++ return 0;
++}
++
++
++/*
++ simple TCP checksum - assumes data is multiple of 2 bytes long
++ */
++static uint16_t tcp_checksum(uint16_t *data, size_t n, struct iphdr *ip)
++{
++ uint32_t sum = uint16_checksum(data, n);
++ uint16_t sum2;
++ sum += uint16_checksum((uint16_t *)(void *)&ip->saddr,
++ sizeof(ip->saddr));
++ sum += uint16_checksum((uint16_t *)(void *)&ip->daddr,
++ sizeof(ip->daddr));
++ sum += ip->protocol + n;
++ sum = (sum & 0xFFFF) + (sum >> 16);
++ sum = (sum & 0xFFFF) + (sum >> 16);
++ sum2 = htons(sum);
++ sum2 = ~sum2;
++ if (sum2 == 0) {
++ return 0xFFFF;
++ }
++ return sum2;
++}
++
++/*
++ Send tcp segment from the specified IP/port to the specified
++ destination IP/port.
++
++ This is used to trigger the receiving host into sending its own ACK,
++ which should trigger early detection of TCP reset by the client
++ after IP takeover
++
++ This can also be used to send RST segments (if rst is true) and also
++ if correct seq and ack numbers are provided.
++ */
++int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
++ const ctdb_sock_addr *src,
++ uint32_t seq, uint32_t ack, int rst)
++{
++ int s;
++ int ret;
++ uint32_t one = 1;
++ uint16_t tmpport;
++ ctdb_sock_addr *tmpdest;
++ struct {
++ struct iphdr ip;
++ struct tcphdr tcp;
++ } ip4pkt;
++ struct {
++ struct ip6_hdr ip6;
++ struct tcphdr tcp;
++ } ip6pkt;
++
++ switch (src->ip.sin_family) {
++ case AF_INET:
++ ZERO_STRUCT(ip4pkt);
++ ip4pkt.ip.version = 4;
++ ip4pkt.ip.ihl = sizeof(ip4pkt.ip)/4;
++ ip4pkt.ip.tot_len = htons(sizeof(ip4pkt));
++ ip4pkt.ip.ttl = 255;
++ ip4pkt.ip.protocol = IPPROTO_TCP;
++ ip4pkt.ip.saddr = src->ip.sin_addr.s_addr;
++ ip4pkt.ip.daddr = dest->ip.sin_addr.s_addr;
++ ip4pkt.ip.check = 0;
++
++ ip4pkt.tcp.source = src->ip.sin_port;
++ ip4pkt.tcp.dest = dest->ip.sin_port;
++ ip4pkt.tcp.seq = seq;
++ ip4pkt.tcp.ack_seq = ack;
++ ip4pkt.tcp.ack = 1;
++ if (rst) {
++ ip4pkt.tcp.rst = 1;
++ }
++ ip4pkt.tcp.doff = sizeof(ip4pkt.tcp)/4;
++ /* this makes it easier to spot in a sniffer */
++ ip4pkt.tcp.window = htons(1234);
++ ip4pkt.tcp.check = tcp_checksum((uint16_t *)&ip4pkt.tcp, sizeof(ip4pkt.tcp), &ip4pkt.ip);
++
++ /* open a raw socket to send this segment from */
++ s = socket(AF_INET, SOCK_RAW, htons(IPPROTO_RAW));
++ if (s == -1) {
++ DEBUG(DEBUG_CRIT,(__location__ " failed to open raw socket (%s)\n",
++ strerror(errno)));
++ return -1;
++ }
++
++ ret = setsockopt(s, IPPROTO_IP, IP_HDRINCL, &one, sizeof(one));
++ if (ret != 0) {
++ DEBUG(DEBUG_CRIT,(__location__ " failed to setup IP headers (%s)\n",
++ strerror(errno)));
++ close(s);
++ return -1;
++ }
++
++ set_nonblocking(s);
++ set_close_on_exec(s);
++
++ ret = sendto(s, &ip4pkt, sizeof(ip4pkt), 0, &dest->ip, sizeof(dest->ip));
++ close(s);
++ if (ret != sizeof(ip4pkt)) {
++ DEBUG(DEBUG_CRIT,(__location__ " failed sendto (%s)\n", strerror(errno)));
++ return -1;
++ }
++ break;
++ case AF_INET6:
++ ZERO_STRUCT(ip6pkt);
++ ip6pkt.ip6.ip6_vfc = 0x60;
++ ip6pkt.ip6.ip6_plen = htons(20);
++ ip6pkt.ip6.ip6_nxt = IPPROTO_TCP;
++ ip6pkt.ip6.ip6_hlim = 64;
++ ip6pkt.ip6.ip6_src = src->ip6.sin6_addr;
++ ip6pkt.ip6.ip6_dst = dest->ip6.sin6_addr;
++
++ ip6pkt.tcp.source = src->ip6.sin6_port;
++ ip6pkt.tcp.dest = dest->ip6.sin6_port;
++ ip6pkt.tcp.seq = seq;
++ ip6pkt.tcp.ack_seq = ack;
++ ip6pkt.tcp.ack = 1;
++ if (rst) {
++ ip6pkt.tcp.rst = 1;
++ }
++ ip6pkt.tcp.doff = sizeof(ip6pkt.tcp)/4;
++ /* this makes it easier to spot in a sniffer */
++ ip6pkt.tcp.window = htons(1234);
++ ip6pkt.tcp.check = tcp_checksum6((uint16_t *)&ip6pkt.tcp, sizeof(ip6pkt.tcp), &ip6pkt.ip6);
++
++ s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);
++ if (s == -1) {
++ DEBUG(DEBUG_CRIT, (__location__ " Failed to open sending socket\n"));
++ return -1;
++
++ }
++ /* sendto() dont like if the port is set and the socket is
++ in raw mode.
++ */
++ tmpdest = discard_const(dest);
++ tmpport = tmpdest->ip6.sin6_port;
++
++ tmpdest->ip6.sin6_port = 0;
++ ret = sendto(s, &ip6pkt, sizeof(ip6pkt), 0, &dest->ip6, sizeof(dest->ip6));
++ tmpdest->ip6.sin6_port = tmpport;
++ close(s);
++
++ if (ret != sizeof(ip6pkt)) {
++ DEBUG(DEBUG_CRIT,(__location__ " failed sendto (%s)\n", strerror(errno)));
++ return -1;
++ }
++ break;
++
++ default:
++ DEBUG(DEBUG_CRIT,(__location__ " not an ipv4/v6 address\n"));
++ return -1;
++ }
++
++ return 0;
++}
++
++/*
++ This function is used to open a raw socket to capture from
++ */
++int ctdb_sys_open_capture_socket(const char *iface, void **private_data)
++{
++ pcap_t *pt;
++
++ pt=pcap_open_live(iface, 100, 0, 0, NULL);
++ if (pt == NULL) {
++ DEBUG(DEBUG_CRIT,("Failed to open capture device %s\n", iface));
++ return -1;
++ }
++ *((pcap_t **)private_data) = pt;
++
++ return pcap_fileno(pt);
++}
++
++/* This function is used to close the capture socket
++ */
++int ctdb_sys_close_capture_socket(void *private_data)
++{
++ pcap_t *pt = (pcap_t *)private_data;
++ pcap_close(pt);
++ return 0;
++}
++
++
++/*
++ called when the raw socket becomes readable
++ */
++int ctdb_sys_read_tcp_packet(int s, void *private_data,
++ ctdb_sock_addr *src, ctdb_sock_addr *dst,
++ uint32_t *ack_seq, uint32_t *seq)
++{
++ int ret;
++#define RCVPKTSIZE 100
++ char pkt[RCVPKTSIZE];
++ struct ether_header *eth;
++ struct iphdr *ip;
++ struct ip6_hdr *ip6;
++ struct tcphdr *tcp;
++
++ ret = recv(s, pkt, RCVPKTSIZE, MSG_TRUNC);
++ if (ret < sizeof(*eth)+sizeof(*ip)) {
++ return -1;
++ }
++
++ /* Ethernet */
++ eth = (struct ether_header *)pkt;
++
++ /* we want either IPv4 or IPv6 */
++ if (ntohs(eth->ether_type) == ETHERTYPE_IP) {
++ /* IP */
++ ip = (struct iphdr *)(eth+1);
++
++ /* We only want IPv4 packets */
++ if (ip->version != 4) {
++ return -1;
++ }
++ /* Dont look at fragments */
++ if ((ntohs(ip->frag_off)&0x1fff) != 0) {
++ return -1;
++ }
++ /* we only want TCP */
++ if (ip->protocol != IPPROTO_TCP) {
++ return -1;
++ }
++
++ /* make sure its not a short packet */
++ if (offsetof(struct tcphdr, ack_seq) + 4 +
++ (ip->ihl*4) + sizeof(*eth) > ret) {
++ return -1;
++ }
++ /* TCP */
++ tcp = (struct tcphdr *)((ip->ihl*4) + (char *)ip);
++
++ /* tell the caller which one we've found */
++ src->ip.sin_family = AF_INET;
++ src->ip.sin_addr.s_addr = ip->saddr;
++ src->ip.sin_port = tcp->source;
++ dst->ip.sin_family = AF_INET;
++ dst->ip.sin_addr.s_addr = ip->daddr;
++ dst->ip.sin_port = tcp->dest;
++ *ack_seq = tcp->ack_seq;
++ *seq = tcp->seq;
++
++ return 0;
++ } else if (ntohs(eth->ether_type) == ETHERTYPE_IP6) {
++ /* IP6 */
++ ip6 = (struct ip6_hdr *)(eth+1);
++
++ /* we only want TCP */
++ if (ip6->ip6_nxt != IPPROTO_TCP) {
++ return -1;
++ }
++
++ /* TCP */
++ tcp = (struct tcphdr *)(ip6+1);
++
++ /* tell the caller which one we've found */
++ src->ip6.sin6_family = AF_INET6;
++ src->ip6.sin6_port = tcp->source;
++ src->ip6.sin6_addr = ip6->ip6_src;
++
++ dst->ip6.sin6_family = AF_INET6;
++ dst->ip6.sin6_port = tcp->dest;
++ dst->ip6.sin6_addr = ip6->ip6_dst;
++
++ *ack_seq = tcp->ack_seq;
++ *seq = tcp->seq;
++
++ return 0;
++ }
++
++ return -1;
++}
++
++
Copied: branches/ctdb/lenny-backports/debian/patches/10_no-lib64.diff (from rev 2941, trunk/ctdb/debian/patches/10_no-lib64.diff)
===================================================================
--- branches/ctdb/lenny-backports/debian/patches/10_no-lib64.diff (rev 0)
+++ branches/ctdb/lenny-backports/debian/patches/10_no-lib64.diff 2009-07-13 17:50:35 UTC (rev 2942)
@@ -0,0 +1,21 @@
+Goal: Don't ship files in /usr/lib64 for amd64 port
+
+See http://bugs.debian.org/528976
+
+Author: Mathieu Parent <math.parent at gmail.com>
+
+Upstream status: Debian specific
+
+Index: b/configure
+===================================================================
+--- a/configure
++++ b/configure
+@@ -1845,7 +1845,7 @@
+
+ if test "${libdir}" = '${exec_prefix}/lib'; then
+ case `uname -m` in
+- x86_64|ppc64|powerpc64)
++ ppc64|powerpc64)
+ libdir='${exec_prefix}/lib64'
+ ;;
+ *)
Copied: branches/ctdb/lenny-backports/debian/patches/50-fix-bashism.diff (from rev 2941, trunk/ctdb/debian/patches/50-fix-bashism.diff)
===================================================================
--- branches/ctdb/lenny-backports/debian/patches/50-fix-bashism.diff (rev 0)
+++ branches/ctdb/lenny-backports/debian/patches/50-fix-bashism.diff 2009-07-13 17:50:35 UTC (rev 2942)
@@ -0,0 +1,101 @@
+Goal: Fix bashism
+
+See http://bugs.debian.org/530064
+
+Author: Mathieu Parent <math.parent at gmail.com>
+
+Upstream status: https://bugzilla.samba.org/show_bug.cgi?id=6407
+
+Index: b/config/events.d/00.ctdb
+===================================================================
+--- a/config/events.d/00.ctdb
++++ b/config/events.d/00.ctdb
+@@ -27,7 +27,11 @@
+ # periodic vacuum function
+ periodic_vacuum() {
+ # this cleans up dead records and repacks the databases
+- ( time ctdb vacuum 200000 -T 30; time ctdb repack -T 30 ) > $CTDB_BASE/state/vacuum.log 2>&1 &
++ if [ "$(command -v time)" ]; then
++ ( time ctdb vacuum 200000 -T 30; time ctdb repack -T 30 ) > $CTDB_BASE/state/vacuum.log 2>&1 &
++ else
++ ( ctdb vacuum 200000 -T 30; ctdb repack -T 30 ) > $CTDB_BASE/state/vacuum.log 2>&1 &
++ fi
+ }
+
+ case $cmd in
+Index: b/config/events.d/11.natgw
+===================================================================
+--- a/config/events.d/11.natgw
++++ b/config/events.d/11.natgw
+@@ -44,7 +44,7 @@
+
+ delete_all
+
+- if [ "$MYPNN" == "$NATGWMASTER" ]; then
++ if [ "$MYPNN" = "$NATGWMASTER" ]; then
+ # This is the first node, set it up as the NAT GW
+ echo 1 >/proc/sys/net/ipv4/ip_forward
+ iptables -A POSTROUTING -t nat -s $CTDB_NATGW_PRIVATE_NETWORK -d ! $CTDB_NATGW_PRIVATE_NETWORK -j MASQUERADE
+Index: b/config/events.d/20.multipathd
+===================================================================
+--- a/config/events.d/20.multipathd
++++ b/config/events.d/20.multipathd
+@@ -52,7 +52,7 @@
+ timeleft=$(($timeleft - 1))
+
+ # see if the process still exists
+- kill -0 $pid > /dev/null 2>&1 || {
++ /bin/kill -0 $pid > /dev/null 2>&1 || {
+ # it doesn't exist, grab its exit status
+ wait $pid
+ [ $? = 0 ] || {
+@@ -87,7 +87,7 @@
+
+ monitor)
+ multipathd_check
+- [ "$?" == "0" ] || {
++ [ "$?" = "0" ] || {
+ echo 20.multipathd: monitoring of multipathing failed
+ exit 1
+ }
+Index: b/config/events.d/61.nfstickle
+===================================================================
+--- a/config/events.d/61.nfstickle
++++ b/config/events.d/61.nfstickle
+@@ -25,13 +25,12 @@
+ takeip)
+ iface=$1
+ ip=$2
+- shopt -s nullglob
+ # first send a grat arp, to ensure the client knows the updated
+ # mac address for this IP
+ ctdb gratiousarp $ip $iface
+ # send tickle acks for all the connections the old server had
+ for f in $NFS_TICKLE_SHARED_DIRECTORY/*/$ip; do
+- cat $f | while read dest; do
++ [ -f $f ] && cat $f | while read dest; do
+ dip=`echo $dest | cut -d: -f1`
+ dport=`echo $dest | cut -d: -f2`
+ # send three, in case of lost packets
+Index: b/config/events.d/50.samba
+===================================================================
+--- a/config/events.d/50.samba
++++ b/config/events.d/50.samba
+@@ -72,7 +72,7 @@
+ while [ $timeleft -gt 0 ]; do
+ timeleft=$(($timeleft - 1))
+ # see if the process still exists
+- kill -0 $pid > /dev/null 2>&1 || {
++ /bin/kill -0 $pid > /dev/null 2>&1 || {
+ # it doesn't exist, grab its exit status
+ wait $pid
+ [ $? = 0 ] || {
+@@ -98,7 +98,7 @@
+ done
+ # it took more than 10 seconds - kill it off
+ rm -f "${tmpfile}"
+- kill -9 "$pid" > /dev/null 2>&1
++ /bin/kill -9 "$pid" > /dev/null 2>&1
+ echo "50.samba: timed out updating smbconf cache in background"
+ exit 1
+ ) &
Modified: branches/ctdb/lenny-backports/debian/patches/series
===================================================================
--- branches/ctdb/lenny-backports/debian/patches/series 2009-07-11 11:35:44 UTC (rev 2941)
+++ branches/ctdb/lenny-backports/debian/patches/series 2009-07-13 17:50:35 UTC (rev 2942)
@@ -1 +1,4 @@
02_ctdb_diagnostics.diff
+05-hurd.diff
+10_no-lib64.diff
+50-fix-bashism.diff
Modified: branches/ctdb/lenny-backports/debian/uupdate-wrapper
===================================================================
--- branches/ctdb/lenny-backports/debian/uupdate-wrapper 2009-07-11 11:35:44 UTC (rev 2941)
+++ branches/ctdb/lenny-backports/debian/uupdate-wrapper 2009-07-13 17:50:35 UTC (rev 2942)
@@ -6,7 +6,7 @@
#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
+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
More information about the Pkg-samba-maint
mailing list