SHA256
1
0
forked from pool/redis

- Updated to 2.4.1.

- Fixed init script.

OBS-URL: https://build.opensuse.org/package/show/server:database/redis?expand=0&rev=23
This commit is contained in:
Andreas Schneider 2011-10-24 10:48:58 +00:00 committed by Git OBS Bridge
parent a327cce110
commit 2ca538637f
3 changed files with 110 additions and 126 deletions

View File

@ -4,8 +4,8 @@
Index: redis.conf Index: redis.conf
=================================================================== ===================================================================
--- redis.conf.orig --- redis.conf.orig 2011-10-17 10:46:00.000000000 +0200
+++ redis.conf +++ redis.conf 2011-10-24 12:47:49.839930573 +0200
@@ -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.
@ -24,7 +24,7 @@ Index: redis.conf
# Specify the path for the unix socket that will be used to listen for # Specify the path for the unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen # incoming connections. There is no default, so Redis will not listen
@@ -44,12 +44,12 @@ timeout 300 @@ -45,12 +45,12 @@ timeout 300
# verbose (many rarely useful info, but not a mess like the debug level) # verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably) # notice (moderately verbose, what you want in production probably)
# warning (only very important / critical messages are logged) # warning (only very important / critical messages are logged)
@ -39,7 +39,7 @@ Index: redis.conf
# To enable logging to the system logger, just set 'syslog-enabled' to yes, # To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs. # and optionally update the other syslog parameters to suit your needs.
@@ -103,7 +103,7 @@ dbfilename dump.rdb @@ -104,7 +104,7 @@ dbfilename dump.rdb
# Also the Append Only File will be created inside this directory. # Also the Append Only File will be created inside this directory.
# #
# Note that you must specify a directory here, not a file name. # Note that you must specify a directory here, not a file name.

View File

