-
Notifications
You must be signed in to change notification settings - Fork 801
Create initial redis.socketed.template.yml #469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,84 @@ | ||||||||||||
| run: | ||||||||||||
| - file: | ||||||||||||
| path: /etc/service/redis/run | ||||||||||||
| chmod: "+x" | ||||||||||||
| contents: | | ||||||||||||
| #!/bin/sh | ||||||||||||
| exec 2>&1 | ||||||||||||
| exec thpoff chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf | ||||||||||||
| - file: | ||||||||||||
| path: /etc/service/redis/log/run | ||||||||||||
| chmod: "+x" | ||||||||||||
| contents: | | ||||||||||||
| #!/bin/sh | ||||||||||||
| mkdir -p /var/log/redis | ||||||||||||
| exec svlogd /var/log/redis | ||||||||||||
| - file: | ||||||||||||
| path: /etc/runit/3.d/10-redis | ||||||||||||
| chmod: "+x" | ||||||||||||
| contents: | | ||||||||||||
| #!/bin/bash | ||||||||||||
| sv stop redis | ||||||||||||
| - replace: | ||||||||||||
| filename: "/etc/redis/redis.conf" | ||||||||||||
| from: "port 6379" | ||||||||||||
| to: "port 0" | ||||||||||||
| - replace: | ||||||||||||
| filename: "/etc/redis/redis.conf" | ||||||||||||
| from: "# unixsocket /tmp/redis.sock" | ||||||||||||
| to: "unixsocket /shared/tmp/redis.sock" | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
To align with PostgreSQL, |
||||||||||||
| - replace: | ||||||||||||
| filename: "/etc/redis/redis.conf" | ||||||||||||
| from: "# unixsocketperm 700" | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
| to: "unixsocketperm 777" | ||||||||||||
| - replace: | ||||||||||||
| filename: "/etc/redis/redis.conf" | ||||||||||||
| from: /^pidfile.*$/ | ||||||||||||
| to: "" | ||||||||||||
|
|
||||||||||||
| - exec: | ||||||||||||
| cmd: | ||||||||||||
| - install -d -m 0755 -o redis -g redis /shared/redis_data | ||||||||||||
|
Comment on lines
+40
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
|
||||||||||||
| - replace: | ||||||||||||
| filename: "/etc/redis/redis.conf" | ||||||||||||
| from: /^logfile.*$/ | ||||||||||||
| to: 'logfile ""' | ||||||||||||
|
|
||||||||||||
| - replace: | ||||||||||||
| filename: "/etc/redis/redis.conf" | ||||||||||||
| from: /^bind .*$/ | ||||||||||||
| to: "" | ||||||||||||
|
|
||||||||||||
| - replace: | ||||||||||||
| filename: "/etc/redis/redis.conf" | ||||||||||||
| from: /^dir .*$/ | ||||||||||||
| to: "dir /shared/redis_data" | ||||||||||||
|
|
||||||||||||
| - replace: | ||||||||||||
| filename: "/etc/redis/redis.conf" | ||||||||||||
| from: /^protected-mode yes/ | ||||||||||||
| to: "protected-mode no" | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+57
to
+62
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Protected mode allows UNIX socket connections, so leave this untouched:
Suggested change
|
||||||||||||
| - exec: | ||||||||||||
| cmd: echo redis installed | ||||||||||||
| hook: redis | ||||||||||||
| - exec: cat /etc/redis/redis.conf | grep logfile | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid
Suggested change
|
||||||||||||
|
|
||||||||||||
| - exec: | ||||||||||||
| background: true | ||||||||||||
| cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf | ||||||||||||
|
|
||||||||||||
| - exec: sleep 10 | ||||||||||||
|
|
||||||||||||
| # we can not migrate without redis, launch it if needed | ||||||||||||
| hooks: | ||||||||||||
| before_code: | ||||||||||||
| - exec: | ||||||||||||
| background: true | ||||||||||||
| cmd: exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf | ||||||||||||
| after_code: | ||||||||||||
| - replace: | ||||||||||||
| filename: /etc/service/unicorn/run | ||||||||||||
| from: "# redis" | ||||||||||||
| to: sv start redis || exit 1 | ||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.