Teach pg10 template how to install itself for rollbacks
authorRafael dos Santos Silva <xfalcox@gmail.com>
Tue, 12 May 2020 22:44:11 +0000 (19:44 -0300)
committerRafael dos Santos Silva <xfalcox@gmail.com>
Tue, 12 May 2020 22:44:11 +0000 (19:44 -0300)
templates/postgres.10.template.yml

index b9f85ed6d0d2a68ff4807849676141996a4d0d18..63f06bdef75947cef709ea011d10215333730f27 100644 (file)
@@ -19,6 +19,8 @@ hooks:
        to: sv start postgres || exit 1
 
 run:
+  - exec: apt-get remove -y postgresql-12 postgresql-client-12 postgresql-contrib-12
+  - exec: apt-get update && apt-get install -y postgresql-10 postgresql-client-10 postgresql-contrib-10
   - exec: mkdir -p /shared/postgres_run
   - exec: chown postgres:postgres /shared/postgres_run
   - exec: chmod 775 /shared/postgres_run
@@ -35,6 +37,7 @@ run:
      contents: |
         #!/bin/sh
         exec 2>&1
+        echo -1000 >/proc/self/oom_score_adj
         HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/10/bin/postmaster -D /etc/postgresql/10/main
 
   - file: