Sync from SUSE:SLFO:Main valkey revision 2eb93986cc9aa8c0c1747063befccdcd

This commit is contained in:
Adrian Schröter 2024-12-20 16:25:24 +01:00
commit 954fa73f79
16 changed files with 658 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

90
README.SUSE Normal file
View File

@ -0,0 +1,90 @@
README.SUSE
-------------
Valkey Server
==============
1. cp -a /etc/valkey/default.conf.example /etc/valkey/instancename.conf
We use the "cp -a" here, so that our permissions are preserved.
In case you copied the file with out the "-a"
chown root:valkey /etc/valkey/instancename.conf
chmod u=rw,g=r,o= /etc/valkey/instancename.conf
2. change at least pidfile, logfile and dir setting
# the pid file *has* to match your config filename without the ".conf"
pidfile /run/valkey/instancename.pid
logfile /var/log/valkey/instancename.log
dir /var/lib/valkey/instancename/
If you want to run more than one instance you also have to change the
socket path and/or the ip:port combination.
e.g. /run/valkey/instancename.sock
Also make sure if you copy configurations from somewhere, that "daemonize"
should be set to "no".
3. create the database dir:
$ install -d -o valkey -g valkey -m 0750 /var/lib/valkey/instancename/
4. systemctl start valkey@instancename
5. systemctl enable valkey@instancename
6. To stop/restart all instances at the same time use:
systemctl restart valkey.target
systemctl stop valkey.target
Valkey Sentinel
================
1. cp -a /etc/valkey/sentinel.conf.example /etc/valkey/sentinel-instancename.conf
We use the "cp -a" here, so that our permissions are preserved.
In case you copied the file with out the "-a"
chown root:valkey /etc/valkey/sentinel-instancename.conf
chmod u=rw,g=rw,o= /etc/valkey/sentinel-instancename.conf
Please note that the sentinel config needs write permissions for the group.
The chmod line differs from the line for the normal valkey server.
2. change at least pidfile, logfile setting
# the pid file *has* to match your config filename without the ".conf"
pidfile /run/valkey/instancename.pid
logfile /var/log/valkey/instancename.log
If you want to run more than one instance you also have to change the
socket path and/or the ip:port combination.
e.g. /run/valkey/instancename.sock
Also make sure if you copy configurations from somewhere, that "daemonize"
should be set to "no".
4. systemctl start valkey-sentinel@instancename
5. systemctl enable valkey-sentinel@instancename
6. To stop/restart all instances at the same time use:
systemctl restart valkey-sentinel.target
systemctl stop valkey-sentinel.target
Integration with apache when using unix domain sockets
=========================================================
If you plan to use valkey in combination with apache, then you should
add 'valkey' to apache group and set 'unixsocketperm 770':
$ usermod -a -G valkey wwwrun
$ systemctl restart apache2
then apache is able to connect to valkey socket
Migrating from Redis
=======================
Migrating from Redis to Valkey is simple to execute. Just install "valkey-compat-redis" package.
The scriptlet should automatically take care of the necessary transitions.

2
macros.valkey Normal file
View File

@ -0,0 +1,2 @@
%valkey_modules_abi 1
%valkey_modules_dir %{_libdir}/valkey/modules

View File

