We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 652443a commit 06ba93aCopy full SHA for 06ba93a
scripts/run.sh
@@ -1,10 +1,17 @@
1
#!/usr/bin/env bash
2
3
+STOP=false
4
+# don't restart postgres on SIGTERM (eg, pod deleted)
5
+# ref: https://opensource.com/article/20/6/bash-trap
6
+trap \
7
+ "{ STOP=true; }" \
8
+ SIGINT SIGTERM EXIT
9
+
10
#going to change this with the check of process id
11
rm -f "$PGDATA"/postmaster.pid
12
echo "waiting for the role to be decided ..."
13
while true; do
- if [[ -e /run_scripts/role/run.sh ]]; then
14
+ if [[ -e /run_scripts/role/run.sh ]] && [[ "$STOP" = false ]]; then
15
echo "running the initial script ..."
16
if [[ $REMOTE_REPLICA == "true" ]]; then
17
/run_scripts/role/remote-replica.sh
0 commit comments