Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
001f8da2
Commit
001f8da2
authored
Oct 03, 2011
by
dvir volk
Browse files
fixes to install script and template
parent
9210e701
Changes
2
Hide whitespace changes
Inline
Side-by-side
utils/install_server.sh
View file @
001f8da2
...
@@ -41,10 +41,18 @@ if [ !"$REDIS_CONFIG_FILE" ] ; then
...
@@ -41,10 +41,18 @@ if [ !"$REDIS_CONFIG_FILE" ] ; then
REDIS_CONFIG_FILE
=
$_REDIS_CONFIG_FILE
REDIS_CONFIG_FILE
=
$_REDIS_CONFIG_FILE
echo
"Selected default -
$REDIS_CONFIG_FILE
"
echo
"Selected default -
$REDIS_CONFIG_FILE
"
fi
fi
#try and create it
#try and create
mkdir
-p
`
dirname
"
$REDIS_CONFIG_FILE
"
`
||
die
"Could not create redis config directory"
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
#get the redis data directory
_REDIS_DATA_DIR
=
"/var/lib/redis/
$REDIS_PORT
"
_REDIS_DATA_DIR
=
"/var/lib/redis/
$REDIS_PORT
"
read
-p
"Please select the data directory for this instance [
$_REDIS_DATA_DIR
] "
REDIS_DATA_DIR
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
...
@@ -52,9 +60,7 @@ if [ !"$REDIS_DATA_DIR" ] ; then
REDIS_DATA_DIR
=
$_REDIS_DATA_DIR
REDIS_DATA_DIR
=
$_REDIS_DATA_DIR
echo
"Selected default -
$REDIS_DATA_DIR
"
echo
"Selected default -
$REDIS_DATA_DIR
"
fi
fi
#try the data directory setting
mkdir
-p
$REDIS_DATA_DIR
||
die
"Could not create redis data directory"
mkdir
-p
`
dirname
"
$REDIS_DATA_DIR
"
`
||
die
"Could not create redis data directory"
#get the redis executable path
#get the redis executable path
_REDIS_EXECUTABLE
=
`
which redis-server
`
_REDIS_EXECUTABLE
=
`
which redis-server
`
...
@@ -104,7 +110,7 @@ CONF=\"$REDIS_CONFIG_FILE\"\n\n
...
@@ -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
"
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
#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
"
echo
"Copied
$TMP_FILE
=>
$INIT_SCRIPT_DEST
"
#Install the service
#Install the service
...
...
utils/redis.conf.tpl
View file @
001f8da2
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# 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.
# 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
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
# default. You can specify a custom pid file location here.
# default. You can specify a custom pid file location here.
...
@@ -317,7 +317,7 @@ auto-aof-rewrite-min-size 64mb
...
@@ -317,7 +317,7 @@ auto-aof-rewrite-min-size 64mb
# Max execution time of a Lua script in milliseconds.
# Max execution time of a Lua script in milliseconds.
# This prevents that a programming error generating an infinite loop will block
# 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.
# your server forever. Set it to 0 or a negative value for unlimited execution.
lua-time-limit 60000
#
lua-time-limit 60000
################################## SLOW LOG ###################################
################################## SLOW LOG ###################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment