Teach pg10 template how to install itself for rollbacks

Teach pg10 template how to install itself for rollbacks

diff --git a/templates/postgres.10.template.yml b/templates/postgres.10.template.yml
index b9f85ed..63f06bd 100644
--- a/templates/postgres.10.template.yml
+++ b/templates/postgres.10.template.yml
@@ -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:

GitHub sha: 82e4d76f