From 56e5e6c2a16fd0a24bc7271901b51264f101fd01 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 25 Aug 2014 12:22:19 +1000 Subject: [PATCH] FIX: use chpst to avoid extra process that interferes with signals --- templates/postgres.template.yml | 2 +- templates/redis.template.yml | 2 +- templates/web.template.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/postgres.template.yml b/templates/postgres.template.yml index 037dc5e..cdc3f46 100644 --- a/templates/postgres.template.yml +++ b/templates/postgres.template.yml @@ -26,7 +26,7 @@ run: contents: | #!/bin/sh exec 2>&1 - exec su - postgres -c '/usr/lib/postgresql/9.3/bin/postmaster -D /etc/postgresql/9.3/main' + 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 - file: path: /root/upgrade_postgres chmod: "+x" diff --git a/templates/redis.template.yml b/templates/redis.template.yml index 8cea623..9b17785 100644 --- a/templates/redis.template.yml +++ b/templates/redis.template.yml @@ -5,7 +5,7 @@ run: contents: | #!/bin/sh exec 2>&1 - exec su - redis -s /bin/bash -c '/usr/bin/redis-server /etc/redis/redis.conf' + exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf - replace: filename: "/etc/redis/redis.conf" diff --git a/templates/web.template.yml b/templates/web.template.yml index 6263a10..b177e91 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -42,7 +42,7 @@ run: # postgres cd $home chown -R discourse:www-data /shared/log/rails - LD_PRELOAD=/usr/lib/libjemalloc.so.1 exec su discourse -c 'bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb' + LD_PRELOAD=/usr/lib/libjemalloc.so.1 HOME=/home/discourse USER=discourse exec chpst -u discourse:www-data -U discourse:www-data bundle exec config/unicorn_launcher -E production -c config/unicorn.conf.rb - file: path: /etc/service/nginx/run -- 2.25.1