mirror of
https://github.com/kanaka/mal.git
synced 2024-11-10 12:47:45 +03:00
494792abe4
- move each file to a schema namespace. Don't recreate DB, just the schemas. This is much faster and avoids the error about user still using the DB when recreating the DB. - combine RUN and MAIN_LOOP into MAIN routine. - add open column to streams table - close stream 1 in MAIN
26 lines
536 B
Bash
Executable File
26 lines
536 B
Bash
Executable File
#!/bin/bash
|
|
|
|
POSTGRES_SUDO_USER=${POSTGRES_SUDO_USER:-postgres}
|
|
|
|
POPTS=""
|
|
while [[ ${1:0:1} = '-' ]]; do
|
|
POPTS="${POPTS}$1 $2"
|
|
shift; shift
|
|
done
|
|
|
|
sudo --user=${POSTGRES_SUDO_USER} \
|
|
/usr/lib/postgresql/9.4/bin/postgres \
|
|
-c config_file=/etc/postgresql/9.4/main/postgresql.conf \
|
|
${POPTS} >/var/log/postgresql/output.log 2>&1 & disown -h
|
|
|
|
while ! ( echo "" > /dev/tcp/localhost/5432) 2>/dev/null; do
|
|
echo "Waiting for postgres to start"
|
|
sleep 1
|
|
done
|
|
|
|
if [ "${*}" ]; then
|
|
exec "${@}"
|
|
else
|
|
exec bash
|
|
fi
|