File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 5050 chmod : " +x"
5151 contents : |
5252 #!/bin/bash
53+ run_upgrade_postgres() {
54+ if [ -f /root/upgrade_postgres ]; then
55+ unset RETCODE
56+ /root/upgrade_postgres || RETCODE=$?
57+ [ -z "${RETCODE}" ] && rm /root/upgrade_postgres || exit $RETCODE
58+ fi
59+ exit 0
60+ }
5361 sed -i "s/^# $LANG/$LANG/" /etc/locale.gen
5462 locale-gen && update-locale
5563 mkdir -p /shared/postgres_run
5866 rm -fr /var/run/postgresql
5967 ln -s /shared/postgres_run /var/run/postgresql
6068 if [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
61- socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
69+ socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || run_upgrade_postgres && echo postgres already running stop container ; exit 1
6270 fi
6371 rm -fr /shared/postgres_run/.s*
6472 rm -fr /shared/postgres_run/*.pid
7078 sudo -E -u postgres /usr/lib/postgresql/15/bin/initdb -D /shared/postgres_data
7179 chown -R postgres:postgres /shared/postgres_data
7280 chown -R postgres:postgres /var/run/postgresql
73- elif [ -f /root/upgrade_postgres ]; then
74- unset RETCODE
75- /root/upgrade_postgres || RETCODE=$?
76- [ -z "${RETCODE}" ] && rm /root/upgrade_postgres || exit $RETCODE
7781 fi
82+ run_upgrade_postgres
7883 # Necessary to enable backups
7984 install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
8085
You can’t perform that action at this time.
0 commit comments