aports/community/redis/redis-sentinel.initd
Jakub Jirutka c036781008 community/redis: move from main
Redis is not a free software (per OSI) anymore, it's being replaced with
its fork named Valkey.
2024-05-01 07:21:25 +00:00

34 lines
633 B
Bash

#!/sbin/openrc-run
name="Redis Sentinel"
: ${cfgfile:="/etc/sentinel.conf"}
: ${command_user:="redis:redis"}
: ${retry:=30}
command="/usr/bin/redis-sentinel"
command_args="$cfgfile --daemonize no $command_args"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"
required_files="$cfgfile"
depend() {
use net localmount logger
after keepalived firewall redis
}
start_pre() {
# Sets start-start-daemon's --chdir.
directory=$(config_get 'dir' '/var/lib/redis')
}
config_get() {
local key="$1"
local default="${2:-}"
local value=$(awk "\$1 == \"$key\" { print \$2 }" "$cfgfile")
printf '%s\n' "${value:-$default}"
}