From c244475cb52f8125250e56917f6af1f69a5a0cd8 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 9 Oct 2014 13:13:47 +1100 Subject: [PATCH] FIX: stop using su to daemonize stuff, we have no process to talk to FIX: use fast shutdown for postgres --- templates/postgres.template.yml | 4 +++- templates/redis.template.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index 990f6f88e..0b2a3238d 100644 --- a/templates/postgres.template.yml +++ b/templates/postgres.template.yml @@ -157,7 +157,9 @@ run: - exec: background: true - cmd: su - postgres -c '/usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main' + # use fast shutdown for pg + stop_signal: INT + cmd: HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main # give db a few secs to start up - exec: "sleep 5" diff --git a/templates/redis.template.yml b/templates/redis.template.yml index 9b177857d..1c61d0cd0 100644 --- a/templates/redis.template.yml +++ b/templates/redis.template.yml @@ -39,7 +39,7 @@ hooks: before_code: - exec: background: true - cmd: su - redis -s /bin/bash -c '/usr/bin/redis-server /etc/redis/redis.conf' + cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf after_code: - replace: filename: /etc/service/unicorn/run