Skip to content

Commit 5c96a22

Browse files
committed
Merge pull request echocat#2 from pulyaevsky/master
Updated templates to use correct format for variables instead of deprecated one
2 parents 55b71ad + a280a24 commit 5c96a22

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

templates/etc/init.d/debian_redis-server.erb

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
# chkconfig: - 85 15
66
# description: Redis is a persistent key-value database
77
# processname: redis-server
8-
# config: /etc/redis_<%= redis_name %>.conf
9-
# pidfile: /var/run/redis_<%= redis_name %>.pid
8+
# config: /etc/redis_<%= @redis_name %>.conf
9+
# pidfile: /var/run/redis_<%= @redis_name %>.pid
1010

1111
# Source function library.
1212
. /lib/lsb/init-functions
1313

14-
REDIS_EXEC="<%= redis_install_dir %>/redis-server"
15-
REDIS_NAME="redis-server_<%= redis_name %>"
16-
REDIS_PID="/var/run/redis_<%= redis_name %>.pid"
17-
REDIS_LOCKFILE="/var/lock/redis_<%= redis_name %>"
18-
REDIS_CONF_FILE="/etc/redis_<%= redis_name %>.conf"
14+
REDIS_EXEC="<%= @redis_install_dir %>/redis-server"
15+
REDIS_NAME="redis-server_<%= @redis_name %>"
16+
REDIS_PID="/var/run/redis_<%= @redis_name %>.pid"
17+
REDIS_LOCKFILE="/var/lock/redis_<%= @redis_name %>"
18+
REDIS_CONF_FILE="/etc/redis_<%= @redis_name %>.conf"
1919

2020
[ -x "$REDIS_EXEC" ] || exit 5
2121

templates/etc/init.d/redhat_redis-server.erb

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# processname: redis-server
88
# config: /etc/redis.conf
99
# config: /etc/sysconfig/redis
10-
# pidfile: /var/run/redis_<%= redis_name %>.pid
10+
# pidfile: /var/run/redis_<%= @redis_name %>.pid
1111

1212
# Source function library.
1313
. /etc/rc.d/init.d/functions
@@ -18,15 +18,15 @@
1818
# Check that networking is up.
1919
[ "$NETWORKING" = "no" ] && exit 0
2020

21-
redis="<%= redis_install_dir %>/redis-server"
22-
prog="$(basename $redis)_<%= redis_name %>"
23-
pidfile="/var/run/redis_<%= redis_name %>.pid"
21+
redis="<%= @redis_install_dir %>/redis-server"
22+
prog="$(basename $redis)_<%= @redis_name %>"
23+
pidfile="/var/run/redis_<%= @redis_name %>.pid"
2424

25-
REDIS_CONF_FILE="/etc/redis_<%= redis_name %>.conf"
25+
REDIS_CONF_FILE="/etc/redis_<%= @redis_name %>.conf"
2626

2727
#[ -f /etc/sysconfig/redis ] && . /etc/sysconfig/redis
2828

29-
lockfile="/var/lock/subsys/redis_<%= redis_name %>"
29+
lockfile="/var/lock/subsys/redis_<%= @redis_name %>"
3030