@ -0,0 +1,45 @@
#!/bin/bash
# Identify whether any config files exist
configfiles=($(find /etc/redis -maxdepth 1 -name "*.conf"))
redisunits=($(find /etc/systemd/system/redis.target.wants -maxdepth 1 -name "redis@*.service" -execdir basename {} \;))
sentinelunits=($(find /etc/systemd/system/redis.target.wants -maxdepth 1 -name "redis-sentinel@*.service" -execdir basename {} \;))
if [ ${#configfiles[@]} -gt 0 ]; then
for configfile in ${configfiles[@]}
do
configfilename=$(basename "$configfile")
cp $configfile /etc/valkey/$configfilename
chown root:valkey /etc/valkey/$configfilename
if [[ $configfilename == sentinel-*.conf ]]; then
# Sentinel config files need to be writable by valkey group
chmod 660 /etc/valkey/$configfilename
fi
mv $configfile ${configfile}.bak
done
sed -e 's|^dir\s.*|dir /var/lib/valkey|g' -i /etc/valkey/*.conf
sed -e 's|^logfile\s/var/log/redis/|logfile /var/log/valkey/|g' -i /etc/valkey/*.conf
echo "/etc/redis/*.conf has been copied to /etc/valkey. Manual review of adjusted configs is strongly suggested."
fi
if test -x /usr/bin/systemctl; then
if [ ${#redisunits[@]} -gt 0 ]; then
for redisunit in ${redisunits[@]}
do
systemctl disable "${redisunit}"
systemctl enable "valkey@${redisunit##*@}"
done
fi
if [ ${#sentinelunits[@]} -gt 0 ]; then
for sentinelunit in ${sentinelunits[@]}
do
systemctl disable "${sentinelunit}"
systemctl enable "valkey-sentinel@${sentinelunit##*@}"
done
fi
fi
if [ -d /var/lib/redis ]; then
cp -r /var/lib/redis/* /var/lib/valkey/
chown -R valkey:valkey /var/lib/valkey
mv /var/lib/redis /var/lib/redis.bak
echo "On-disk redis dumps copied from /var/lib/redis/ to /var/lib/valkey"
fi

BIN
valkey-8.0.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

68
valkey-conf.patch Normal file
View File

@ -0,0 +1,68 @@
Index: b/sentinel.conf
===================================================================
--- a/sentinel.conf
+++ b/sentinel.conf
@@ -13,11 +13,12 @@ port 26379
# Note that Valkey will write a pid file in /var/run/valkey-sentinel.pid when
# daemonized.
daemonize no
+supervised systemd
# When running daemonized, Valkey Sentinel writes a pid file in
# /var/run/valkey-sentinel.pid by default. You can specify a custom pid file
# location here.
-pidfile /var/run/valkey-sentinel.pid
+pidfile /run/valkey/sentinel-default.pid
# Specify the server verbosity level.
# This can be one of:
@@ -31,7 +32,7 @@ loglevel notice
# Specify the log file name. Also the empty string can be used to force
# Sentinel to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile ""
+logfile /var/log/valkey/sentinel-default.log
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
Index: b/valkey.conf
===================================================================
--- a/valkey.conf
+++ b/valkey.conf
@@ -323,7 +323,7 @@ daemonize no
# The default is "no". To run under upstart/systemd, you can simply uncomment
# the line below:
#
-# supervised auto
+supervised systemd
# If a pid file is specified, the server writes it where specified at startup
# and removes it at exit.
@@ -337,7 +337,7 @@ daemonize no
#
# Note that on modern Linux systems "/run/valkey.pid" is more conforming
# and should be used instead.
-pidfile /var/run/valkey_6379.pid
+pidfile /run/valkey/default.pid
# Specify the server verbosity level.
# This can be one of:
@@ -351,7 +351,8 @@ loglevel notice
# Specify the log file name. Also the empty string can be used to force
# the server to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile ""
+# logfile ""
+logfile /var/log/valkey/default.log
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
@@ -526,7 +527,7 @@ rdb-del-sync-files no
# 'cluster-config-file' configuration directive is a relative path.
#
# Note that you must specify a directory here, not a file name.
-dir ./
+dir /var/lib/valkey/default/
################################# REPLICATION #################################

3
valkey-sentinel.target Normal file
View File

@ -0,0 +1,3 @@
[Unit]
Description=Valkey Sentinel target allowing to start/stop all valkey-sentinel@.service instances at once

31
valkey-sentinel@.service Normal file
View File

@ -0,0 +1,31 @@
[Unit]
Description=Valkey Sentinel instance: %i
After=network.target
PartOf=valkey-sentinel.target
[Service]
Type=notify
User=valkey
Group=valkey
PrivateTmp=true
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=true
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
ReadWritePaths=/etc/valkey
PIDFile=/run/valkey/sentinel-%i.pid
ExecStart=/usr/bin/valkey-sentinel /etc/valkey/sentinel-%i.conf
LimitNOFILE=10240
Restart=on-failure
[Install]
WantedBy=multi-user.target valkey.target

2
valkey-user.conf Normal file
View File

@ -0,0 +1,2 @@
# Type Name ID GECOS [HOME]
u valkey - "User for valkey key-value store" /var/lib/valkey

116
valkey.changes Normal file
View File

@ -0,0 +1,116 @@
-------------------------------------------------------------------
Wed Dec 11 22:08:32 UTC 2024 - Antonio Teixeira <antonio.teixeira@suse.com>
- Don't obsolete redis
-------------------------------------------------------------------
Wed Dec 4 20:05:34 UTC 2024 - Antonio Teixeira <antonio.teixeira@suse.com>
- Fix redis and sentinel units lookup in migration script (bsc#1226986)
* Look for units in /etc/systemd/system/redis.target.wants
- Fix sentinel config files permissions in migration script
-------------------------------------------------------------------
Tue Oct 22 09:03:52 UTC 2024 - Dirk Müller <dmueller@suse.com>
- fix requires for compat-redis package
-------------------------------------------------------------------
Fri Oct 4 12:43:51 UTC 2024 - Antonio Teixeira <antonio.teixeira@suse.com>
- Update to 8.0.1:
- Bug fixes
* Fix a build issue with RDMA when using additional make parameters. (#1074)
* Fix an issue where `CLUSTER SLOTS` might return the wrong tcp or tls port
when called from inside a script or from a module. (#1072)
* Fix a crash when `CLUSTER SLOTS` or `CLUSTER SHARDS` is called from inside
a script or from a module. (#1063)
* Fix a build issue on systems where `<threads.h>` is unavailable. (#1053)
* Fix an issue with the default `sentinel.conf` being invalid. (#1040)
- Security fixes
* (CVE-2024-31449, bsc#1231264) Lua library commands may lead to stack
overflow and potential RCE.
* (CVE-2024-31227, bsc#1231266) Potential Denial-of-service due to malformed
ACL selectors.
* (CVE-2024-31228, bsc#1231265) Potential Denial-of-service due to unbounded
pattern matching.
- 8.0.0 changelog:
* See https://github.com/valkey-io/valkey/blob/8.0.0/00-RELEASENOTES
- Drop ppc-atomic.patch
- Refresh valkey-conf.patch
-------------------------------------------------------------------
Tue Aug 27 18:04:07 UTC 2024 - Antonio Teixeira <antonio.teixeira@suse.com>
- Update to 7.2.6:
- Bug Fixes - Core
* Fix typo in REGISTER_API macro to prevent segfaults when loading Redis
modules (#608)
* Fix the command duration reset issue when clients are blocked and commands
are reprocessed (#526)
* Fix the data type conversion error in zrangeResultBeginStore (Redis#13148)
* Fix a crash caused by quicklist node merges (Redis#13040)
* Fix crashes in module blocking client timeout cases (Redis#13011)
* Fix conversion of numbers in Lua args to Redis args
(Redis#13115, Fixes Redis#13113)
* Fix crash in LSET command when replacing small list items with larger ones,
creating listpacks larger than 4GB (Redis#12955, Fixes Redis#12864)
* Fix blocking command timeout reset issue during reprocessing (Redis#13004)
- Bug Fixes - Cluster
* Fix the CLUSTER SHARDS command to display accurate slot information even
if a primary node fails (#790, Fixes #784)
* Fix an issue where module authentication failed when the cluster was down
(#693, Fixes #619)
* Ensure only primary nodes with slots can mark another node as failed (#634)
* Improve MEET command reliability under link failures to maintain cluster
membership symmetry (#461)
* Allow single primary node to mark potentially failed replica as FAIL in
single-shard cluster (Redis#12824)
- Bug Fixes - Sentinel
* Accept redis-sentinel to start Valkey in sentinel mode (#731, Fixes #719)
- Bug Fixes - CLI
* Ensure the --count option in redis-cli works correctly even without
--pattern (Redis#13092)
* Fix redis-check-aof misidentifying data in manifest format as MP-AOF
(Redis#12951)
* Update redis-check-rdb types to replace stream-v2 with stream-v3
(Redis#12969)
-------------------------------------------------------------------
Tue Jul 9 14:21:33 UTC 2024 - Antonio Teixeira <antonio.teixeira@suse.com>
- migrate_redis_to_valkey.bash fixes (boo#1227139)
* Also set group owner for /var/lib/valkey
* Change logdir option in copied conf files to /var/log/valkey
* Change owner of copied conf files to root:valkey
-------------------------------------------------------------------
Tue Jul 2 07:52:48 UTC 2024 - Andreas Schwab <schwab@suse.de>
- valkey.logrotate: fix owner of logfiles
-------------------------------------------------------------------
Sat Jun 29 17:32:13 UTC 2024 - Neal Gompa <ngompa@opensuse.org>
- Add legacy symlinks for "redis" executables in sbin to fix
running valkey in other package test suites using absolute paths
-------------------------------------------------------------------
Wed Jun 26 06:25:23 UTC 2024 - Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
- Repair Redis instance detection (boo#1226986)
-------------------------------------------------------------------
Sat Jun 22 08:42:19 UTC 2024 - Neal Gompa <ngompa@opensuse.org>
- Enable automatic replacement of redis with valkey
-------------------------------------------------------------------
Thu Jun 6 18:26:19 UTC 2024 - Neal Gompa <ngompa@opensuse.org>
- Initial package based on the redis package and Fedora valkey package
- Ported over patch from redis package
+ Added valkey-conf.patch
- Backport patch from upstream submission
+ Added ppc-atomic.patch

10
valkey.logrotate Normal file
View File

@ -0,0 +1,10 @@
/var/log/valkey/*.log {
weekly
rotate 10
copytruncate
delaycompress
compress
notifempty
missingok
su valkey valkey
}

218
valkey.spec Normal file
View File

@ -0,0 +1,218 @@
#
# spec file for package valkey
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) Jonathan Wright
# Copyright (c) Neal Gompa
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define _data_dir %{_localstatedir}/lib/%{name}
%define _log_dir %{_localstatedir}/log/%{name}
%define _conf_dir %{_sysconfdir}/%{name}
%global make_flags CFLAGS="%{build_cflags}" DEBUG="" V="echo" PREFIX=%{buildroot}%{_prefix} BUILD_WITH_SYSTEMD=yes BUILD_TLS=yes
Name: valkey
Version: 8.0.1
Release: 0
Summary: Persistent key-value database
License: BSD-3-Clause
URL: https://valkey.io
Source0: https://github.com/valkey-io/%{name}/archive/%{version}/%{name}-%{version}.tar.gz
Source1: %{name}.logrotate
Source2: %{name}.target
Source3: %{name}@.service
Source4: %{name}.tmpfiles.d
Source5: README.SUSE
Source6: %{name}.sysctl
Source7: %{name}-sentinel@.service
Source8: %{name}-sentinel.target
Source9: %{name}-user.conf
Source10: macros.%{name}
Source11: migrate_redis_to_valkey.bash
# PATCH-FIX-OPENSUSE -- Adjust configs for openSUSE
Patch1001: %{name}-conf.patch
BuildRequires: jemalloc-devel
BuildRequires: libopenssl-devel >= 1.1.1
BuildRequires: pkgconfig
BuildRequires: procps
BuildRequires: python3
BuildRequires: sysuser-shadow
BuildRequires: sysuser-tools
BuildRequires: tcl
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(systemd)
# there is no tcl-tls package yet, which is said to be needed for testing tls support
Recommends: logrotate
%{?sysusers_requires}
%global valkey_modules_abi 1
%global valkey_modules_dir %{_libdir}/%{name}/modules
Provides: valkey(modules_abi)%{?_isa} = %{valkey_modules_abi}
%description
Valkey is an advanced key-value store. It is similar to memcached but the dataset
is not volatile, and values can be strings, exactly like in memcached,
but also lists, sets, and ordered sets. All this data types can be manipulated
with atomic operations to push/pop elements, add/remove elements, perform server
side union, intersection, difference between sets, and so forth. It supports many
different kinds of sorting abilities.
%package devel
Summary: Development header for Valkey module development
%description devel
Header file required for building loadable Valkey modules.
%package compat-redis
Summary: Conversion script and compatibility symlinks for Redis
Requires: valkey = %{version}-%{release}
Conflicts: redis
Provides: redis = %{version}-%{release}
Requires(post): /usr/bin/find
BuildArch: noarch
%description compat-redis
This package contains compatibility symlinks and wrappers to enable
easy conversion from Redis to Valkey.
%prep
%autosetup -p1
# Module API version safety check
api=`sed -n -e 's/#define VALKEYMODULE_APIVER_[0-9][0-9]* //p' src/valkeymodule.h`
if test "$api" != "%{valkey_modules_abi}"; then
: Error: Upstream API version is now ${api}, expecting %%{valkey_modules_abi}.
: Update the valkey_modules_abi macro, the rpmmacros file, and rebuild.
exit 1
fi
%build
%make_build %{make_flags}
%sysusers_generate_pre %{SOURCE9} %{name}
%install
%make_install %{make_flags}
install -pm0750 -d \
%{buildroot}%{_log_dir} \
%{buildroot}%{_data_dir} \
%{buildroot}%{_conf_dir} \
%{buildroot}%{_log_dir}/default \
%{buildroot}%{_data_dir}/default
install -pDm644 src/%{name}module.h %{buildroot}%{_includedir}/%{name}module.h
install -Dpm0640 valkey.conf %{buildroot}%{_conf_dir}/default.conf.example
install -Dpm0660 sentinel.conf %{buildroot}%{_conf_dir}/sentinel.conf.example
# some sysctl stuff
install -Dpm0644 %{SOURCE6} %{buildroot}/%{_prefix}/lib/sysctl.d/00-%{name}.conf
%if 0%{?suse_version} > 1500
mkdir -p %{buildroot}%{_distconfdir}/logrotate.d
install -Dpm0644 %{SOURCE1} %{buildroot}%{_distconfdir}/logrotate.d/%{name}
%else
install -Dpm0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
%endif
install -Dpm0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.target
install -Dpm0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}@.service
install -Dpm0644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
install -Dpm0644 %{SOURCE7} %{buildroot}%{_unitdir}/%{name}-sentinel@.service
install -Dpm0644 %{SOURCE8} %{buildroot}%{_unitdir}/%{name}-sentinel.target
cp %{SOURCE5} README.SUSE
mkdir -p %{buildroot}%{_sysusersdir}
install -pm0644 %{SOURCE9} %{buildroot}%{_sysusersdir}/
mkdir -p %{buildroot}%{_rpmmacrodir}
install -pm0644 %{SOURCE10} %{buildroot}%{_rpmmacrodir}/
mkdir -p %{buildroot}%{_libdir}/%{name}/modules
# Install valkey migration script
mkdir -p %{buildroot}%{_libexecdir}
install -pm0755 %{SOURCE11} %{buildroot}%{_libexecdir}/
# Install legacy compatibility paths in sbin
mkdir -p %{buildroot}%{_sbindir}
for redisbin in %{buildroot}%{_bindir}/redis-*; do
ln -sr $redisbin %{buildroot}%{_sbindir}/$(basename $redisbin)
done
%check
cat <<EOF
---------------------------------------------------
The test suite often fails to start a server, with
'child process exited abnormally' -- sometimes it works.
---------------------------------------------------
EOF
# Variable assignments need to match in all make invocations, otherwise it might recomplie. See https://github.com/redis/redis/issues/7337
%make_build test %{make_flags} || true
%pre -f %{name}.pre
%service_add_pre %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service
%post
%tmpfiles_create %{_tmpfilesdir}/%{name}.conf
%service_add_post %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service
echo "See %{_docdir}/%{name}/README.SUSE to continue"
%preun
%service_del_preun %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service
%postun
%service_del_postun %{name}.target %{name}@.service %{name}-sentinel.target %{name}-sentinel@.service
%post compat-redis
%{_libexecdir}/migrate_redis_to_valkey.bash
%files
%license COPYING
%doc 00-RELEASENOTES README.md
%if 0%{?suse_version} > 1500
%{_distconfdir}/logrotate.d/%{name}
%else
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%endif
%{_prefix}/lib/sysctl.d/00-%{name}.conf
%{_bindir}/%{name}-*
%{_tmpfilesdir}/%{name}.conf
%{_sysusersdir}/%{name}-user.conf
%{_unitdir}/%{name}@.service
%{_unitdir}/%{name}.target
%{_unitdir}/%{name}-sentinel@.service
%{_unitdir}/%{name}-sentinel.target
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/modules
%doc README.SUSE
%config(noreplace) %attr(-,root,%{name}) %{_conf_dir}/
%dir %attr(0750,%{name},%{name}) %{_data_dir}
%dir %attr(0750,%{name},%{name}) %{_data_dir}/default
%dir %attr(0750,%{name},%{name}) %{_log_dir}
%ghost %dir %attr(0755,%{name},%{name}) /run/%{name}
%files devel
# main package is not required
%license COPYING
%{_includedir}/%{name}module.h
%{_rpmmacrodir}/macros.%{name}
%files compat-redis
%{_libexecdir}/migrate_redis_to_valkey.bash
%{_bindir}/redis-*
%{_sbindir}/redis-*
%changelog

12
valkey.sysctl Normal file
View File

@ -0,0 +1,12 @@
### remove valkey Warnings about
# WARNING: The TCP backlog setting of 511 cannot be enforced because
# /proc/sys/net/core/somaxconn is set to the lower value of 128.
net.core.somaxconn=512
# WARNING overcommit_memory is set to 0! Background save may fail
# under low memory condition. To fix this issue add
# 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or
# run the command 'sysctl -w vm.overcommit_memory=1' for this to take
# effect.
vm.overcommit_memory=1

3
valkey.target Normal file
View File

@ -0,0 +1,3 @@
[Unit]
Description=Valkey target allowing to start/stop all valkey@.service instances at once

2
valkey.tmpfiles.d Normal file
View File

@ -0,0 +1,2 @@
# Type Path Mode UID GID Age Argument
d /run/valkey 0755 valkey valkey - -

30
valkey@.service Normal file
View File

@ -0,0 +1,30 @@
[Unit]
Description=Valkey instance: %i
After=network.target
PartOf=valkey.target
[Service]
Type=notify
User=valkey
Group=valkey
PrivateTmp=true
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
ProtectSystem=full
ProtectHome=true
PrivateDevices=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
RestrictRealtime=true
# end of automatic additions
PIDFile=/run/valkey/%i.pid
ExecStart=/usr/bin/valkey-server /etc/valkey/%i.conf
LimitNOFILE=10240
Restart=on-failure
[Install]
WantedBy=multi-user.target valkey.target