aports/main/valkey/valkey.conf.patch
Kevin Daudt a560ed2d95 main/valkey: move unixsocket to writable location
Valkey has no permissions to write its unixsocket to /run. Move the
socket to `/run/valkey/`.

Co-Authored-By: Jakub Jirutka <jakub@jirutka.cz>

Fixes 
2024-05-23 11:39:11 +00:00

89 lines
3.1 KiB
Diff

We force "daemonize no" in init script, so daemonize and pidfile does not
have any effect in valkey.conf. It's init/rc system's job to daemonize
programs and handle pidfiles, if it needs it!
Applications often communicate with Redis via unix socket, so it's
convenient to have it enabled by default. It must be in a subdirectory that
is automatically created by the init script because valkey user has no
permission to create files in /run.
--- a/valkey.conf
+++ b/valkey.conf
@@ -152,8 +152,8 @@
# incoming connections. There is no default, so the server will not listen
# on a unix socket when not specified.
#
-# unixsocket /run/valkey.sock
-# unixsocketperm 700
+unixsocket /run/valkey/valkey.sock
+unixsocketperm 770
# Close the connection after a client is idle for N seconds (0 to disable)
timeout 0
@@ -300,11 +300,6 @@
################################# GENERAL #####################################
-# By default the server does not run as a daemon. Use 'yes' if you need it.
-# Note that the server will write a pid file in /var/run/valkey.pid when daemonized.
-# When the server is supervised by upstart or systemd, this parameter has no impact.
-daemonize no
-
# If you run the server from upstart or systemd, the server can interact with your
# supervision tree. Options:
# supervised no - no supervision interaction
@@ -323,20 +318,6 @@
#
# supervised auto
-# If a pid file is specified, the server writes it where specified at startup
-# and removes it at exit.
-#
-# When the server runs non daemonized, no pid file is created if none is
-# specified in the configuration. When the server is daemonized, the pid file
-# is used even if not specified, defaulting to "/var/run/redis.pid".
-#
-# Creating a pid file is best effort: if the server is not able to create it
-# nothing bad happens, the server will start and run normally.
-#
-# Note that on modern Linux systems "/run/valkey.pid" is more conforming
-# and should be used instead.
-pidfile /var/run/valkey_6379.pid
-
# Specify the server verbosity level.
# This can be one of:
# debug (a lot of information, useful for development/testing)
@@ -349,14 +330,14 @@
# 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 /var/log/valkey.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.
-# syslog-enabled no
+syslog-enabled yes
# Specify the syslog identity.
-# syslog-ident redis
+syslog-ident valkey
# Specify the syslog facility. Must be USER or between LOCAL0-LOCAL7.
# syslog-facility local0
@@ -504,7 +485,7 @@
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
-dir ./
+dir /var/lib/valkey
################################# REPLICATION #################################
@@ -2282,3 +2263,6 @@
# to suppress
#
# ignore-warnings ARM64-COW-BUG
+
+# Include configuration fragments.
+include /etc/valkey/valkey.d/*.conf