Commit | Line | Data |
---|---|---|
86b9032b RSS |
1 | params: |
2 | redis_io_threads: "1" | |
3 | ||
9fb5f2d3 SS |
4 | run: |
5 | - file: | |
6 | path: /etc/service/redis/run | |
7 | chmod: "+x" | |
8 | contents: | | |
9 | #!/bin/sh | |
10 | exec 2>&1 | |
1404e881 | 11 | exec thpoff chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf |
7e9f61fd S |
12 | - file: |
13 | path: /etc/service/redis/log/run | |
14 | chmod: "+x" | |
15 | contents: | | |
16 | #!/bin/sh | |
17 | mkdir -p /var/log/redis | |
18 | exec svlogd /var/log/redis | |
074f2b6a S |
19 | - file: |
20 | path: /etc/runit/3.d/10-redis | |
21 | chmod: "+x" | |
22 | contents: | | |
23 | #!/bin/bash | |
24 | sv stop redis | |
25 | ||
9fb5f2d3 SS |
26 | - replace: |
27 | filename: "/etc/redis/redis.conf" | |
28 | from: "daemonize yes" | |
29 | to: "" | |
30 | - replace: | |
31 | filename: "/etc/redis/redis.conf" | |
32 | from: /^pidfile.*$/ | |
33 | to: "" | |
34 | ||
35 | - exec: | |
36 | cmd: | |
37 | - install -d -m 0755 -o redis -g redis /shared/redis_data | |
38 | ||
39 | - replace: | |
40 | filename: "/etc/redis/redis.conf" | |
41 | from: /^logfile.*$/ | |
42 | to: "logfile \"\"" | |
43 | ||
b7800a2b S |
44 | - replace: |
45 | filename: "/etc/redis/redis.conf" | |
46 | from: /^bind .*$/ | |
47 | to: "" | |
48 | ||
9fb5f2d3 SS |
49 | - replace: |
50 | filename: "/etc/redis/redis.conf" | |
51 | from: /^dir .*$/ | |
52 | to: "dir /shared/redis_data" | |
53 | ||
281190ef SS |
54 | - replace: |
55 | filename: "/etc/redis/redis.conf" | |
56 | from: /^protected-mode yes/ | |
57 | to: "protected-mode no" | |
58 | ||
86b9032b RSS |
59 | - replace: |
60 | filename: "/etc/redis/redis.conf" | |
61 | from: "# io-threads 4" | |
62 | to: "io-threads $redis_io_threads" | |
63 | ||
9fb5f2d3 SS |
64 | - exec: |
65 | cmd: echo redis installed | |
66 | hook: redis | |
1475ee45 S |
67 | - exec: cat /etc/redis/redis.conf | grep logfile |
68 | ||
69 | - exec: | |
70 | background: true | |
71 | cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf | |
72 | ||
73 | - exec: sleep 10 | |
9fb5f2d3 SS |
74 | |
75 | # we can not migrate without redis, launch it if needed | |
76 | hooks: | |
77 | before_code: | |
78 | - exec: | |
79 | background: true | |
c244475c | 80 | cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf |
9fb5f2d3 | 81 | after_code: |
9fb5f2d3 SS |
82 | - replace: |
83 | filename: /etc/service/unicorn/run | |
84 | from: "# redis" | |
85 | to: sv start redis || exit 1 |