Blame SOURCES/bz1804658-azure-lb-2-add-socat-support.patch

d42a06
From 8bc6c37607c3908976e502c1b6a3d9b1a79c010a Mon Sep 17 00:00:00 2001
d42a06
From: Peter Varkoly <varkoly@suse.com>
d42a06
Date: Mon, 30 Sep 2019 14:31:39 +0200
d42a06
Subject: [PATCH] Adapt azure-lb Resource Agent to support socat usage too
d42a06
d42a06
---
d42a06
 heartbeat/azure-lb | 10 ++++++++--
d42a06
 1 file changed, 8 insertions(+), 2 deletions(-)
d42a06
d42a06
diff --git a/heartbeat/azure-lb b/heartbeat/azure-lb
d42a06
index 35d364be7..5ee767474 100755
d42a06
--- a/heartbeat/azure-lb
d42a06
+++ b/heartbeat/azure-lb
d42a06
@@ -53,9 +53,11 @@ Resource agent to answer Azure Load Balancer health probe requests
d42a06
 
d42a06
 <parameter name="nc">
d42a06
 <longdesc lang="en">
d42a06
-The full name of the nc binary.
d42a06
+The full path of the used binary. This can be nc or socat path.
d42a06
+The default is /usr/bin/nc.
d42a06
+If you need /usr/bin/socat this parameter should be set.
d42a06
 </longdesc>
d42a06
-<shortdesc lang="en">Full path name of the nc binary</shortdesc>
d42a06
+<shortdesc lang="en">Full path of the used binary (nc or socat are allowed)</shortdesc>
d42a06
 <content type="string" default="${OCF_RESKEY_nc_default}"/>
d42a06
 </parameter>
d42a06
 
d42a06
@@ -100,6 +102,10 @@ lb_monitor() {
d42a06
 
d42a06
 lb_start() {
d42a06
 	cmd="$OCF_RESKEY_nc -l -k $OCF_RESKEY_port"
d42a06
+	if [ $( basename $OCF_RESKEY_nc ) = 'socat' ]; then
d42a06
+		#socat has different parameters
d42a06
+		cmd="$OCF_RESKEY_nc -U TCP-LISTEN:$OCF_RESKEY_port,backlog=10,fork,reuseaddr /dev/null"
d42a06
+	fi
d42a06
 	if ! lb_monitor; then
d42a06
 		ocf_log debug "Starting $process: $cmd"
d42a06
 		# Execute the command as created above