@ -1,86 +1,56 @@
*** utils/redis_init_script.orig 2011-09-21 19:12:56.000000000 +0300 Index: utils/redis_init_script
--- utils/redis_init_script 2011-10-10 18:34:43.000000000 +0300 ===================================================================
*************** --- utils/redis_init_script.orig 2011-10-17 10:46:00.000000000 +0200
*** 1,42 **** +++ utils/redis_init_script 2011-10-24 12:47:43.108960720 +0200
@@ -1,42 +1,75 @@
#!/bin/sh #!/bin/sh
# #
! # Simple Redis init.d script conceived to work on Linux systems -# Simple Redis init.d script conceived to work on Linux systems
! # as it does use of the /proc filesystem. -# as it does use of the /proc filesystem.
+# /etc/init.d/redis
+#
+### BEGIN INIT INFO
+# Provides: redis
+# Required-Start: $syslog $remote_fs
+# Should-Start:
+# Required-Stop: $syslog $remote_fs
+# Should-Stop:
+# Default-Start: 3 4 5
+# Default-Stop: 0 1 2 6
+# Short-Description: Redis server
+# Description: Starts and stops the Redis daemon
+### END INIT INFO
+
+. /etc/rc.status
REDISPORT=6379 REDISPORT=6379
! EXEC=/usr/local/bin/redis-server -EXEC=/usr/local/bin/redis-server
! CLIEXEC=/usr/local/bin/redis-cli -CLIEXEC=/usr/local/bin/redis-cli
+EXEC=/usr/sbin/redis-server
+CLIEXEC=/usr/bin/redis-cli
PIDFILE=/var/run/redis_${REDISPORT}.pid -PIDFILE=/var/run/redis_${REDISPORT}.pid
! CONF="/etc/redis/${REDISPORT}.conf" -CONF="/etc/redis/${REDISPORT}.conf"
+CONF=/etc/redis.conf
+PIDFILE=/var/run/redis.pid
+LOGFILE=/var/log/redis/redis.log
case "$1" in case "$1" in
start) start)
! if [ -f $PIDFILE ] - if [ -f $PIDFILE ]
! then - then
! echo "$PIDFILE exists, process is already running or crashed" - echo "$PIDFILE exists, process is already running or crashed"
! else - else
! echo "Starting Redis server..." - echo "Starting Redis server..."
! $EXEC $CONF - $EXEC $CONF
fi + if [ ! -r $LOGFILE ]; then
;; + touch $LOGFILE
stop) + chown redis:redis $LOGFILE
if [ ! -f $PIDFILE ] + fi
then + # Create a pidfile the server can write into.
! echo "$PIDFILE does not exist, process is not running" + if [ ! -r $PIDFILE ]; then
else + touch $PIDFILE
! PID=$(cat $PIDFILE) + chown redis:redis $PIDFILE
! echo "Stopping ..."
$CLIEXEC -p $REDISPORT shutdown
! while [ -x /proc/${PID} ]
do
- echo "Waiting for Redis to shutdown ..."
sleep 1
done
- echo "Redis stopped"
fi
;;
! *)
! echo "Please use start or stop as first argument"
;;
esac
--- 1,75 ----
#!/bin/sh
#
! # /etc/init.d/redis
! #
! ### BEGIN INIT INFO
! # Provides: redis
! # Required-Start: $syslog $remote_fs
! # Should-Start:
! # Required-Stop: $syslog $remote_fs
! # Should-Stop:
! # Default-Start: 3 4 5
! # Default-Stop: 0 1 2 6
! # Short-Description: Redis server
! # Description: Starts and stops the Redis daemon
! ### END INIT INFO
!
! . /etc/rc.status
REDISPORT=6379
! EXEC=/usr/sbin/redis-server
! CLIEXEC=/usr/sbin/redis-cli
+ CONF=/etc/redis/${REDISPORT}.conf
PIDFILE=/var/run/redis_${REDISPORT}.pid
! LOGFILE=/var/log/redis_${REDISPORT}.log
case "$1" in
start)
! if [ ! -r $LOGFILE ]; then
! touch $LOGFILE
! chown redis:redis $LOGFILE
! fi
! # Create a pidfile the server can write into.
! if [ ! -r $PIDFILE ]; then
! touch $PIDFILE
! chown redis:redis $PIDFILE
fi fi
+ echo -n "Starting service Redis " + echo -n "Starting service Redis "
+ /sbin/startproc -u redis -g redis -p $PIDFILE -s -e $EXEC $CONF >/dev/null 2>&1 + /sbin/startproc -u redis -g redis -p $PIDFILE -s -e $EXEC $CONF >/dev/null 2>&1
@ -89,22 +59,30 @@
stop) stop)
if [ ! -f $PIDFILE ] if [ ! -f $PIDFILE ]
then then
! echo -n "$PIDFILE does not exist, process is not running" - echo "$PIDFILE does not exist, process is not running"
! rc_failed + echo -n "$PIDFILE does not exist, process is not running"
+ rc_failed
else else
! echo -n "Stopping service Redis..." - PID=$(cat $PIDFILE)
- echo "Stopping ..."
+ echo -n "Stopping service Redis..."
$CLIEXEC -p $REDISPORT shutdown $CLIEXEC -p $REDISPORT shutdown
! PID=$(cat $PIDFILE) - while [ -x /proc/${PID} ]
! while [ -x /proc/${PIDFILE} ] + PID=$(cat $PIDFILE)
+ while [ -x /proc/${PIDFILE} ]
do do
- echo "Waiting for Redis to shutdown ..."
sleep 1 sleep 1
done done
- echo "Redis stopped"
fi fi
+ rc_status -v + rc_status -v
;; ;;
! restart) - *)
! $0 stop - echo "Please use start or stop as first argument"
! $0 start + restart)
+ $0 stop
+ $0 start
;; ;;
+ reload) + reload)
+ $0 restart + $0 restart

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 24 10:48:19 UTC 2011 - asn@cryptomilk.org
- Updated to 2.4.1.
- Fixed init script.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue May 24 09:39:19 UTC 2011 - prusnak@opensuse.org Tue May 24 09:39:19 UTC 2011 - prusnak@opensuse.org