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 | ||
35 | - replace: | |
36 | filename: "/etc/redis/redis.conf" | |
37 | from: /^dir .*$/ | |
38 | to: "dir /shared/redis_data" | |
39 | ||
40 | - exec: | |
41 | cmd: echo redis installed | |
42 | hook: redis | |
43 | ||
44 | # we can not migrate without redis, launch it if needed | |
45 | hooks: | |
46 | before_code: | |
47 | - exec: | |
48 | background: true | |
c244475c | 49 | cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf |
9fb5f2d3 | 50 | after_code: |
9fb5f2d3 SS |
51 | - replace: |
52 | filename: /etc/service/unicorn/run | |
53 | from: "# redis" | |
54 | to: sv start redis || exit 1 |