mirror of
http://github.com/valkey-io/valkey
synced 2024-11-21 16:46:15 +00:00
df5db0627f
This includes comments used for module API documentation. * Strategy for replacement: Regex search: `(//|/\*| \*|#).* ("|\()?(r|R)edis( |\. |'|\n|,|-|\)|")(?!nor the names of its contributors)(?!Ltd.)(?!Labs)(?!Contributors.)` * Don't edit copyright comments * Replace "Redis version X.X" -> "Redis OSS version X.X" to distinguish from newly licensed repository * Replace "Redis Object" -> "Object" * Exclude markdown for now * Don't edit Lua scripting comments referring to redis.X API * Replace "Redis Protocol" -> "RESP" * Replace redis-benchmark, -cli, -server, -check-aof/rdb with "valkey-" prefix * Most other places, I use best judgement to either remove "Redis", or replace with "the server" or "server" Fixes #148 --------- Signed-off-by: Jacob Murphy <jkmurphy@google.com> Signed-off-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
51 lines
1.3 KiB
Bash
Executable File
51 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Simple server init.d script conceived to work on Linux systems
|
|
# as it does use of the /proc filesystem.
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: redis_6379
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Redis data structure server
|
|
# Description: Redis data structure server. See https://redis.io
|
|
### END INIT INFO
|
|
|
|
REDISPORT=6379
|
|
EXEC=/usr/local/bin/redis-server
|
|
CLIEXEC=/usr/local/bin/redis-cli
|
|
|
|
PIDFILE=/var/run/redis_${REDISPORT}.pid
|
|
CONF="/etc/redis/${REDISPORT}.conf"
|
|
|
|
case "$1" in
|
|
start)
|
|
if [ -f $PIDFILE ]
|
|
then
|
|
echo "$PIDFILE exists, process is already running or crashed"
|
|
else
|
|
echo "Starting Redis server..."
|
|
$EXEC $CONF
|
|
fi
|
|
;;
|
|
stop)
|
|
if [ ! -f $PIDFILE ]
|
|
then
|
|
echo "$PIDFILE does not exist, process is not running"
|
|
else
|
|
PID=$(cat $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
|