Initialize the database
Install on Debian 12 failed to initialize the database on its own so adding pg_createcluster to do this.
This commit is contained in:
parent
49e2fb434d
commit
c2bba26431
|
|
@ -58,15 +58,6 @@ if [ ."$database_repo" = ."2ndquadrant" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#systemd
|
|
||||||
if [ ."$database_host" = ."127.0.0.1" ] || [ ."$database_host" = ."::1" ] ; then
|
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl restart postgresql
|
|
||||||
fi
|
|
||||||
|
|
||||||
#init.d
|
|
||||||
#/usr/sbin/service postgresql restart
|
|
||||||
|
|
||||||
#install the database backup
|
#install the database backup
|
||||||
#cp backup/fusionpbx-backup /etc/cron.daily
|
#cp backup/fusionpbx-backup /etc/cron.daily
|
||||||
#cp backup/fusionpbx-maintenance /etc/cron.daily
|
#cp backup/fusionpbx-maintenance /etc/cron.daily
|
||||||
|
|
@ -75,9 +66,21 @@ fi
|
||||||
#sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-backup
|
#sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-backup
|
||||||
#sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-maintenance
|
#sed -i "s/zzz/$password/g" /etc/cron.daily/fusionpbx-maintenance
|
||||||
|
|
||||||
|
#initialize the database
|
||||||
|
pg_createcluster $database_version main
|
||||||
|
|
||||||
#replace scram-sha-256 with md5
|
#replace scram-sha-256 with md5
|
||||||
sed -i /etc/postgresql/$database_version/main/pg_hba.conf -e '/^#/!s/scram-sha-256/md5/g'
|
sed -i /etc/postgresql/$database_version/main/pg_hba.conf -e '/^#/!s/scram-sha-256/md5/g'
|
||||||
|
|
||||||
|
#systemd
|
||||||
|
if [ ."$database_host" = ."127.0.0.1" ] || [ ."$database_host" = ."::1" ] ; then
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart postgresql
|
||||||
|
fi
|
||||||
|
|
||||||
|
#init.d
|
||||||
|
#/usr/sbin/service postgresql restart
|
||||||
|
|
||||||
#move to /tmp to prevent a red herring error when running sudo with psql
|
#move to /tmp to prevent a red herring error when running sudo with psql
|
||||||
cwd=$(pwd)
|
cwd=$(pwd)
|
||||||
cd /tmp
|
cd /tmp
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue