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

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