3131
start() {
3232
[ -x $redis ] || exit 5

templates/etc/redis.conf.erb

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@
1515
# units are case insensitive so 1GB 1Gb 1gB are all the same.
1616

1717
# By default Redis does not run as a daemon. Use 'yes' if you need it.
18-
# Note that Redis will write a pid file in /var/run/redis_<%= redis_name %>.pid when daemonized.
18+
# Note that Redis will write a pid file in /var/run/redis_<%= @redis_name %>.pid when daemonized.
1919
daemonize yes
2020

2121
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
2222
# default. You can specify a custom pid file location here.
23-
pidfile /var/run/redis_<%= redis_name %>.pid
23+
pidfile /var/run/redis_<%= @redis_name %>.pid
2424

2525
# Accept connections on the specified port, default is 6379.
2626
# If port 0 is specified Redis will not listen on a TCP socket.
27-
port <%= redis_port %>
27+
port <%= @redis_port %>
2828

2929
# If you want you can bind a single interface, if the bind option is not
3030
# specified all the interfaces will listen for incoming connections.
3131
#
32-
bind <%= redis_ip %>
32+
bind <%= @redis_ip %>
3333

3434
# Specify the path for the unix socket that will be used to listen for
3535
# incoming connections. There is no default, so Redis will not listen
@@ -46,12 +46,12 @@ timeout 0
4646
# verbose (many rarely useful info, but not a mess like the debug level)
4747
# notice (moderately verbose, what you want in production probably)
4848
# warning (only very important / critical messages are logged)
49-
loglevel <%= redis_loglevel %>
49+
loglevel <%= @redis_loglevel %>
5050

5151
# Specify the log file name. Also 'stdout' can be used to force
5252
# Redis to log on the standard output. Note that if you use standard
5353
# output for logging but daemonize, logs will be sent to /dev/null
54-
logfile <%= redis_log_dir %>/redis_<%= redis_name %>.log
54+
logfile <%= @redis_log_dir %>/redis_<%= @redis_name %>.log
5555

5656
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
5757
# and optionally update the other syslog parameters to suit your needs.
@@ -66,7 +66,7 @@ logfile <%= redis_log_dir %>/redis_<%= redis_name %>.log
6666
# Set the number of databases. The default database is DB 0, you can select
6767
# a different one on a per-connection basis using SELECT <dbid> where
6868
# dbid is a number between 0 and 'databases'-1
69-
databases <%= redis_nr_dbs %>
69+
databases <%= @redis_nr_dbs %>
7070

7171
################################ SNAPSHOTTING #################################
7272
#
@@ -95,7 +95,7 @@ databases <%= redis_nr_dbs %>
9595
rdbcompression yes
9696

9797
# The filename where to dump the DB
98-
dbfilename <%= redis_dbfilename %>
98+
dbfilename <%= @redis_dbfilename %>
9999

100100
# The working directory.
101101
#
@@ -105,7 +105,7 @@ dbfilename <%= redis_dbfilename %>
105105
# Also the Append Only File will be created inside this directory.
106106
#
107107
# Note that you must specify a directory here, not a file name.
108-
dir <%= redis_dir %>/redis_<%= redis_name %>
108+
dir <%= @redis_dir %>/redis_<%= @redis_name %>
109109

110110
################################# REPLICATION #################################
111111

@@ -241,7 +241,7 @@ slave-serve-stale-data yes
241241
# errors for write operations, and this may even lead to DB inconsistency.
242242
#
243243
# maxmemory <bytes>
244-
maxmemory <%= redis_memory %>
244+
maxmemory <%= @redis_memory %>
245245

246246
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
247247
# is reached? You can select among five behavior:
@@ -265,7 +265,7 @@ maxmemory <%= redis_memory %>
265265
# The default is:
266266
#
267267
# maxmemory-policy volatile-lru
268-
maxmemory-policy <%= redis_mempolicy %>
268+
maxmemory-policy <%= @redis_mempolicy %>
269269

270270
# LRU and minimal TTL algorithms are not precise algorithms but approximated
271271
# algorithms (in order to save memory), so you can select as well the sample
@@ -319,7 +319,7 @@ appendonly no
319319
# If unsure, use "everysec".
320320

321321
# appendfsync always
322-
appendfsync <%= redis_appedfsync %>
322+
appendfsync <%= @redis_appedfsync %>
323323
# appendfsync no
324324

325325
# When the AOF fsync policy is set to always or everysec, and a background

templates/logrotate.conf.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Rotate redis with standard logrotate.
44

5-
<%= redis_log_dir %>/redis_<%= redis_name %>.log {
5+
<%= @redis_log_dir %>/redis_<%= @redis_name %>.log {
66
weekly
77
missingok
88
copytruncate

0 commit comments

Comments
 (0)