FIX: stop using su to daemonize stuff, we have no process to talk to
authorSam <sam.saffron@gmail.com>
Thu, 9 Oct 2014 02:13:47 +0000 (13:13 +1100)
committerSam <sam.saffron@gmail.com>
Thu, 9 Oct 2014 02:14:03 +0000 (13:14 +1100)
FIX: use fast shutdown for postgres

templates/postgres.template.yml
templates/redis.template.yml

index 990f6f88e345c03601168ba9beb472ed1d100f07..0b2a3238d9b1699f8972172444e4a1502e311237 100644 (file)
@@ -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"
index 9b177857de59eec03a8628298156e92fbc732a3e..1c61d0cd04e71bbd507b1194885b26a0a210947f 100644 (file)
@@ -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