Permalink
Browse files

Redis configuration parameters.

  • Loading branch information...
1 parent 76d1e0a commit aa3ceb66a5442d9fd24a30998e03aedb5801eb5e @wayneeseguin wayneeseguin committed Mar 24, 2011
Showing with 22 additions and 7 deletions.
  1. +10 −1 redis/bin/install
  2. +12 −6 redis/scripts/initialize
View
@@ -68,7 +68,9 @@ create_redis_directories()
for redis_path in "${redis_paths[@]}" ; do
[[ ! -d "$redis_path" ]] && mkdir -p "$redis_path"
+ chown -R $user "$redis_path"
done
+ [[ ! -d "${redis_install_path}" ]] && mkdir -p "${redis_install_path}"
return 0
}
@@ -89,7 +91,14 @@ install_redis_conf()
log "${redis_config_file} already exists, not overwriting."
else
log "#installing redis.conf file to ${redis_config_file}"
- cp -f "$redis_src_path/redis.conf" "${redis_config_file}"
+
+ sed -e "s#pidfile .*\$#pidfile ${redis_pid_file}#" \
+ -e "s#logfile .*\$#logfile ${redis_log_file}#" \
+ -e "s#dir .*\$#dir ${redis_db_path}#" \
+ -e "s#dbfilename .*\$#dbfilename ${redis_db_file}#" \
+ -e "s#port .*\$#port ${redis_port}#" \
+ -e "s#bind .*\$#bind ${redis_bind_interface}#" >
+ "${redis_config_file}"
fi
return 0
}
@@ -54,26 +54,32 @@ fi
true ${src_path:="$prefix/src"}
# Redis Configuration.
+true ${redis_port:=6379}
+true ${redis_bind_interface:="127.0.0.1"}
true ${redis_src_path:="${src_path}/${package}-${version}"}
true ${redis_install_path:="$prefix"}
true ${redis_bin_path:="${redis_install_path}/bin"}
true ${redis_config_path:="/etc/redis"}
true ${redis_config_file:="${redis_config_path}/redis.conf"}
true ${redis_servers_path:="$redis_etc_path/servers"}
-true ${redis_spool_path:="/var/spool/redis"}
true ${redis_log_path:="/var/log/redis"}
+true ${redis_log_file:="/var/log/redis/redis.log"}
true ${redis_server_binary:="${redis_bin_path}/redis-server"}
true ${redis_cli_binary:="${redis_bin_path}/redis-cli"}
-true ${redis_pid_file:="/var/run/redis.pid"}
-true ${redis_lock_file:="/var/lock/redis.lock"}
+true ${redis_pid_path:="/var/run/redis"}
+true ${redis_pid_file:="${redis_pid_path}/redis.pid"}
+true ${redis_db_path:="/var/lib/redis"}
+true ${redis_db_file:="${redis_db_path}/dump.rdb"}
+true ${redis_lock_path:="/var/lock/redis"}
+true ${redis_lock_file:="${redis_lock_path}/redis.lock"}
redis_paths=(
- "${redis_src_path}"
- "${redis_install_path}"
"${redis_bin_path}"
"${redis_config_path}"
+ "${redis_pid_path}"
+ "${redis_db_path}"
+ "${redis_lock_path}"
"${redis_servers_path}"
- "${redis_spool_path}"
"${redis_log_path}"
)

0 comments on commit aa3ceb6

Please sign in to comment.