diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-04-23 11:00:16 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-04-23 11:00:16 +1000 |
commit | 646201f68e34fe1af90c4d2921eea78ae3f6337e (patch) | |
tree | 219634e6965a91b914870339ac0eb76e9015c22a | |
parent | e2c7475023ac21899f8109b787eee620ad93bb68 (diff) | |
parent | 8752745173dea554c111bdbcbcd405de88bc9f01 (diff) | |
download | samba-646201f68e34fe1af90c4d2921eea78ae3f6337e.tar.gz samba-646201f68e34fe1af90c4d2921eea78ae3f6337e.tar.xz samba-646201f68e34fe1af90c4d2921eea78ae3f6337e.zip |
Merge commit 'ronnie/master'
(This used to be ctdb commit 373a04d6a47a5c7cf8d822d60be1d9b9ab4df784)
-rw-r--r-- | ctdb/.gitignore | 1 | ||||
-rwxr-xr-x | ctdb/Makefile.in | 6 | ||||
-rwxr-xr-x | ctdb/autogen.sh | 2 | ||||
-rw-r--r-- | ctdb/config/events.d/11.natgw | 7 | ||||
-rw-r--r-- | ctdb/config/functions | 25 | ||||
-rw-r--r-- | ctdb/configure.ac | 11 | ||||
-rw-r--r-- | ctdb/ctdb.pc.in | 19 | ||||
-rw-r--r-- | ctdb/packaging/RPM/ctdb.spec | 11 |
8 files changed, 74 insertions, 8 deletions
diff --git a/ctdb/.gitignore b/ctdb/.gitignore index 826bc1a351..69d809385d 100644 --- a/ctdb/.gitignore +++ b/ctdb/.gitignore @@ -2,6 +2,7 @@ *~ config.status configure +ctdb.pc publish*.sh push*.sh web/packages diff --git a/ctdb/Makefile.in b/ctdb/Makefile.in index b67818f817..f1c5f369ab 100755 --- a/ctdb/Makefile.in +++ b/ctdb/Makefile.in @@ -188,12 +188,14 @@ distclean: clean rm -f Makefile install: all + mkdir -p $(DESTDIR)$(libdir)/pkgconfig mkdir -p $(DESTDIR)$(bindir) mkdir -p $(DESTDIR)$(sbindir) mkdir -p $(DESTDIR)$(includedir) mkdir -p $(DESTDIR)$(etcdir)/ctdb mkdir -p $(DESTDIR)$(etcdir)/ctdb/events.d mkdir -p $(DESTDIR)$(docdir)/ctdb + ${INSTALLCMD} -m 644 ctdb.pc $(DESTDIR)$(libdir)/pkgconfig ${INSTALLCMD} -m 755 bin/ctdb $(DESTDIR)$(bindir) ${INSTALLCMD} -m 755 bin/ctdb_ipmux $(DESTDIR)$(bindir) ${INSTALLCMD} -m 755 bin/ctdbd $(DESTDIR)$(sbindir) @@ -223,7 +225,7 @@ install: all if [ -f doc/ctdb.1 ];then ${INSTALLCMD} -m 644 doc/ctdb.1 $(DESTDIR)$(mandir)/man1; fi if [ -f doc/ctdbd.1 ];then ${INSTALLCMD} -m 644 doc/ctdbd.1 $(DESTDIR)$(mandir)/man1; fi if [ -f doc/onnode.1 ];then ${INSTALLCMD} -m 644 doc/onnode.1 $(DESTDIR)$(mandir)/man1; fi - if [ ! -f $(DESTDIR)$(etcdir)/ctdb/notify.sh ];then ${INSTALLCMD} -m 644 config/notify.sh $(DESTDIR)$(etcdir)/ctdb; fi + if [ ! -f $(DESTDIR)$(etcdir)/ctdb/notify.sh ];then ${INSTALLCMD} -m 755 config/notify.sh $(DESTDIR)$(etcdir)/ctdb; fi test: all tests/run_tests.sh @@ -233,4 +235,4 @@ valgrindtest: all realdistclean: distclean - rm -f configure config.h.in + rm -f configure config.h.in ctdb.pc diff --git a/ctdb/autogen.sh b/ctdb/autogen.sh index a361cd16e8..e3338987dc 100755 --- a/ctdb/autogen.sh +++ b/ctdb/autogen.sh @@ -1,7 +1,7 @@ #!/bin/sh rm -rf autom4te.cache -rm -f configure config.h.in +rm -f configure config.h.in ctdb.pc IPATHS="-I libreplace -I lib/replace -I ../libreplace -I ../replace" IPATHS="$IPATHS -I lib/talloc -I talloc -I ../talloc" diff --git a/ctdb/config/events.d/11.natgw b/ctdb/config/events.d/11.natgw index 2d256ba81c..1e0543d048 100644 --- a/ctdb/config/events.d/11.natgw +++ b/ctdb/config/events.d/11.natgw @@ -14,16 +14,17 @@ cmd="$1" shift PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH + delete_all() { - ip addr add $NATGW_PUBLIC_IP dev $NATGW_PUBLIC_IFACE >/dev/null 2>/dev/null - ip addr del $NATGW_PUBLIC_IP_HOST dev $NATGW_PRIVATE_IFACE >/dev/null 2>/dev/null + remove_ip $NATGW_PUBLIC_IP $NATGW_PUBLIC_IFACE + remove_ip $NATGW_PUBLIC_IP_HOST $NATGW_PRIVATE_IFACE + ip route del 0.0.0.0/0 metric 10 >/dev/null 2>/dev/null # Delete the masquerading setup from a previous iteration where we # were the NAT-GW iptables -D POSTROUTING -t nat -s $NATGW_PRIVATE_NETWORK -d ! $NATGW_PRIVATE_NETWORK -j MASQUERADE >/dev/null 2>/dev/null - ip addr del $NATGW_PUBLIC_IP dev $NATGW_PUBLIC_IFACE >/dev/null 2>/dev/null } case $cmd in diff --git a/ctdb/config/functions b/ctdb/config/functions index 2f0b01fe24..8b29fe4430 100644 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -438,6 +438,30 @@ startstop_nfslock() { } ######################################################## +# remove an ip address from an interface +######################################################## +remove_ip() { + # the ip tool will delete all secondary IPs if this is the primary. + # To work around this _very_ annoying behaviour we have to keep a + # record of the secondaries and re-add them afterwards. yuck + secondaries="" + if ip addr list dev $2 primary | grep -q "inet $1 " ; then + secondaries=`ip addr list dev $2 secondary | grep " inet " | awk '{print $2}'` + fi + ip addr del $1 dev $2 >/dev/null 2>/dev/null || failed=1 + [ -z "$secondaries" ] || { + for i in $secondaries; do + if ip addr list dev $2 | grep -q "inet $i" ; then + echo "kept secondary $i on dev $2" + else + echo "re-adding secondary address $i to dev $2" + ip addr add $i dev $2 || failed=1 + fi + done + } +} + +######################################################## # load a site local config file ######################################################## @@ -445,3 +469,4 @@ startstop_nfslock() { . $CTDB_BASE/rc.local } + diff --git a/ctdb/configure.ac b/ctdb/configure.ac index 8b6102da3a..a7bd2bb8d4 100644 --- a/ctdb/configure.ac +++ b/ctdb/configure.ac @@ -14,6 +14,15 @@ AC_DEFUN([SMB_ENABLE], [echo -n ""]) AC_INIT(ctdb.h) AC_CONFIG_SRCDIR([server/ctdbd.c]) +case `uname -m` in + x86_64) + libdir='${exec_prefix}/lib64' + ;; + *) + libdir='${exec_prefix}/lib' + ;; +esac + case `uname` in Linux*) CTDB_SYSTEM_OBJ=common/system_linux.o @@ -84,4 +93,4 @@ AC_SUBST(CTDB_SYSTEM_OBJ) AC_SUBST(CTDB_SCSI_IO) AC_SUBST(CTDB_PCAP_LDFLAGS) -AC_OUTPUT(Makefile) +AC_OUTPUT(Makefile ctdb.pc) diff --git a/ctdb/ctdb.pc.in b/ctdb/ctdb.pc.in new file mode 100644 index 0000000000..5f5bfab23c --- /dev/null +++ b/ctdb/ctdb.pc.in @@ -0,0 +1,19 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +datarootdir=@datarootdir@ +includedir=@includedir@ +libdir=@libdir@ +bindir=@bindir@ +sbindir=@sbindir@ +mandir=@mandir@ +localstatedir=@localstatedir@ +srcdir=@srcdir@ +etcdir=@sysconfdir@ + +Name: ctdb +Description: A clustered database to store temporary data +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} +Cflags: -I${includedir} +URL: http://ctdb.samba.org/ + diff --git a/ctdb/packaging/RPM/ctdb.spec b/ctdb/packaging/RPM/ctdb.spec index 7422150765..77bb0baeb5 100644 --- a/ctdb/packaging/RPM/ctdb.spec +++ b/ctdb/packaging/RPM/ctdb.spec @@ -4,7 +4,7 @@ Summary: Clustered TDB Vendor: Samba Team Packager: Samba Team <samba@samba.org> Name: ctdb -Version: 1.0.78 +Version: 1.0.79 Release: 1 Epoch: 0 License: GNU GPL version 3 @@ -128,8 +128,17 @@ fi %{_mandir}/man1/onnode.1.gz %{_includedir}/ctdb.h %{_includedir}/ctdb_private.h +%{_libdir}/pkgconfig/ctdb.pc %changelog +* Wed Apr 8 2009 : Version 1.0.79 + - From Mathieu Parent: add a ctdb pkgconfig file + - Fix bug 6250 + - add a funciton remove_ip to safely remove an ip from an interface, taking care to workaround an issue with linux alias interfaces. + - Update the natgw eventscript to use the safe remove_ip() function + - fix a bug in the eventscript child process that would cause the socket to be removed. + - dont verify nodemap on banned nodes during cluster monitoring + - Update the dodgy SeqnumInterval to have ms resolution * Tue Mar 31 2009 : Version 1.0.78 - Add a notify mechanism so we can send snmptraps/email to external management systems when the node becomes unhealthy - include 11.natgw eventscript in thew install so that the NATGW feature works |