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 |
7e9f61fd S |
9 | - file: |
10 | path: /etc/service/redis/log/run | |
11 | chmod: "+x" | |
12 | contents: | | |
13 | #!/bin/sh | |
14 | mkdir -p /var/log/redis | |
15 | exec svlogd /var/log/redis | |
074f2b6a S |
16 | - file: |
17 | path: /etc/runit/3.d/10-redis | |
18 | chmod: "+x" | |
19 | contents: | | |
20 | #!/bin/bash | |
21 | sv stop redis | |
22 | ||
9fb5f2d3 SS |
23 | - replace: |
24 | filename: "/etc/redis/redis.conf" | |
25 | from: "daemonize yes" | |
26 | to: "" | |
27 | - replace: | |
28 | filename: "/etc/redis/redis.conf" | |
29 | from: /^pidfile.*$/ | |
30 | to: "" | |
31 | ||
32 | - exec: | |
33 | cmd: | |
34 | - install -d -m 0755 -o redis -g redis /shared/redis_data | |
35 | ||
36 | - replace: | |
37 | filename: "/etc/redis/redis.conf" | |
38 | from: /^logfile.*$/ | |
39 | to: "logfile \"\"" | |
40 | ||
b7800a2b S |
41 | - replace: |
42 | filename: "/etc/redis/redis.conf" | |
43 | from: /^bind .*$/ | |
44 | to: "" | |
45 | ||
9fb5f2d3 SS |
46 | - replace: |
47 | filename: "/etc/redis/redis.conf" | |
48 | from: /^dir .*$/ | |
49 | to: "dir /shared/redis_data" | |
50 | ||
51 | - exec: | |
52 | cmd: echo redis installed | |
53 | hook: redis | |
1475ee45 S |
54 | - exec: cat /etc/redis/redis.conf | grep logfile |
55 | ||
56 | - exec: | |
57 | background: true | |
58 | cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf | |
59 | ||
60 | - exec: sleep 10 | |
9fb5f2d3 SS |
61 | |
62 | # we can not migrate without redis, launch it if needed | |
63 | hooks: | |
64 | before_code: | |
65 | - exec: | |
66 | background: true | |
c244475c | 67 | cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf |
9fb5f2d3 | 68 | after_code: |
9fb5f2d3 SS |
69 | - replace: |
70 | filename: /etc/service/unicorn/run | |
71 | from: "# redis" | |
72 | to: sv start redis || exit 1 |