File tree Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Expand file tree Collapse file tree 3 files changed +31
-4
lines changed Original file line number Diff line number Diff line change 3
3
set -u
4
4
set -o pipefail
5
5
6
- # Do the lifeness check exit status 0 -> success | 1 -> fail
7
- searchd --status 1> /dev/null && exit 0 || exit 1
6
+ # mountpoint with readiness probe file
7
+ MOUNT=$( realpath " ${PROBE_MOUNTPOINT:-/ tmp} " )
8
+ READY_FILE=" ${MOUNT} /checker_ready.txt"
9
+
10
+ clean_probe_files () {
11
+ rm -f " ${READY_FILE} " || :
12
+ }
13
+
14
+ # source this stuff until here
15
+ [ " $0 " = " ${BASH_SOURCE[*]} " ] || return 0
16
+
17
+ if searchd --status 1> /dev/null; then
18
+ echo " READY" > " ${READY_FILE} "
19
+ exit 0
20
+ else
21
+ clean_probe_files
22
+ exit 1
23
+ fi
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ # shellcheck disable=SC1091
2
3
set -euo pipefail
3
4
5
+ source checker.sh
6
+
7
+ # Capture Exit Code
8
+ trap clean_probe_files EXIT
9
+
4
10
# fancy output
5
11
green=' \e[0;32m'
6
12
red=' \e[0;31m'
@@ -22,7 +28,7 @@ for index in "${array_orphaned[@]}"; do
22
28
[[ -z ${index} ]] && continue
23
29
# skip .new files, we need them to sighup searchd / rotate index updates
24
30
if [[ ! $index == * .new ]]; then
25
- echo -e " \t${red} deleting orphaned index ${index} from filesystem. ${NC} "
31
+ echo -e " \\ t${red} deleting orphaned index ${index} from filesystem. ${NC} "
26
32
rm -rf " ${SPHINXINDEX_EFS}${index} " .*
27
33
fi
28
34
done
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ # shellcheck disable=SC1091
2
3
set -euo pipefail
3
4
5
+ source checker.sh
6
+ # geodata has to have rw access on probe mountpoint
7
+ chown -R geodata:geodata " ${MOUNT} "
8
+
4
9
# build sphinx config with current environment
5
10
cat conf/* .part > conf/sphinx.conf.in
6
11
envsubst < conf/sphinx.conf.in > conf/sphinx.conf
@@ -12,4 +17,4 @@ cp -f conf/wordforms_main.txt /etc/sphinxsearch/wordforms_main.txt
12
17
# always remove lock files from mounted shared storage
13
18
rm -rf /var/lib/sphinxsearch/data/index/* .spl 2> /dev/null || :
14
19
15
- exec gosu geodata " $@ "
20
+ exec gosu geodata " $@ "
You can’t perform that action at this time.
0 commit comments