summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohit Mehta <mohit.mehta@vyatta.com>2010-06-03 11:52:00 -0700
committerMohit Mehta <mohit.mehta@vyatta.com>2010-06-03 11:52:00 -0700
commit329359dd4817e7e33ac60094f4faaa84e51aca41 (patch)
tree5e5cefe6410eb883ef670662ca01e7cf9aa5240f
parent994eae7642c5834266c96fd74647819f4b6a0d36 (diff)
downloadvyatta-cluster-329359dd4817e7e33ac60094f4faaa84e51aca41.tar.gz
vyatta-cluster-329359dd4817e7e33ac60094f4faaa84e51aca41.zip
move cluster conntrack-sync script to vyatta-conntrack-sync package
-rw-r--r--Makefile.am2
-rw-r--r--etc/init.d/primary-secondary121
-rw-r--r--lib/Vyatta/Cluster/Config.pm2
3 files changed, 1 insertions, 124 deletions
diff --git a/Makefile.am b/Makefile.am
index 8a8c1ea..bec9339 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,14 +3,12 @@ opdir = $(datadir)/vyatta-op/templates
share_perl5dir = $(datadir)/perl5/Vyatta/Cluster
curverdir = $(sysconfdir)/config-migrate/current
-etc_initdir = /etc/init.d/
etc_ha_resourcedir = /etc/ha.d/resource.d
lib_ocf_resourcedir = /usr/lib/ocf/resource.d/heartbeat
sbin_SCRIPTS = scripts/vyatta-update-cluster.pl
sbin_SCRIPTS += scripts/vyatta-show-cluster.pl
-etc_init_SCRIPTS = etc/init.d/primary-secondary
share_perl5_DATA = lib/Vyatta/Cluster/Config.pm
curver_DATA = cfg-version/cluster@1
diff --git a/etc/init.d/primary-secondary b/etc/init.d/primary-secondary
deleted file mode 100644
index 151fb82..0000000
--- a/etc/init.d/primary-secondary
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/bin/sh
-#
-# (C) 2008 by Pablo Neira Ayuso <pablo@netfilter.org>
-#
-# This software may be used and distributed according to the terms
-# of the GNU General Public License, incorporated herein by reference.
-#
-# Description:
-#
-# This is the script for primary-backup setups for keepalived
-# (http://www.keepalived.org). You may adapt it to make it work with other
-# high-availability managers.
-#
-# Modified by : Mohit Mehta <mohit@vyatta.com>
-# Slight modifications were made to this script for running with heartbeat
-# The original script came from 0.9.14 debian conntrack-tools package
-#
-
-CONNTRACKD_BIN=/usr/sbin/conntrackd
-CONNTRACKD_LOCK=/var/lock/conntrack.lock
-CONNTRACKD_CONFIG=/etc/conntrackd/conntrackd.conf
-FACILITY=daemon
-LEVEL=notice
-TAG=conntrack-tools
-LOGCMD="logger -t $TAG -p $FACILITY.$LEVEL"
-
-$LOGCMD "primary-secondary invoked at `date`"
-
-case "$1" in
- start)
- $LOGCMD "`uname -n` transitioning to PRIMARY"
- #
- # commit the external cache into the kernel table
- #
- $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -c
- if [ $? -eq 1 ]
- then
- $LOGCMD "ERROR: failed to invoke conntrackd -c"
- fi
-
- #
- # flush the internal and the external caches
- #
- $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -f
- if [ $? -eq 1 ]
- then
- $LOGCMD "ERROR: failed to invoke conntrackd -f"
- fi
-
- #
- # resynchronize my internal cache to the kernel table
- #
- $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -R
- if [ $? -eq 1 ]
- then
- $LOGCMD "ERROR: failed to invoke conntrackd -R"
- fi
-
- #
- # send a bulk update to secondaries
- #
- $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -B
- if [ $? -eq 1 ]
- then
- $LOGCMD "ERROR: failed to invoke conntrackd -B"
- fi
- ;;
- stop)
- $LOGCMD "`uname -n` transitioning to SECONDARY"
- #
- # is conntrackd running? request some statistics to check it
- #
- $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -s
- if [ $? -eq 1 ]
- then
- #
- # something's wrong, do we have a lock file?
- #
- if [ -f $CONNTRACKD_LOCK ]
- then
- $LOGCMD "WARNING: conntrackd was not cleanly stopped."
- $LOGCMD "If you suspect that it has crashed:"
- $LOGCMD "1) Enable coredumps"
- $LOGCMD "2) Try to reproduce the problem"
- $LOGCMD "3) Post the coredump to netfilter-devel@vger.kernel.org"
- rm -f $CONNTRACKD_LOCK
- fi
- $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -d
- if [ $? -eq 1 ]
- then
- $LOGCMD "ERROR: cannot launch conntrackd"
- exit 1
- fi
- fi
- #
- # shorten kernel conntrack timers to remove the zombie entries.
- #
- $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -t
- if [ $? -eq 1 ]
- then
- $LOGCMD "ERROR: failed to invoke conntrackd -t"
- fi
-
- #
- # request resynchronization with master firewall replica (if any)
- # Note: this does nothing in the alarm approach.
- #
- $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -n
- if [ $? -eq 1 ]
- then
- $LOGCMD "ERROR: failed to invoke conntrackd -n"
- fi
- ;;
- *)
- $LOGCMD "ERROR: `uname -n` unknown state transition"
- echo "Usage: primary-secondary {start|stop}"
- exit 1
- ;;
-esac
-
-exit 0
diff --git a/lib/Vyatta/Cluster/Config.pm b/lib/Vyatta/Cluster/Config.pm
index 851f416..8302d1a 100644
--- a/lib/Vyatta/Cluster/Config.pm
+++ b/lib/Vyatta/Cluster/Config.pm
@@ -377,7 +377,7 @@ sub haresources {
$config->setLevel('service conntrack-sync failover-mechanism');
my @nodes = $config->listOrigPlusComNodes();
if (grep(/^cluster$/, @nodes)) {
- $conntrackd_service = "primary-secondary";
+ $conntrackd_service = "vyatta-cluster-conntracksync";
}
$services = join " ", ($services, "$conntrackd_service") if defined $conntrackd_service;
my $str =<<EOS;