24 lines
604 B
Bash
Executable file
24 lines
604 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
export LC_ALL=C.UTF-8
|
|
export LANG=C.UTF-8
|
|
|
|
for PG_VERSION in /usr/lib/postgresql/*; do
|
|
export PATH=/usr/lib/postgresql/$(basename ${PG_VERSION})/bin:$PATH
|
|
export PATRONI_POSTGRESQL_BIN_DIR=/usr/lib/postgresql/$(basename ${PG_VERSION})/bin
|
|
done
|
|
|
|
if [ $(id -u) -eq 0 ]
|
|
then
|
|
# required so that the postgres user can create files
|
|
chmod 777 .
|
|
chmod 777 features
|
|
SU='su postgres -p -c'
|
|
else
|
|
SU='bash -c'
|
|
fi
|
|
|
|
$SU "export PATH PATRONI_POSTGRESQL_BIN_DIR; echo PATH: $PATH; echo -n pg_ctl:; which pg_ctl; echo .; ls /usr/lib/postgresql/*/bin/; behave"
|