Commit | Line | Data |
---|---|---|
9fb5f2d3 SS |
1 | run: |
2 | - file: | |
3 | path: /etc/service/redis/run | |
4 | chmod: "+x" | |
5 | contents: | | |
6 | #!/bin/sh | |
7 | exec 2>&1 | |
56e5e6c2 | 8 | exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf |
9fb5f2d3 | 9 | |
074f2b6a S |
10 | - file: |
11 | path: /etc/runit/3.d/10-redis | |
12 | chmod: "+x" | |
13 | contents: | | |
14 | #!/bin/bash | |
15 | sv stop redis | |
16 | ||
9fb5f2d3 SS |
17 | - replace: |
18 | filename: "/etc/redis/redis.conf" | |
19 | from: "daemonize yes" | |
20 | to: "" | |
21 | - replace: | |
22 | filename: "/etc/redis/redis.conf" | |
23 | from: /^pidfile.*$/ | |
24 | to: "" | |
25 | ||
26 | - exec: | |
27 | cmd: | |
28 | - install -d -m 0755 -o redis -g redis /shared/redis_data | |
29 | ||
30 | - replace: | |
31 | filename: "/etc/redis/redis.conf" | |
32 | from: /^logfile.*$/ | |
33 | to: "logfile \"\"" | |
34 | ||
b7800a2b S |
35 | - replace: |
36 | filename: "/etc/redis/redis.conf" | |
37 | from: /^bind .*$/ | |
38 | to: "" | |
39 | ||
9fb5f2d3 SS |
40 | - replace: |
41 | filename: "/etc/redis/redis.conf" | |
42 | from: /^dir .*$/ | |
43 | to: "dir /shared/redis_data" | |
44 | ||
45 | - exec: | |
46 | cmd: echo redis installed | |
47 | hook: redis | |
48 | ||
49 | # we can not migrate without redis, launch it if needed | |
50 | hooks: | |
51 | before_code: | |
52 | - exec: | |
53 | background: true | |
c244475c | 54 | cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf |
9fb5f2d3 | 55 | after_code: |
9fb5f2d3 SS |
56 | - replace: |
57 | filename: /etc/service/unicorn/run | |
58 | from: "# redis" | |
59 | to: sv start redis || exit 1 |