From 99b8524c16cc99ceeaf1ebf588f2fc0f2c0fbe0a Mon Sep 17 00:00:00 2001 From: Cullum Smith Date: Sat, 12 Oct 2024 08:14:59 -0400 Subject: add a bunch of hostclasses --- scripts/hostclass/postgresql_server | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts/hostclass/postgresql_server') diff --git a/scripts/hostclass/postgresql_server b/scripts/hostclass/postgresql_server index a09c9f4..fb0ddcd 100644 --- a/scripts/hostclass/postgresql_server +++ b/scripts/hostclass/postgresql_server @@ -1,5 +1,7 @@ #!/bin/sh +# PostgreSQL jails need allow.sysvipc=1. + : ${postgres_max_connections:='128'} : ${postgres_shared_buffers:="$(( memsize / 2 ))"} : ${postgres_work_mem:="$(( memsize / 4 / ${postgres_max_connections} ))"} @@ -9,7 +11,7 @@ postgres_user=postgres postgres_home=/var/db/postgres -postgres_data_dir="${postgres_home}/data${postgres_version}" +postgres_data_dir="${postgres_home}/data${postgresql_version}" postgres_tls_cert="${postgres_home}/postgres.crt" postgres_tls_key="${postgres_home}/postgres.key" postgres_keytab="${keytab_dir}/postgres.keytab" @@ -67,8 +69,8 @@ service postgresql restart > /dev/null 2>&1 < /dev/null psql -c "DO \$$ BEGIN - IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '${boxconf_user}') THEN - CREATE ROLE \"${boxconf_user}\" WITH LOGIN SUPERUSER; + IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '${boxconf_username}') THEN + CREATE ROLE \"${boxconf_username}\" WITH LOGIN SUPERUSER; END IF; END \$$" -- cgit v1.2.3