From 89f5105aa4a2af4675a0eafe08ac655ccd3acf53 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth <35384120+rfaircloth-splunk@users.noreply.github.com> Date: Mon, 30 Nov 2020 09:07:04 -0500 Subject: [PATCH 1/3] fix: checkstate script to honor SPLUNKD_SSL_ENABLE --- splunk/common-files/checkstate.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/splunk/common-files/checkstate.sh b/splunk/common-files/checkstate.sh index a7330523..8a16bc44 100755 --- a/splunk/common-files/checkstate.sh +++ b/splunk/common-files/checkstate.sh @@ -27,7 +27,10 @@ if [[ "" == "$NO_HEALTHCHECK" ]]; then case "$state" in running|started) - curl -m 30 -f -k https://localhost:8089/ + if [[ "false" != "$SPLUNKD_SSL_ENABLE" ]]; then + curl -m 30 -f -k https://localhost:8089/ + else + curl -m 30 -f -k http://localhost:8089/ exit $? ;; *) From 723384f9da227c1400a8acf851206629ab98ffb7 Mon Sep 17 00:00:00 2001 From: Ryan Faircloth <35384120+rfaircloth-splunk@users.noreply.github.com> Date: Wed, 2 Dec 2020 15:57:17 -0500 Subject: [PATCH 2/3] Update checkstate.sh --- splunk/common-files/checkstate.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/splunk/common-files/checkstate.sh b/splunk/common-files/checkstate.sh index 8a16bc44..585ffd6c 100755 --- a/splunk/common-files/checkstate.sh +++ b/splunk/common-files/checkstate.sh @@ -21,16 +21,19 @@ #NOTE: If you plan on running the splunk container while keeping Splunk # inactive for long periods of time, this script may give misleading # health results + if [[ "" == "$NO_HEALTHCHECK" ]]; then + if [[ "false" == "$SPLUNKD_SSL_ENABLE" ]]; then + SCHEME="http" + else + SCHEME="https" + fi #If NO_HEALTHCHECK is NOT defined, then we want the healthcheck state="$(< $CONTAINER_ARTIFACT_DIR/splunk-container.state)" case "$state" in running|started) - if [[ "false" != "$SPLUNKD_SSL_ENABLE" ]]; then - curl -m 30 -f -k https://localhost:8089/ - else - curl -m 30 -f -k http://localhost:8089/ + curl -m 30 -f -k $SCHEME://localhost:8089/ exit $? ;; *) From 2dc7dabdbe0a1d724524f76c0e31449516e58344 Mon Sep 17 00:00:00 2001 From: rfaircloth-splunk Date: Wed, 2 Dec 2020 16:35:21 -0500 Subject: [PATCH 3/3] Update checkstate.sh --- splunk/common-files/checkstate.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/splunk/common-files/checkstate.sh b/splunk/common-files/checkstate.sh index 585ffd6c..549aedab 100755 --- a/splunk/common-files/checkstate.sh +++ b/splunk/common-files/checkstate.sh @@ -23,11 +23,11 @@ # health results if [[ "" == "$NO_HEALTHCHECK" ]]; then - if [[ "false" == "$SPLUNKD_SSL_ENABLE" ]]; then - SCHEME="http" + if [[ "false" == "$SPLUNKD_SSL_ENABLE" ]]; then + SCHEME="http" else - SCHEME="https" - fi + SCHEME="https" + fi #If NO_HEALTHCHECK is NOT defined, then we want the healthcheck state="$(< $CONTAINER_ARTIFACT_DIR/splunk-container.state)"