Pull changes from upstream repository
This commit is contained in:
parent
228023ff21
commit
f409f0a74f
46 changed files with 5661 additions and 0 deletions
39
root/usr/libexec/check-container
Executable file
39
root/usr/libexec/check-container
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Try whether the PostgreSQL in container accepts connections.
|
||||
#
|
||||
# With --live, be tolerant to starting PG server. If the /bin/postgres binary
|
||||
# has not been executed yet (the shell script is initializing the container),
|
||||
# wait for it (this script might run forever, we expect that the timeout is
|
||||
# maintained externally).
|
||||
|
||||
test -z "$ENABLED_COLLECTIONS" || . scl_source enable $ENABLED_COLLECTIONS
|
||||
|
||||
check=ready
|
||||
case $1 in
|
||||
--live) check=live ;;
|
||||
esac
|
||||
|
||||
while true; do
|
||||
# Wait until the /bin/postgres is executed.
|
||||
case $(readlink -f /proc/1/exe) in
|
||||
*bash) sleep 0.2; continue ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Timeout is infinite (openshift template has the timeout pre-set)
|
||||
pg_isready -q \
|
||||
-h 127.0.0.1 \
|
||||
${POSTGRESQL_USER+-U "$POSTGRESQL_USER"} \
|
||||
${POSTGRESQL_DATABASE+-d "$POSTGRESQL_DATABASE"} \
|
||||
--timeout 0
|
||||
rc=$?
|
||||
|
||||
# we are ready only if the db accepts connections
|
||||
test $rc -eq 0 && exit 0
|
||||
|
||||
# container is live also during pg cluster start-up
|
||||
test $rc -eq 1 && test $check = live && exit 0
|
||||
|
||||
exit 1
|
||||
7
root/usr/libexec/fix-permissions
Executable file
7
root/usr/libexec/fix-permissions
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
# Fix permissions on the given directory to allow group read/write of
|
||||
# regular files and execute of directories.
|
||||
find "$1" -exec chown postgres {} \;
|
||||
find "$1" -exec chgrp 0 {} \;
|
||||
find "$1" -exec chmod g+rw {} \;
|
||||
find "$1" -type d -exec chmod g+x {} +
|
||||
Loading…
Add table
Add a link
Reference in a new issue