From 001f8da256d501b6dab6137ec3038d8921478f66 Mon Sep 17 00:00:00 2001 From: dvir volk Date: Mon, 3 Oct 2011 10:58:43 +0200 Subject: [PATCH] fixes to install script and template --- utils/install_server.sh | 18 ++++++++++++------ utils/redis.conf.tpl | 4 ++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/utils/install_server.sh b/utils/install_server.sh index d1ae0df81..0ac98a79a 100755 --- a/utils/install_server.sh +++ b/utils/install_server.sh @@ -41,10 +41,18 @@ if [ !"$REDIS_CONFIG_FILE" ] ; then REDIS_CONFIG_FILE=$_REDIS_CONFIG_FILE echo "Selected default - $REDIS_CONFIG_FILE" fi - -#try and create +#try and create it mkdir -p `dirname "$REDIS_CONFIG_FILE"` || die "Could not create redis config directory" +#read the redis log file path +_REDIS_LOG_FILE="/var/log/redis_$REDIS_PORT.log" +read -p "Please select the redis log file name [$_REDIS_LOG_FILE] " REDIS_LOG_FILE +if [ !"$REDIS_LOG_FILE" ] ; then + REDIS_LOG_FILE=$_REDIS_LOG_FILE + echo "Selected default - $REDIS_LOG_FILE" +fi + + #get the redis data directory _REDIS_DATA_DIR="/var/lib/redis/$REDIS_PORT" read -p "Please select the data directory for this instance [$_REDIS_DATA_DIR] " REDIS_DATA_DIR @@ -52,9 +60,7 @@ if [ !"$REDIS_DATA_DIR" ] ; then REDIS_DATA_DIR=$_REDIS_DATA_DIR echo "Selected default - $REDIS_DATA_DIR" fi -#try the data directory setting -mkdir -p `dirname "$REDIS_DATA_DIR"` || die "Could not create redis data directory" - +mkdir -p $REDIS_DATA_DIR || die "Could not create redis data directory" #get the redis executable path _REDIS_EXECUTABLE=`which redis-server` @@ -104,7 +110,7 @@ CONF=\"$REDIS_CONFIG_FILE\"\n\n echo $REDIS_INIT_HEADER > $TMP_FILE && cat $INIT_TPL_FILE >> $TMP_FILE || die "Could not write init script to $TMP_FILE" #copy to /etc/init.d -cp -f $TMP_FILE $INIT_SCRIPT_DEST || die "Could not copy redis init script to $INIT_SCRIPT_DEST" +cp -f $TMP_FILE $INIT_SCRIPT_DEST && chmod +x $INIT_SCRIPT_DEST || die "Could not copy redis init script to $INIT_SCRIPT_DEST" echo "Copied $TMP_FILE => $INIT_SCRIPT_DEST" #Install the service diff --git a/utils/redis.conf.tpl b/utils/redis.conf.tpl index 0c1a07ea6..a146fcfbb 100644 --- a/utils/redis.conf.tpl +++ b/utils/redis.conf.tpl @@ -14,7 +14,7 @@ # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note that Redis will write a pid file in /var/run/redis.pid when daemonized. -daemonize no +daemonize yes # When running daemonized, Redis writes a pid file in /var/run/redis.pid by # default. You can specify a custom pid file location here. @@ -317,7 +317,7 @@ auto-aof-rewrite-min-size 64mb # Max execution time of a Lua script in milliseconds. # This prevents that a programming error generating an infinite loop will block # your server forever. Set it to 0 or a negative value for unlimited execution. -lua-time-limit 60000 +#lua-time-limit 60000 ################################## SLOW LOG ###################################