Skip to content

Commit 79226cf

Browse files
authored
Merge pull request #1596 from SUSE/create-pull-request/update-versions-and-files
🤖: Update package versions and files
2 parents 77c5794 + 5a96231 commit 79226cf

3 files changed

Lines changed: 96 additions & 51 deletions

File tree

src/bci_build/package/mariadb/10.11/healthcheck.sh

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,39 @@ connect()
6565
return "$s";
6666
;;
6767
esac
68-
# falling back to this if there wasn't a connection answer.
69-
set +e +o pipefail
70-
# (on second extra_file)
71-
# shellcheck disable=SC2086
72-
mariadb ${nodefaults:+--no-defaults} \
68+
# falling back to tcp if there wasn't a connection answer.
69+
s=$(mariadb ${nodefaults:+--no-defaults} \
7370
${def['file']:+--defaults-file=${def['file']}} \
7471
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
7572
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
76-
-h localhost --protocol tcp -e 'select 1' 2>&1 \
77-
| grep -qF "Can't connect"
78-
local ret=${PIPESTATUS[1]}
79-
set -eo pipefail
80-
if (( "$ret" == 0 )); then
81-
# grep Matched "Can't connect" so we fail
82-
connect_s=1
83-
else
84-
connect_s=0
85-
fi
73+
-h localhost --protocol tcp \
74+
--skip-column-names --batch --skip-print-query-on-error \
75+
-e 'select @@skip_networking' 2>&1)
76+
77+
case "$s" in
78+
1) # skip-networking=1 (no network)
79+
;&
80+
ERROR\ 2002\ \(HY000\):*)
81+
# cannot connect
82+
connect_s=1
83+
;;
84+
0) # skip-networking=0
85+
;&
86+
ERROR\ 1820\ \(HY000\)*) # password expire
87+
;&
88+
ERROR\ 4151\ \(HY000\):*) # account locked
89+
;&
90+
ERROR\ 1226\ \(42000\)*) # resource limit exceeded
91+
;&
92+
ERROR\ 1[0-9][0-9][0-9]\ \(28000\):*)
93+
# grep access denied and other 28000 client errors - we did connect
94+
connect_s=0
95+
;;
96+
*)
97+
>&2 echo "Unknown error $s"
98+
connect_s=1
99+
;;
100+
esac
86101
return $connect_s
87102
}
88103

@@ -365,8 +380,8 @@ while [ $# -gt 0 ]; do
365380
fi
366381
shift
367382
done
368-
if [ -z "$connect_s" ]; then
369-
# we didn't do a connnect test, so the current success status is suspicious
383+
if [ "$connect_s" != "0" ]; then
384+
# we didn't pass a connnect test, so the current success status is suspicious
370385
# return what connect thinks.
371386
connect
372387
exit $?

src/bci_build/package/mariadb/10.6/healthcheck.sh

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,39 @@ connect()
6565
return "$s";
6666
;;
6767
esac
68-
# falling back to this if there wasn't a connection answer.
69-
set +e +o pipefail
70-
# (on second extra_file)
71-
# shellcheck disable=SC2086
72-
mariadb ${nodefaults:+--no-defaults} \
68+
# falling back to tcp if there wasn't a connection answer.
69+
s=$(mariadb ${nodefaults:+--no-defaults} \
7370
${def['file']:+--defaults-file=${def['file']}} \
7471
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
7572
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
76-
-h localhost --protocol tcp -e 'select 1' 2>&1 \
77-
| grep -qF "Can't connect"
78-
local ret=${PIPESTATUS[1]}
79-
set -eo pipefail
80-
if (( "$ret" == 0 )); then
81-
# grep Matched "Can't connect" so we fail
82-
connect_s=1
83-
else
84-
connect_s=0
85-
fi
73+
-h localhost --protocol tcp \
74+
--skip-column-names --batch --skip-print-query-on-error \
75+
-e 'select @@skip_networking' 2>&1)
76+
77+
case "$s" in
78+
1) # skip-networking=1 (no network)
79+
;&
80+
ERROR\ 2002\ \(HY000\):*)
81+
# cannot connect
82+
connect_s=1
83+
;;
84+
0) # skip-networking=0
85+
;&
86+
ERROR\ 1820\ \(HY000\)*) # password expire
87+
;&
88+
ERROR\ 4151\ \(HY000\):*) # account locked
89+
;&
90+
ERROR\ 1226\ \(42000\)*) # resource limit exceeded
91+
;&
92+
ERROR\ 1[0-9][0-9][0-9]\ \(28000\):*)
93+
# grep access denied and other 28000 client errors - we did connect
94+
connect_s=0
95+
;;
96+
*)
97+
>&2 echo "Unknown error $s"
98+
connect_s=1
99+
;;
100+
esac
86101
return $connect_s
87102
}
88103

