Skip to content

chore: add PG prestart script #984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ansible/files/postgres_prestart.sh.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

if [ $(cat /etc/locale.gen | grep -c en_US.UTF-8) -eq 0 ]; then
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
fi

if [ $(locale -a | grep -c en_US.utf8) -eq 0 ]; then
locale-gen
fi
1 change: 1 addition & 0 deletions ansible/files/postgresql_config/postgresql.service.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ After=database-optimizations.service
Type=notify
User=postgres
ExecStart=/usr/lib/postgresql/bin/postgres -D /etc/postgresql
ExecStartPre=+/usr/local/bin/postgres_prestart.sh
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
Expand Down
7 changes: 7 additions & 0 deletions ansible/tasks/internal/postgresql-prestart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: postgres_prestart - create service file
template:
src: files/postgres_prestart.sh.j2
dest: /usr/local/bin/postgres_prestart.sh
mode: a+x
owner: root
group: root
3 changes: 3 additions & 0 deletions ansible/tasks/setup-supabase-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@

- name: Install pg_egress_collect
import_tasks: internal/pg_egress_collect.yml

- name: Install PostgreSQL prestart script
import_tasks: internal/postgresql-prestart.yml
2 changes: 1 addition & 1 deletion common.vars.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
postgres-version = "15.1.1.56"
postgres-version = "15.1.1.57"