mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
Fix the PostgreSQL initial setup issues on FreeBSD
This commit is contained in:
parent
90deeb9eac
commit
868d6b1ad9
10
hammer.py
10
hammer.py
@ -1042,6 +1042,8 @@ def _configure_mysql(system, revision, features):
|
|||||||
def _enable_postgresql(system):
|
def _enable_postgresql(system):
|
||||||
if system == 'alpine':
|
if system == 'alpine':
|
||||||
execute('sudo rc-update add postgresql')
|
execute('sudo rc-update add postgresql')
|
||||||
|
elif system == 'freebsd':
|
||||||
|
execute('sudo sysrc postgresql_enable="yes"')
|
||||||
else:
|
else:
|
||||||
execute('sudo systemctl enable postgresql.service')
|
execute('sudo systemctl enable postgresql.service')
|
||||||
|
|
||||||
@ -1068,9 +1070,11 @@ def _configure_pgsql(system, features):
|
|||||||
else:
|
else:
|
||||||
execute('sudo postgresql-setup --initdb --unit postgresql')
|
execute('sudo postgresql-setup --initdb --unit postgresql')
|
||||||
elif system == 'freebsd':
|
elif system == 'freebsd':
|
||||||
# pgsql must be enabled before running initdb
|
execute('[ ! -d /var/db/postgres/data11 ] && sudo /usr/local/etc/rc.d/postgresql oneinitdb || true')
|
||||||
execute('sudo sysrc postgresql_enable="yes"')
|
# if the file '/var/db/postgres/data11/postmaster.opts' does not exist the 'restart' of postgresql will fail with error:
|
||||||
execute('[ ! -d /var/db/postgres/data11 ] && sudo /usr/local/etc/rc.d/postgresql initdb || true')
|
# pg_ctl: could not read file "/var/db/postgres/data11/postmaster.opts"
|
||||||
|
# the initial start of the postgresql will create the 'postmaster.opts' file
|
||||||
|
execute('sudo [ ! -f /var/db/postgres/data11/postmaster.opts ] && sudo service postgresql onestart > /dev/null')
|
||||||
|
|
||||||
_enable_postgresql(system)
|
_enable_postgresql(system)
|
||||||
_restart_postgresql(system)
|
_restart_postgresql(system)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user