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 | |
1404e881 | 8 | exec thpoff 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 | ||
281190ef SS |
51 | - replace: |
52 | filename: "/etc/redis/redis.conf" | |
53 | from: /^protected-mode yes/ | |
54 | to: "protected-mode no" | |
55 | ||
9fb5f2d3 SS |
56 | - exec: |
57 | cmd: echo redis installed | |
58 | hook: redis | |
1475ee45 S |
59 | - exec: cat /etc/redis/redis.conf | grep logfile |
60 | ||
61 | - exec: | |
62 | background: true | |
63 | cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf | |
64 | ||
65 | - exec: sleep 10 | |
9fb5f2d3 SS |
66 | |
67 | # we can not migrate without redis, launch it if needed | |
68 | hooks: | |
69 | before_code: | |
70 | - exec: | |
71 | background: true | |
c244475c | 72 | cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf |
9fb5f2d3 | 73 | after_code: |
9fb5f2d3 SS |
74 | - replace: |
75 | filename: /etc/service/unicorn/run | |
76 | from: "# redis" | |
77 | to: sv start redis || exit 1 |