@@ -365,8 +380,8 @@ while [ $# -gt 0 ]; do
365380
fi
366381
shift
367382
done
368-
if [ -z "$connect_s" ]; then
369-
# we didn't do a connnect test, so the current success status is suspicious
383+
if [ "$connect_s" != "0" ]; then
384+
# we didn't pass a connnect test, so the current success status is suspicious
370385
# return what connect thinks.
371386
connect
372387
exit $?

src/bci_build/package/mariadb/11.4/healthcheck.sh

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,40 @@ connect()
6666
return "$s";
6767
;;
6868
esac
69-
# falling back to this if there wasn't a connection answer.
70-
set +e +o pipefail
71-
# (on second extra_file)
72-
# shellcheck disable=SC2086
73-
mariadb ${nodefaults:+--no-defaults} \
69+
# falling back to tcp if there wasn't a connection answer.
70+
s=$(mariadb ${nodefaults:+--no-defaults} \
7471
${def['file']:+--defaults-file=${def['file']}} \
7572
${def['extra_file']:+--defaults-extra-file=${def['extra_file']}} \
7673
${def['group_suffix']:+--defaults-group-suffix=${def['group_suffix']}} \
7774
--skip-ssl --skip-ssl-verify-server-cert \
78-
-h localhost --protocol tcp -e 'select 1' 2>&1 \
79-
| grep -qF "Can't connect"
80-
local ret=${PIPESTATUS[1]}
81-
set -eo pipefail
82-
if (( "$ret" == 0 )); then
83-
# grep Matched "Can't connect" so we fail
84-
connect_s=1
85-
else
86-
connect_s=0
87-
fi
75+
-h localhost --protocol tcp \
76+
--skip-column-names --batch --skip-print-query-on-error \
77+
-e 'select @@skip_networking' 2>&1)
78+
79+
case "$s" in
80+
1) # skip-networking=1 (no network)
81+
;&
82+
ERROR\ 2002\ \(HY000\):*)
83+
# cannot connect
84+
connect_s=1
85+
;;
86+
0) # skip-networking=0
87+
;&
88+
ERROR\ 1820\ \(HY000\)*) # password expire
89+
;&
90+
ERROR\ 4151\ \(HY000\):*) # account locked
91+
;&
92+
ERROR\ 1226\ \(42000\)*) # resource limit exceeded
93+
;&
94+
ERROR\ 1[0-9][0-9][0-9]\ \(28000\):*)
95+
# grep access denied and other 28000 client errors - we did connect
96+
connect_s=0
97+
;;
98+
*)
99+
>&2 echo "Unknown error $s"
100+
connect_s=1
101+
;;
102+
esac
88103
return $connect_s
89104
}
90105

@@ -367,8 +382,8 @@ while [ $# -gt 0 ]; do
367382
fi
368383
shift
369384
done
370-
if [ -z "$connect_s" ]; then
371-
# we didn't do a connnect test, so the current success status is suspicious
385+
if [ "$connect_s" != "0" ]; then
386+
# we didn't pass a connnect test, so the current success status is suspicious
372387
# return what connect thinks.
373388
connect
374389
exit $?

0 commit comments

Comments
 (0)