Files
ports/databases/valkey8/files/valkey.in
Muhammad Moinur Rahman 30dd85cf8e databases/valkey8: New port
Valkey is a high-performance data structure server that primarily
serves key/value workloads. It supports a wide range of native
structures and an extensible plugin system for adding new data
structures and access patterns.

WWW:	https://valkey.io/

Note that this is the 8.X.X version of valkey which has been added to
upgrade the valkey port to 9.X.X
2025-10-27 14:43:28 +01:00

68 lines
1.5 KiB
Bash

#!/bin/sh
# PROVIDE: valkey
# REQUIRE: LOGIN
# BEFORE: securelevel
# KEYWORD: shutdown
# Add the following line to /etc/rc.conf to enable `valkey':
#
#valkey_enable="YES"
#
# Define profiles here to run separate valkey instances:
#
#valkey_profiles="foo bar" # Script uses %%PREFIX%%/etc/valkey-NAME.conf respectively.
# For correct script working please update pidfile entries in
# valkey-NAME.conf files.
. /etc/rc.subr
name="valkey"
rcvar="${name}_enable"
extra_commands="reload"
command="%%PREFIX%%/bin/valkey-server"
pidfile="%%VALKEY_RUNDIR%%/$name.pid"
# read configuration and set defaults
load_rc_config "$name"
: ${valkey_enable="NO"}
: ${valkey_user="%%VALKEY_USER%%"}
: ${valkey_config="%%PREFIX%%/etc/$name.conf"}
command_args="${valkey_config}"
required_files="${valkey_config}"
_profile_exists() {
for _p in ${valkey_profiles}; do
[ "${_p}" = "$1" ] && return 1;
done
return 0
}
if [ $# -eq 2 ]; then
_profile=$2
_profile_exists $_profile
_exists=$?
[ ${_exists} -ne 1 ] && {
echo "`basename %%PREFIX%%/etc/rc.d/valkey`: no '$2' in 'valkey_profiles'"
exit 1
};
echo "-- Profile: ${_profile} --"
config_file="%%PREFIX%%/etc/${name}-${_profile}.conf"
command_args="${config_file}"
pidfile="%%VALKEY_RUNDIR%%/${_profile}.pid"
required_files="${config_file}"
elif [ -n "${valkey_profiles}" ]; then
_swap=$*; shift; _profiles=$*
_profiles=${_profiles:-${valkey_profiles}}
set -- ${_swap}
for _profile in ${_profiles}; do
%%PREFIX%%/etc/rc.d/valkey $1 ${_profile}
done
exit 0
fi
run_rc_command "$1"