[Debian-ha-commits] [resource-agents] 01/08: New upstream version 4.1.0
Valentin Vidic
vvidic-guest at moszumanska.debian.org
Sun Dec 3 17:06:12 UTC 2017
This is an automated email from the git hooks/post-receive script.
vvidic-guest pushed a commit to branch master
in repository resource-agents.
commit 4945a6b9e1368e15ea005b60c13986ce2c6d4d1b
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date: Sun Dec 3 16:47:45 2017 +0100
New upstream version 4.1.0
---
ChangeLog | 7 ++
configure.ac | 2 +-
doc/man/Makefile.am | 1 +
heartbeat/LVM-activate | 9 +--
heartbeat/Makefile.am | 1 +
heartbeat/apache | 35 ++++-----
heartbeat/db2 | 4 +-
heartbeat/ethmonitor | 12 +++-
heartbeat/ipsec | 172 ++++++++++++++++++++++++++++++++++++++++++++
heartbeat/ocf-shellfuncs.in | 2 +-
10 files changed, 215 insertions(+), 30 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 653ae38..79aa6d7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+* Tue Nov 28 2017 resource-agents contributors
+- stable release 4.1.0
+- ipsec: new RA
+- apache: improved stop action
+- db2: fix HADR promote when master failed
+- ethmonitor: add intel omnipath support
+
* Tue Nov 14 2017 resource-agents contributors
- release candidate 4.1.0 rc1
- nfsserver: allow stop to timeout
diff --git a/configure.ac b/configure.ac
index e02d754..703e28b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -910,7 +910,7 @@ dnl *****************
AC_MSG_RESULT([])
AC_MSG_RESULT([$PACKAGE configuration:])
AC_MSG_RESULT([ Version = ${VERSION}])
-AC_MSG_RESULT([ Build Version = 4a3326643bc4b45520c525c0094ac98a9746da6a])
+AC_MSG_RESULT([ Build Version = 539ed604e3d6121d11fe4476d9d19e02699dd657])
AC_MSG_RESULT([ Features =${PKG_FEATURES}])
AC_MSG_RESULT([])
AC_MSG_RESULT([ Prefix = ${prefix}])
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
index e8a0f19..03cdc88 100644
--- a/doc/man/Makefile.am
+++ b/doc/man/Makefile.am
@@ -116,6 +116,7 @@ man_MANS = ocf_heartbeat_AoEtarget.7 \
ocf_heartbeat_iSCSITarget.7 \
ocf_heartbeat_iface-bridge.7 \
ocf_heartbeat_iface-vlan.7 \
+ ocf_heartbeat_ipsec.7 \
ocf_heartbeat_ids.7 \
ocf_heartbeat_iscsi.7 \
ocf_heartbeat_jboss.7 \
diff --git a/heartbeat/LVM-activate b/heartbeat/LVM-activate
index 4004e56..f5c1b66 100755
--- a/heartbeat/LVM-activate
+++ b/heartbeat/LVM-activate
@@ -441,7 +441,7 @@ lvm_validate() {
get_VG_access_mode
mode=$?
if [ $VG_access_mode -ne 4 ] && [ $mode -ne $VG_access_mode ]; then
- ocf_exit_reason "The specified vg_access_mode doesn't match the mode on VG metadata!"
+ ocf_exit_reason "The specified vg_access_mode doesn't match the lock_type on VG metadata!"
exit $OCF_ERR_ARGS
fi
@@ -731,13 +731,9 @@ lvm_stop() {
return $OCF_SUCCESS
fi
+ lvm_validate
ocf_log info "Deactivating ${vol}"
- if ! vgs ${VG} >/dev/null 2>&1 ; then
- ocf_log info "Volume group ${VG} not found. Nothing to deactivate."
- return $OCF_SUCCESS
- fi
-
case ${VG_access_mode} in
1)
lvmlockd_deactivate
@@ -820,7 +816,6 @@ start)
;;
stop)
- lvm_validate
lvm_stop
;;
monitor)
diff --git a/heartbeat/Makefile.am b/heartbeat/Makefile.am
index 3e9a642..1fde5e9 100644
--- a/heartbeat/Makefile.am
+++ b/heartbeat/Makefile.am
@@ -114,6 +114,7 @@ ocf_SCRIPTS = AoEtarget \
ids \
iface-bridge \
iface-vlan \
+ ipsec \
iscsi \
jboss \
kamailio \
diff --git a/heartbeat/apache b/heartbeat/apache
index 9f02fb5..3b14dcb 100755
--- a/heartbeat/apache
+++ b/heartbeat/apache
@@ -278,17 +278,19 @@ kill_stop()
local pid=$1
ocf_log info "Killing apache PID $pid"
- while
- ProcessRunning $pid &&
- [ $tries -lt 10 ]
- do
- if [ $tries -ne 0 ]; then
- # don't sleep on the first try
- sleep 1
- fi
- kill $pid >/dev/null
- tries=`expr $tries + 1`
- done
+ if ProcessRunning $pid; then
+ kill $pid >/dev/null
+ while
+ [ $tries -lt 10 ]
+ do
+ if ProcessRunning $pid; then
+ tries=`expr $tries + 1`
+ sleep 1
+ else
+ break
+ fi
+ done
+ fi
}
apache_stop() {
@@ -305,18 +307,19 @@ apache_stop() {
graceful_stop $pid
if [ $? -ne 0 ]; then
kill_stop $pid
+ fi
- if ProcessRunning $pid; then
- ocf_exit_reason "$CMD still running ($pid). Killing pid failed."
- ret=$OCF_ERR_GENERIC
- fi
+ signal_children
+
+ if ProcessRunning $pid; then
+ ocf_exit_reason "$CMD still running ($pid). Killing pid failed."
+ ret=$OCF_ERR_GENERIC
fi
if [ $ret -eq 0 ]; then
ocf_log info "$CMD stopped."
fi
- signal_children
return $ret
}
diff --git a/heartbeat/db2 b/heartbeat/db2
index 63de315..b67363e 100755
--- a/heartbeat/db2
+++ b/heartbeat/db2
@@ -617,7 +617,7 @@ db2_instance_status() {
if [ $pscount -ge 4 ]; then
return $OCF_SUCCESS;
elif [ $pscount -ge 1 ]; then
- return $OCF_GENERIC_ERR
+ return $OCF_ERR_GENERIC
fi
return $OCF_NOT_RUNNING
}
@@ -767,7 +767,7 @@ db2_promote() {
# must take over
;;
- STANDBY/PEER/DISCONNECTED|Standby/DisconnectedPeer)
+ STANDBY/PEER/DISCONNECTED|STANDBY/DISCONNECTED_PEER/DISCONNECTED|Standby/DisconnectedPeer)
# must take over forced
force="by force peer window only"
;;
diff --git a/heartbeat/ethmonitor b/heartbeat/ethmonitor
index 7f5579f..21bf12b 100755
--- a/heartbeat/ethmonitor
+++ b/heartbeat/ethmonitor
@@ -219,7 +219,10 @@ infiniband_status()
device="${OCF_RESKEY_infiniband_device}:${OCF_RESKEY_infiniband_port}"
fi
- ibstatus ${device} | grep -q ACTIVE
+ case "${OCF_RESKEY_infiniband_device}" in
+ *ib*|*mlx*) ibstatus ${device} | grep -q ACTIVE ;;
+ *hfi*) opainfo | grep -q Active ;;
+ esac
}
if_init() {
@@ -291,8 +294,11 @@ if_init() {
fi
if [ -n "$OCF_RESKEY_infiniband_device" ]; then
- #ibstatus is required if an infiniband_device is provided
- check_binary ibstatus
+ #ibstatus or opainfo is required if an infiniband_device is provided
+ case "${OCF_RESKEY_infiniband_device}" in
+ *ib*|*mlx*) check_binary ibstatus ;;
+ *hfi*) check_binary opainfo ;;
+ esac
fi
return $OCF_SUCCESS
}
diff --git a/heartbeat/ipsec b/heartbeat/ipsec
new file mode 100755
index 0000000..6144c00
--- /dev/null
+++ b/heartbeat/ipsec
@@ -0,0 +1,172 @@
+#!/bin/sh
+#
+#
+# IPSEC OCF RA. Handles IPSEC tunnels associated with a VIP
+#
+# Copyright (c) 2017 Red Hat Inc.
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Further, this software is distributed without any warranty that it is
+# free of the rightful claim of any third person regarding infringement
+# or the like. Any license provided herein, whether implied or
+# otherwise, applies only to this software file. Patent licenses, if
+# any, provided herein do not apply to combinations of this program with
+# other software, or any other product whatsoever.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+#
+
+#######################################################################
+# Initialization:
+
+: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
+. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
+
+#######################################################################
+
+# Defaults
+
+OCF_RESKEY_confdir_default="/etc/ipsec.d/"
+: ${OCF_RESKEY_confdir=${OCF_RESKEY_confdir_default}}
+
+meta_data() {
+ cat <<END
+<?xml version="1.0"?>
+<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
+<resource-agent name="ipsec">
+<version>1.0</version>
+
+<longdesc lang="en">
+This is a Resource Agent to manage IPSEC tunnels associated with a Virtual IP
+Address. It's meant to be collocated with a specific VIP, and will manage
+setting up or down a specific tunnel.
+</longdesc>
+<shortdesc lang="en">Handles IPSEC tunnels for VIPs</shortdesc>
+
+<parameters>
+<parameter name="tunnel" unique="1" required="1">
+<longdesc lang="en">
+The name of the tunnel to be monitored.
+</longdesc>
+<shortdesc lang="en">Tunnel name</shortdesc>
+<content type="string" default="" />
+</parameter>
+<parameter name="vip" unique="1" required="1">
+<longdesc lang="en">
+Virtual IP address that the tunnel is using.
+</longdesc>
+<shortdesc lang="en">VIP</shortdesc>
+<content type="string" default="" />
+</parameter>
+<parameter name="confdir">
+<longdesc lang="en">
+The directory where the IPSEC tunnel configurations can be found.
+</longdesc>
+<shortdesc lang="en">Tunnel name</shortdesc>
+<content type="string" default="${OCF_RESKEY_confdir_default}" />
+</parameter>
+</parameters>
+
+<actions>
+<action name="start" timeout="20" />
+<action name="stop" timeout="20" />
+<action name="monitor" timeout="20" interval="10" depth="0" />
+<action name="reload" timeout="20" />
+<action name="meta-data" timeout="5" />
+</actions>
+</resource-agent>
+END
+}
+
+#######################################################################
+
+ipsec_usage() {
+ cat <<END
+usage: $0 {start|stop|monitor|validate-all|meta-data}
+
+Expects to have a fully populated OCF RA-compliant environment set. And
+should have a collocation constraint with a VIP associated with the
+tunnel.
+END
+}
+
+ipsec_start() {
+ ipsec auto --add "${OCF_RESKEY_tunnel}"
+ ipsec whack --listen &>> /tmp/ipsec-agent.log
+ local return_code=$?
+ if [ $return_code -eq 1 -o $return_code -eq 10 ]; then
+ ocf_log warn "${OCF_RESOURCE_INSTANCE} : Unable to add tunnel ${OCF_RESKEY_tunnel} with return code ${return_code}"
+ return $OCF_ERR_GENERIC
+ else
+ return $OCF_SUCCESS
+ fi
+}
+
+ipsec_stop() {
+ ipsec auto --down "${OCF_RESKEY_tunnel}"
+ local return_code=$?
+ ocf_log info "${OCF_RESOURCE_INSTANCE} : Put down tunnel ${OCF_RESKEY_tunnel} with return code ${return_code}"
+ return $OCF_SUCCESS
+}
+
+ipsec_monitor() {
+ # Monitor _MUST!_ differentiate correctly between running
+ # (SUCCESS), failed (ERROR) or _cleanly_ stopped (NOT RUNNING).
+ # That is THREE states, not just yes/no.
+
+ ipsec status | grep "$OCF_RESKEY_tunnel" | grep -q unoriented
+ state=$?
+ if [ "$state" == "0" ]; then
+ ip addr show | grep -q "${OCF_RESKEY_vip}"
+ hosting_vip=$?
+ if [ "hosting_vip" == "0" ]; then
+ ocf_log warn "${OCF_RESOURCE_INSTANCE} : tunnel ${OCF_RESKEY_tunnel} is unoriented"
+ return $OCF_ERR_GENERIC
+ else
+ return $OCF_NOT_RUNNING
+ fi
+ else
+ return $OCF_SUCCESS
+ fi
+}
+
+ipsec_validate() {
+ # The tunnel needs to be defined in the configuration
+ cat ${OCF_RESKEY_confdir}/*.conf | grep -q "conn $OCF_RESKEY_tunnel"
+ state=$?
+ if [ "$state" == "0" ]; then
+ return $OCF_SUCCESS
+ else
+ return $OCF_ERR_GENERIC
+ fi
+}
+
+case $__OCF_ACTION in
+meta-data) meta_data
+ exit $OCF_SUCCESS
+ ;;
+start) ipsec_start;;
+stop) ipsec_stop;;
+monitor) ipsec_monitor;;
+reload) ocf_log info "Reloading ${OCF_RESOURCE_INSTANCE} ..."
+ ;;
+usage|help) ipsec_usage
+ exit $OCF_SUCCESS
+ ;;
+*) ipsec_usage
+ exit $OCF_ERR_UNIMPLEMENTED
+ ;;
+esac
+rc=$?
+ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
+exit $rc
diff --git a/heartbeat/ocf-shellfuncs.in b/heartbeat/ocf-shellfuncs.in
index 90620cf..adf2c1f 100644
--- a/heartbeat/ocf-shellfuncs.in
+++ b/heartbeat/ocf-shellfuncs.in
@@ -22,7 +22,7 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-# Build version: 4a3326643bc4b45520c525c0094ac98a9746da6a
+# Build version: 539ed604e3d6121d11fe4476d9d19e02699dd657
# TODO: Some of this should probably split out into a generic OCF
# library for shell scripts, but for the time being, we'll just use it
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/resource-agents.git
More information about the Debian-HA-Commits
mailing list