forked from pool/redis
fix
OBS-URL: https://build.opensuse.org/package/show/server:database/redis?expand=0&rev=6
This commit is contained in:
committed by
Git OBS Bridge
parent
2f241e8390
commit
52aeaa5c1e
@@ -2,7 +2,7 @@ Index: utils/redis_init_script
|
||||
===================================================================
|
||||
--- utils/redis_init_script.orig
|
||||
+++ utils/redis_init_script
|
||||
@@ -1,7 +1,18 @@
|
||||
@@ -1,28 +1,39 @@
|
||||
#!/bin/sh
|
||||
+### BEGIN INIT INFO
|
||||
+# Provides: redis
|
||||
@@ -13,29 +13,56 @@ Index: utils/redis_init_script
|
||||
+# Default-Start: 3 5
|
||||
+# Default-Stop: 0 1 2 6
|
||||
+# Short-Description: Redis server
|
||||
+# Description: Starts the Redis server
|
||||
+# Description: Manages the Redis server
|
||||
+### END INIT INFO
|
||||
|
||||
REDISPORT=6379
|
||||
-EXEC=/usr/local/bin/redis-server
|
||||
+EXEC=/usr/sbin/redis-server
|
||||
|
||||
PIDFILE=/var/run/redis_${REDISPORT}.pid
|
||||
CONF="/etc/redis/${REDISPORT}.conf"
|
||||
@@ -22,7 +33,7 @@ case "$1" in
|
||||
echo -n "$PIDFILE does not exist, process is not running\n"
|
||||
-PIDFILE=/var/run/redis_${REDISPORT}.pid
|
||||
-CONF="/etc/redis/${REDISPORT}.conf"
|
||||
+PIDFILE=/var/run/redis.pid
|
||||
+CONF=/etc/redis.conf
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
if [ -f $PIDFILE ]
|
||||
then
|
||||
- echo -n "$PIDFILE exists, process is already running or crashed\n"
|
||||
+ echo "$PIDFILE exists, process is already running or crashed"
|
||||
else
|
||||
echo -n "Stopping ...\n"
|
||||
- echo -n "Starting Redis server...\n"
|
||||
+ echo "Starting Redis server..."
|
||||
$EXEC $CONF
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
if [ ! -f $PIDFILE ]
|
||||
then
|
||||
- echo -n "$PIDFILE does not exist, process is not running\n"
|
||||
+ echo "$PIDFILE does not exist, process is not running"
|
||||
else
|
||||
- echo -n "Stopping ...\n"
|
||||
- echo -n "SHUTDOWN\r\n" | nc localhost $REDISPORT &
|
||||
+ echo -n "SHUTDOWN\r\n" | netcat localhost $REDISPORT &
|
||||
+ echo "Stopping ..."
|
||||
+ echo -e "SHUTDOWN\r" | netcat localhost $REDISPORT &
|
||||
PID=$(cat $PIDFILE)
|
||||
while [ -x /proc/${PIDFILE} ]
|
||||
do
|
||||
@@ -33,4 +44,7 @@ case "$1" in
|
||||
@@ -33,4 +44,15 @@ case "$1" in
|
||||
echo "Redis stopped"
|
||||
fi
|
||||
;;
|
||||
+ *)
|
||||
+ echo "Usage: $0 [start|stop]"
|
||||
+ status)
|
||||
+ if [ ! -f $PIDFILE ]
|
||||
+ then
|
||||
+ echo "$PIDFILE does not exist, process is not running"
|
||||
+ else
|
||||
+ echo "$PIDFILE does exist, process is running"
|
||||
+ fi
|
||||
+ ;;
|
||||
+ *)
|
||||
+ echo "Usage: $0 [start|stop|status]"
|
||||
+ ;;
|
||||
esac
|
||||
|
Reference in New Issue
Block a user