mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-09-30 03:05:18 +00:00
Changelog: ============ * (CVE-2023-45145) The wrong order of listen(2) and chmod(2) calls creates a race condition that can be used by another process to bypass desired Unix socket permissions on startup. * Fix compilation error on MacOS 13 (#12611) * WAITAOF could timeout in the absence of write traffic in case a new AOF is created and an AOF rewrite can't immediately start (#12620) * Fix crash when running rebalance command in a mixed cluster of 7.0 and 7.2 nodes (#12604) * Fix the return type of the slot number in cluster shards to integer, which makes it consistent with past behavior (#12561) * Fix CLUSTER commands are called from modules or scripts to return TLS info appropriately (#12569) * redis-cli, fix crash on reconnect when in SUBSCRIBE mode (#12571) * Fix overflow calculation for next timer event (#12474) Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit 8c749f1cd42ae250b059db5174933f4ed736b758) Signed-off-by: Armin Kuster <akuster808@gmail.com>
72 lines
2.4 KiB
Bash
Executable File
72 lines
2.4 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
### BEGIN INIT INFO
|
|
# Provides: redis-server
|
|
# Required-Start: $network
|
|
# Required-Stop: $network
|
|
# Default-Start: S 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Redis, a key-value store
|
|
# Description: Redis is an open source, advanced key-value store.
|
|
# http://redis.io
|
|
### END INIT INFO
|
|
|
|
test -f /usr/bin/redis-server || exit 0
|
|
|
|
ARGS="/etc/redis/redis.conf"
|
|
|
|
case "$1" in
|
|
start)
|
|
echo "Starting redis-server..."
|
|
start-stop-daemon --start --quiet --exec /usr/bin/redis-server -- $ARGS
|
|
;;
|
|
stop)
|
|
echo "Stopping redis-server..."
|
|
start-stop-daemon --stop --quiet --exec /usr/bin/redis-server
|
|
;;
|
|
restart)
|
|
echo "Stopping redis-server..."
|
|
start-stop-daemon --stop --quiet --exec /usr/bin/redis-server
|
|
|
|
# Since busybox implementation ignores --retry arguments repeatedly check
|
|
# if the process is still running and try another signal after a timeout,
|
|
# efectively simulating a stop with --retry=TERM/5/KILL/5 schedule.
|
|
waitAfterTerm=5000000 # us / 5000 ms / 5 s
|
|
waitAfterKill=5000000 # us / 5000 ms / 5 s
|
|
waitStep=100000 # us / 100 ms / 0.1 s
|
|
waited=0
|
|
start-stop-daemon --stop --test --quiet --exec /usr/bin/redis-server
|
|
processOff=$?
|
|
while [ $processOff -eq 0 ] && [ $waited -le $waitAfterTerm ] ; do
|
|
usleep ${waitStep}
|
|
((waited+=${waitStep}))
|
|
start-stop-daemon --stop --test --quiet --exec /usr/bin/redis-server
|
|
processOff=$?
|
|
done
|
|
if [ $processOff -eq 0 ] ; then
|
|
start-stop-daemon --stop --signal KILL --exec /usr/bin/redis-server
|
|
start-stop-daemon --stop --test --quiet --exec /usr/bin/redis-server
|
|
processOff=$?
|
|
fi
|
|
waited=0
|
|
while [ $processOff -eq 0 ] && [ $waited -le $waitAfterKill ] ; do
|
|
usleep ${waitStep}
|
|
((waited+=${waitStep}))
|
|
start-stop-daemon --stop --test --quiet --exec /usr/bin/redis-server
|
|
processOff=$?
|
|
done
|
|
# Here $processOff will indicate if waiting and retrying according to
|
|
# the schedule ended in a successfull stop or not.
|
|
|
|
echo "Starting redis-server..."
|
|
start-stop-daemon --start --quiet --exec /usr/bin/redis-server -- $ARGS
|
|
;;
|
|
*)
|
|
echo "Usage: /etc/init.d/redis-server {start|stop|restart}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|
|
|