From: Sam Date: Thu, 9 Oct 2014 02:13:47 +0000 (+1100) Subject: FIX: stop using su to daemonize stuff, we have no process to talk to X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c244475cb52f8125250e56917f6af1f69a5a0cd8;p=discourse_docker.git FIX: stop using su to daemonize stuff, we have no process to talk to FIX: use fast shutdown for postgres --- diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index 990f6f8..0b2a323 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 9b17785..1c61d0c 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