From 4540d625156ec58dd3b2babfc84dd8c41ad91252 Mon Sep 17 00:00:00 2001
From: Daniel Black <daniel@mariadb.org>
Date: Tue, 17 Sep 2024 17:26:03 +1000
Subject: [PATCH] healthcheck.sh add --no-connect option

There is an implicit --connect option in healthcheck
so that a normal use can be sure MariaDB is running
on a tcp socket.

There is a case in /docker-entrypoint-initdb.d where
its desirable to perform healthchecks for components
without a --connect. In this case, use --no-connect
in the healthcheck to avoid an implicit --connect test.
---
 10.11-ubi/healthcheck.sh | 5 +++++
 10.11/healthcheck.sh     | 5 +++++
 10.5/healthcheck.sh      | 5 +++++
 10.6-ubi/healthcheck.sh  | 5 +++++
 10.6/healthcheck.sh      | 5 +++++
 11.2/healthcheck.sh      | 5 +++++
 11.4-ubi/healthcheck.sh  | 5 +++++
 11.4/healthcheck.sh      | 5 +++++
 healthcheck.sh           | 5 +++++
 main-ubi/healthcheck.sh  | 5 +++++
 main/healthcheck.sh      | 5 +++++
 11 files changed, 55 insertions(+)

diff --git a/10.11-ubi/healthcheck.sh b/10.11-ubi/healthcheck.sh
index c0fb93b..07b4fe3 100755
--- a/10.11-ubi/healthcheck.sh
+++ b/10.11-ubi/healthcheck.sh
@@ -361,6 +361,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/10.11/healthcheck.sh b/10.11/healthcheck.sh
index c0fb93b..07b4fe3 100755
--- a/10.11/healthcheck.sh
+++ b/10.11/healthcheck.sh
@@ -361,6 +361,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/10.5/healthcheck.sh b/10.5/healthcheck.sh
index d925ed5..8f91a55 100755
--- a/10.5/healthcheck.sh
+++ b/10.5/healthcheck.sh
@@ -361,6 +361,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/10.6-ubi/healthcheck.sh b/10.6-ubi/healthcheck.sh
index c0fb93b..07b4fe3 100755
--- a/10.6-ubi/healthcheck.sh
+++ b/10.6-ubi/healthcheck.sh
@@ -361,6 +361,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/10.6/healthcheck.sh b/10.6/healthcheck.sh
index c0fb93b..07b4fe3 100755
--- a/10.6/healthcheck.sh
+++ b/10.6/healthcheck.sh
@@ -361,6 +361,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/11.2/healthcheck.sh b/11.2/healthcheck.sh
index 4cee59c..dcc4db2 100755
--- a/11.2/healthcheck.sh
+++ b/11.2/healthcheck.sh
@@ -361,6 +361,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/11.4-ubi/healthcheck.sh b/11.4-ubi/healthcheck.sh
index ad0b17f..62be345 100755
--- a/11.4-ubi/healthcheck.sh
+++ b/11.4-ubi/healthcheck.sh
@@ -363,6 +363,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/11.4/healthcheck.sh b/11.4/healthcheck.sh
index ad0b17f..62be345 100755
--- a/11.4/healthcheck.sh
+++ b/11.4/healthcheck.sh
@@ -363,6 +363,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/healthcheck.sh b/healthcheck.sh
index ad0b17f..62be345 100755
--- a/healthcheck.sh
+++ b/healthcheck.sh
@@ -363,6 +363,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/main-ubi/healthcheck.sh b/main-ubi/healthcheck.sh
index ad0b17f..62be345 100755
--- a/main-ubi/healthcheck.sh
+++ b/main-ubi/healthcheck.sh
@@ -363,6 +363,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
diff --git a/main/healthcheck.sh b/main/healthcheck.sh
index ad0b17f..62be345 100755
--- a/main/healthcheck.sh
+++ b/main/healthcheck.sh
@@ -363,6 +363,11 @@ while [ $# -gt 0 ]; do
 			fi
 			nodefaults=
 			;;
+		--no-connect)
+			# used for /docker-entrypoint-initdb.d scripts
+			# where you definately don't want a connection test
+			connect_s=0
+			;;
 		--*)
 			test=${1#--}
 			;;
-- 
GitLab