mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-29 02:11:16 +02:00
43 lines
899 B
Plaintext
43 lines
899 B
Plaintext
#!/sbin/runscript
|
|
|
|
REDIS_EXEC=/usr/bin/redis-server
|
|
REDIS_PID=${REDIS_PID:-/var/run/redis.pid}
|
|
REDIS_DIR=${REDIS_DIR:-/var/lib/redis}
|
|
REDIS_CONF=${REDIS_CONF:-/etc/redis.conf}
|
|
REDIS_OPTS=${REDIS_OPTS:-"${REDIS_CONF}"}
|
|
REDIS_USER=${REDIS_USER:-redis}
|
|
REDIS_GROUP=${REDIS_GROUP:-redis}
|
|
REDIS_PORT=${REDIS_PORT:-6379}
|
|
REDIS_CLIEXEC=/usr/bin/redis-cli
|
|
|
|
depend() {
|
|
use net localmount logger
|
|
after keepalived firewall
|
|
}
|
|
|
|
start() {
|
|
|
|
local PID_DIR=$(dirname ${REDIS_PID})
|
|
checkpath -d -o ${REDIS_USER}:${REDIS_GROUP} ${PID_DIR}
|
|
|
|
ebegin "Starting Redis server"
|
|
start-stop-daemon --start \
|
|
--chdir "${REDIS_DIR}" \
|
|
--user ${REDIS_USER}:${REDIS_GROUP} \
|
|
--pidfile "${REDIS_PID}" \
|
|
--exec "${REDIS_EXEC}" \
|
|
-- ${REDIS_OPTS}
|
|
ret=$?
|
|
eend ${ret}
|
|
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping Redis server"
|
|
start-stop-daemon --stop --quiet --pidfile "${REDIS_PID}"
|
|
ret=$?
|
|
rm -f "${REDIS_PID}"
|
|
eend ${ret}
|
|
}
|
|
|