diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-04-23 23:59:27 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-04-23 23:59:27 +0100 |
commit | e3f21c8aff8a76afe3423721c437a088e9232840 (patch) | |
tree | fde2c1906a9787adec106c5d6b708cd60de02c60 /dev-db/redict/files | |
parent | 1f00990debeffd0052c194989d0a02baac23eb96 (diff) |
gentoo auto-resync : 23:04:2024 - 23:59:26
Diffstat (limited to 'dev-db/redict/files')
-rw-r--r-- | dev-db/redict/files/redict-7.3.0-config.patch | 40 | ||||
-rw-r--r-- | dev-db/redict/files/redict-7.3.0-system-hiredict.patch | 240 | ||||
-rw-r--r-- | dev-db/redict/files/redict-7.3.0-system-jemalloc.patch | 173 | ||||
-rw-r--r-- | dev-db/redict/files/redict-sentinel-7.3.0-config.patch | 27 | ||||
-rw-r--r-- | dev-db/redict/files/redict-sentinel.confd | 16 | ||||
-rw-r--r-- | dev-db/redict/files/redict-sentinel.initd | 22 | ||||
-rw-r--r-- | dev-db/redict/files/redict.confd | 20 | ||||
-rw-r--r-- | dev-db/redict/files/redict.initd | 25 | ||||
-rw-r--r-- | dev-db/redict/files/redict.logrotate | 6 | ||||
-rw-r--r-- | dev-db/redict/files/redict.service | 14 | ||||
-rw-r--r-- | dev-db/redict/files/redict.tmpfiles | 2 |
11 files changed, 585 insertions, 0 deletions
diff --git a/dev-db/redict/files/redict-7.3.0-config.patch b/dev-db/redict/files/redict-7.3.0-config.patch new file mode 100644 index 000000000000..aab0df2e1a45 --- /dev/null +++ b/dev-db/redict/files/redict-7.3.0-config.patch @@ -0,0 +1,40 @@ +diff --git a/redict.conf b/redict.conf +index 465d56f..ef56037 100644 +--- a/redict.conf ++++ b/redict.conf +@@ -276,7 +276,7 @@ daemonize no + # + # Note that on modern Linux systems "/run/redict.pid" is more conforming + # and should be used instead. +-pidfile /var/run/redict_6379.pid ++pidfile /run/redict/redict.pid + + # Specify the server verbosity level. + # This can be one of: +@@ -289,7 +289,7 @@ loglevel notice + # Specify the log file name. Also the empty string can be used to force + # redict 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/redict/redict.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. +@@ -441,7 +441,7 @@ rdb-del-sync-files no + # 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/redict/ + + ################################# REPLICATION ################################# + +@@ -967,7 +967,7 @@ acllog-max-len 128 + # limit for maxmemory so that there is some free RAM on the system for replica + # output buffers (but this is not needed if the policy is 'noeviction'). + # +-# maxmemory <bytes> ++maxmemory 64MB + + # MAXMEMORY POLICY: how redict will select what to remove when maxmemory + # is reached. You can select one from the following behaviors: diff --git a/dev-db/redict/files/redict-7.3.0-system-hiredict.patch b/dev-db/redict/files/redict-7.3.0-system-hiredict.patch new file mode 100644 index 000000000000..53b9d93087d4 --- /dev/null +++ b/dev-db/redict/files/redict-7.3.0-system-hiredict.patch @@ -0,0 +1,240 @@ +# Patch from https://codeberg.org/redict/redict/pulls/44 +# and https://salsa.debian.org/redict-team/redict/-/blob/1d2b9f08f3dcc7ba4f03ddd9066545d0fd6b716e/debian/patches/0005-Fix-hiredict-imports.patch +# The first patch got upstreamed, the second will be soon + +From ffb9f03106de48a2a09d60f691a8852a0cf917ad Mon Sep 17 00:00:00 2001 +From: Maytham Alsudany <maytha8thedev@gmail.com> +Date: Sun, 14 Apr 2024 11:52:21 +0300 +Subject: [PATCH 1/2] Add ability to use system hiredict + +Co-authored-by: Chris Lamb <lamby@debian.org> +Signed-off-by: Maytham Alsudany <maytha8thedev@gmail.com> +--- + deps/Makefile | 2 ++ + src/Makefile | 27 ++++++++++++++++++++++----- + 2 files changed, 24 insertions(+), 5 deletions(-) + +diff --git a/deps/Makefile b/deps/Makefile +index 345e1f703..e071cfa03 100644 +--- a/deps/Makefile ++++ b/deps/Makefile +@@ -36,7 +36,9 @@ ifneq ($(shell sh -c '[ -f .make-ldflags ] && cat .make-ldflags || echo none'), + endif + + distclean: ++ifneq ($(USE_SYSTEM_HIREDICT),yes) + -(cd hiredict && $(MAKE) clean) > /dev/null || true ++endif + -(cd linenoise && $(MAKE) clean) > /dev/null || true + -(cd lua && $(MAKE) clean) > /dev/null || true + ifneq ($(USE_SYSTEM_JEMALLOC),yes) +diff --git a/src/Makefile b/src/Makefile +index fbcc20f02..8ca30a6df 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -24,7 +24,7 @@ endif + ifneq ($(OPTIMIZATION),-O0) + OPTIMIZATION+=-fno-omit-frame-pointer + endif +-DEPENDENCY_TARGETS=hiredict linenoise lua hdr_histogram fpconv ++DEPENDENCY_TARGETS=linenoise lua hdr_histogram fpconv + NODEPS:=clean distclean + + # Default settings +@@ -226,7 +226,7 @@ ifdef OPENSSL_PREFIX + endif + + # Include paths to dependencies +-FINAL_CFLAGS+= -I../deps/hiredict -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/fpconv ++FINAL_CFLAGS+= -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/fpconv + + # Determine systemd support and/or build preference (defaulting to auto-detection) + BUILD_WITH_SYSTEMD=no +@@ -277,6 +277,15 @@ else + endif + endif + ++ifeq ($(USE_SYSTEM_HIREDICT),yes) ++ FINAL_LIBS+= $(shell $(PKG_CONFIG) --libs hiredict) ++ FINAL_CFLAGS+= $(shell $(PKG_CONFIG) --cflags hiredict) ++else ++ DEPENDENCY_TARGETS += hiredict ++ FINAL_LIBS+= ../deps/hiredict/libhiredict.a ++ FINAL_CFLAGS+= -I../deps/hiredict ++endif ++ + # LIBSSL & LIBCRYPTO + LIBSSL_LIBS= + LIBSSL_PKGCONFIG := $(shell $(PKG_CONFIG) --exists libssl && echo $$?) +@@ -299,15 +308,23 @@ BUILD_MODULE:=2 + ifeq ($(BUILD_TLS),yes) + FINAL_CFLAGS+=-DUSE_OPENSSL=$(BUILD_YES) $(OPENSSL_CFLAGS) -DBUILD_TLS_MODULE=$(BUILD_NO) + FINAL_LDFLAGS+=$(OPENSSL_LDFLAGS) ++ifeq ($(USE_SYSTEM_HIREDICT),yes) ++ FINAL_LIBS += $(shell $(PKG_CONFIG) --libs hiredict_ssl) $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS) ++else + FINAL_LIBS += ../deps/hiredict/libhiredict_ssl.a $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS) + endif ++endif + + TLS_MODULE= + TLS_MODULE_NAME:=redict-tls$(PROG_SUFFIX).so + TLS_MODULE_CFLAGS:=$(FINAL_CFLAGS) + ifeq ($(BUILD_TLS),module) + FINAL_CFLAGS+=-DUSE_OPENSSL=$(BUILD_MODULE) $(OPENSSL_CFLAGS) ++ifeq ($(USE_SYSTEM_HIREDICT),yes) ++ TLS_CLIENT_LIBS = $(shell $(PKG_CONFIG) --libs hiredict_ssl) $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS) ++else + TLS_CLIENT_LIBS = ../deps/hiredict/libhiredict_ssl.a $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS) ++endif + TLS_MODULE=$(TLS_MODULE_NAME) + TLS_MODULE_CFLAGS+=-DUSE_OPENSSL=$(BUILD_MODULE) $(OPENSSL_CFLAGS) -DBUILD_TLS_MODULE=$(BUILD_MODULE) + endif +@@ -406,7 +423,7 @@ endif + + # redict-server + $(REDICT_SERVER_NAME): $(REDICT_SERVER_OBJ) +- $(REDICT_LD) -o $@ $^ ../deps/hiredict/libhiredict.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS) ++ $(REDICT_LD) -o $@ $^ ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS) + + # redict-sentinel + $(REDICT_SENTINEL_NAME): $(REDICT_SERVER_NAME) +@@ -426,11 +443,11 @@ $(TLS_MODULE_NAME): $(REDICT_SERVER_NAME) + + # redict-cli + $(REDICT_CLI_NAME): $(REDICT_CLI_OBJ) +- $(REDICT_LD) -o $@ $^ ../deps/hiredict/libhiredict.a ../deps/linenoise/linenoise.o $(FINAL_LIBS) $(TLS_CLIENT_LIBS) ++ $(REDICT_LD) -o $@ $^ ../deps/linenoise/linenoise.o $(FINAL_LIBS) $(TLS_CLIENT_LIBS) + + # redict-benchmark + $(REDICT_BENCHMARK_NAME): $(REDICT_BENCHMARK_OBJ) +- $(REDICT_LD) -o $@ $^ ../deps/hiredict/libhiredict.a ../deps/hdr_histogram/libhdrhistogram.a $(FINAL_LIBS) $(TLS_CLIENT_LIBS) ++ $(REDICT_LD) -o $@ $^ ../deps/hdr_histogram/libhdrhistogram.a $(FINAL_LIBS) $(TLS_CLIENT_LIBS) + + DEP = $(REDICT_SERVER_OBJ:%.o=%.d) $(REDICT_CLI_OBJ:%.o=%.d) $(REDICT_BENCHMARK_OBJ:%.o=%.d) + -include $(DEP) +-- +2.39.2 + + +From bd55c900ac123db05b7243f6e958e311a622fb7d Mon Sep 17 00:00:00 2001 +From: Maytham Alsudany <maytha8thedev@gmail.com> +Date: Sun, 14 Apr 2024 11:53:13 +0300 +Subject: [PATCH 2/2] Mention USE_SYSTEM_HIREDICT setting in README + +Signed-off-by: Maytham Alsudany <maytha8thedev@gmail.com> +--- + README.md | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/README.md b/README.md +index ae77a235a..cf4944e6f 100644 +--- a/README.md ++++ b/README.md +@@ -25,6 +25,8 @@ You can pass the following variables to Redict to customize the build: + * `USE_JEMALLOC=no MALLOC=libc`: use the libc allocator rather than jemalloc + * `USE_SYSTEM_JEMALLOC=yes`: use the system's installed jemalloc libraries + rather than the vendored copy. ++* `USE_SYSTEM_HIREDICT=yes`: use the system's installed hiredict libraries ++ rather than the vendored copy. + * `BUILD_TLS=yes`: build with TLS support. Requires OpenSSL. + * `USE_SYSTEMD=yes`: build with systemd support. Requires libsystemd. + * `PROG_SUFFIX="-suffix"`: Append "-suffix" to executable names +-- +2.39.2 + +From: Maytham Alsudany <maytha8thedev@gmail.com> +Subject: Fix hiredict imports +Forwarded: no + +--- a/src/cli_common.c ++++ b/src/cli_common.c +@@ -13,15 +13,15 @@ + #include <stdlib.h> + #include <fcntl.h> + #include <errno.h> +-#include <hiredict.h> +-#include <sds.h> ++#include <hiredict/hiredict.h> ++#include <hiredict/sds.h> + #include <unistd.h> + #include <string.h> + #include <ctype.h> + #ifdef USE_OPENSSL + #include <openssl/ssl.h> + #include <openssl/err.h> +-#include <hiredict_ssl.h> ++#include <hiredict/hiredict_ssl.h> + #endif + + #define UNUSED(V) ((void) V) +--- a/src/cli_common.h ++++ b/src/cli_common.h +@@ -7,8 +7,8 @@ + #ifndef __CLICOMMON_H + #define __CLICOMMON_H + +-#include <hiredict.h> +-#include <sds.h> ++#include <hiredict/hiredict.h> ++#include <hiredict/sds.h> + + typedef struct cliSSLconfig { + /* Requested SNI, or NULL */ +--- a/src/redict-benchmark.c ++++ b/src/redict-benchmark.c +@@ -19,13 +19,13 @@ + #include <math.h> + #include <pthread.h> + +-#include <sds.h> ++#include <hiredict/sds.h> + #include "ae.h" +-#include <hiredict.h> ++#include <hiredict/hiredict.h> + #ifdef USE_OPENSSL + #include <openssl/ssl.h> + #include <openssl/err.h> +-#include <hiredict_ssl.h> ++#include <hiredict/hiredict_ssl.h> + #endif + #include "adlist.h" + #include "dict.h" +--- a/src/redict-cli.c ++++ b/src/redict-cli.c +@@ -23,13 +23,13 @@ + #include <math.h> + #include <termios.h> + +-#include <hiredict.h> ++#include <hiredict/hiredict.h> + #ifdef USE_OPENSSL + #include <openssl/ssl.h> + #include <openssl/err.h> +-#include <hiredict_ssl.h> ++#include <hiredict/hiredict_ssl.h> + #endif +-#include <sds.h> ++#include <hiredict/sds.h> + #include "dict.h" + #include "adlist.h" + #include "zmalloc.h" +--- a/src/sentinel.c ++++ b/src/sentinel.c +@@ -6,12 +6,12 @@ + // SPDX-License-Identifier: LGPL-3.0-only + + #include "server.h" +-#include "hiredict.h" ++#include "hiredict/hiredict.h" + #if USE_OPENSSL == 1 /* BUILD_YES */ + #include "openssl/ssl.h" +-#include "hiredict_ssl.h" ++#include "hiredict/hiredict_ssl.h" + #endif +-#include "async.h" ++#include "hiredict/async.h" + + #include <ctype.h> + #include <arpa/inet.h> + diff --git a/dev-db/redict/files/redict-7.3.0-system-jemalloc.patch b/dev-db/redict/files/redict-7.3.0-system-jemalloc.patch new file mode 100644 index 000000000000..802b573dee83 --- /dev/null +++ b/dev-db/redict/files/redict-7.3.0-system-jemalloc.patch @@ -0,0 +1,173 @@ +# Patch comes from https://codeberg.org/redict/redict/pulls/40 +# https://codeberg.org/redict/redict/pulls/42 +# and https://codeberg.org/redict/redict/pulls/43 +# All got merged upstream and should be removed next release. + +From 5defea5b98859f4e1162b82120114e222b2a7465 Mon Sep 17 00:00:00 2001 +From: Maytham Alsudany <maytha8thedev@gmail.com> +Date: Wed, 10 Apr 2024 01:10:49 +0300 +Subject: [PATCH 1/2] Add ability to use system jemalloc + +This time, this shouldn't cause CI tests to fail. + +Co-authored-by: Chris Lamb <lamby@debian.org> +Signed-off-by: Maytham Alsudany <maytha8thedev@gmail.com> +--- + deps/Makefile | 2 ++ + src/Makefile | 8 +++++++- + src/debug.c | 3 +++ + src/object.c | 5 +++++ + src/sds.c | 4 ++++ + src/zmalloc.c | 4 ++++ + src/zmalloc.h | 4 ++++ + 7 files changed, 29 insertions(+), 1 deletion(-) + +diff --git a/deps/Makefile b/deps/Makefile +index 9a273aefc..345e1f703 100644 +--- a/deps/Makefile ++++ b/deps/Makefile +@@ -39,7 +39,9 @@ distclean: + -(cd hiredict && $(MAKE) clean) > /dev/null || true + -(cd linenoise && $(MAKE) clean) > /dev/null || true + -(cd lua && $(MAKE) clean) > /dev/null || true ++ifneq ($(USE_SYSTEM_JEMALLOC),yes) + -(cd jemalloc && [ -f Makefile ] && $(MAKE) distclean) > /dev/null || true ++endif + -(cd hdr_histogram && $(MAKE) clean) > /dev/null || true + -(cd fpconv && $(MAKE) clean) > /dev/null || true + -(rm -f .make-*) +diff --git a/src/Makefile b/src/Makefile +index 0739466b6..d399c6eb2 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -266,10 +266,16 @@ ifeq ($(MALLOC),tcmalloc_minimal) + endif + + ifeq ($(MALLOC),jemalloc) ++ FINAL_CFLAGS+= -DUSE_JEMALLOC ++ifeq ($(USE_SYSTEM_JEMALLOC),yes) ++ FINAL_CFLAGS+= -DUSE_SYSTEM_JEMALLOC $(shell $(PKG_CONFIG) --cflags jemalloc) ++ FINAL_LIBS := $(shell $(PKG_CONFIG) --libs jemalloc) $(FINAL_LIBS) ++else + DEPENDENCY_TARGETS+= jemalloc +- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include ++ FINAL_CFLAGS+= -I../deps/jemalloc/include + FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS) + endif ++endif + + # LIBSSL & LIBCRYPTO + LIBSSL_LIBS= +diff --git a/src/debug.c b/src/debug.c +index 89d33bfd7..2257d655e 100644 +--- a/src/debug.c ++++ b/src/debug.c +@@ -56,6 +56,9 @@ void bugReportEnd(int killViaSignal, int sig); + void logStackTrace(void *eip, int uplevel, int current_thread); + void sigalrmSignalHandler(int sig, siginfo_t *info, void *secret); + ++#if defined(USE_JEMALLOC) && defined(USE_SYSTEM_JEMALLOC) ++#define je_mallctl mallctl ++#endif + /* ================================= Debugging ============================== */ + + /* Compute the sha1 of string at 's' with 'len' bytes long. +diff --git a/src/object.c b/src/object.c +index cf7811e81..5da8fbcc9 100644 +--- a/src/object.c ++++ b/src/object.c +@@ -15,6 +15,11 @@ + #define strtold(a,b) ((long double)strtod((a),(b))) + #endif + ++#if defined(USE_JEMALLOC) && defined(USE_SYSTEM_JEMALLOC) ++#define je_mallctl mallctl ++#define je_malloc_stats_print malloc_stats_print ++#endif ++ + /* ===================== Creation and parsing of objects ==================== */ + + robj *createObject(int type, void *ptr) { +diff --git a/src/sds.c b/src/sds.c +index 0a295132c..a1ac73d5a 100644 +--- a/src/sds.c ++++ b/src/sds.c +@@ -24,6 +24,10 @@ + #include "sds.h" + #include "sdsalloc.h" + ++#if defined(USE_JEMALLOC) && defined(USE_SYSTEM_JEMALLOC) ++#define je_nallocx nallocx ++#endif ++ + const char *SDS_NOINIT = "SDS_NOINIT"; + + static inline int sdsHdrSize(char type) { +diff --git a/src/zmalloc.c b/src/zmalloc.c +index d737e2b14..7187599aa 100644 +--- a/src/zmalloc.c ++++ b/src/zmalloc.c +@@ -56,6 +56,9 @@ void zlibc_free(void *ptr) { + #define free(ptr) tc_free(ptr) + /* Explicitly override malloc/free etc when using jemalloc. */ + #elif defined(USE_JEMALLOC) ++#if defined(USE_SYSTEM_JEMALLOC) ++#define je_mallctl mallctl ++#else + #define malloc(size) je_malloc(size) + #define calloc(count,size) je_calloc(count,size) + #define realloc(ptr,size) je_realloc(ptr,size) +@@ -63,6 +66,7 @@ void zlibc_free(void *ptr) { + #define mallocx(size,flags) je_mallocx(size,flags) + #define dallocx(ptr,flags) je_dallocx(ptr,flags) + #endif ++#endif + + #define update_zmalloc_stat_alloc(__n) atomicIncr(used_memory,(__n)) + #define update_zmalloc_stat_free(__n) atomicDecr(used_memory,(__n)) +diff --git a/src/zmalloc.h b/src/zmalloc.h +index df7d290da..c10858439 100644 +--- a/src/zmalloc.h ++++ b/src/zmalloc.h +@@ -27,7 +27,11 @@ + #include <jemalloc/jemalloc.h> + #if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2) + #define HAVE_MALLOC_SIZE 1 ++#if defined(USE_SYSTEM_JEMALLOC) ++#define zmalloc_size(p) malloc_usable_size(p) ++#else + #define zmalloc_size(p) je_malloc_usable_size(p) ++#endif + #else + #error "Newer version of jemalloc required" + #endif +-- +2.39.2 + + +From 940b0fab0318f5f306a67d0818635acc522402c4 Mon Sep 17 00:00:00 2001 +From: Maytham Alsudany <maytha8thedev@gmail.com> +Date: Wed, 10 Apr 2024 01:11:24 +0300 +Subject: [PATCH 2/2] Mention USE_SYSTEM_JEMALLOC setting in README + +Signed-off-by: Maytham Alsudany <maytha8thedev@gmail.com> +--- + README.md | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/README.md b/README.md +index 14caf183d..ae77a235a 100644 +--- a/README.md ++++ b/README.md +@@ -23,6 +23,8 @@ toolchain, and GNU make. To build Redict, simply run "make". + You can pass the following variables to Redict to customize the build: + + * `USE_JEMALLOC=no MALLOC=libc`: use the libc allocator rather than jemalloc ++* `USE_SYSTEM_JEMALLOC=yes`: use the system's installed jemalloc libraries ++ rather than the vendored copy. + * `BUILD_TLS=yes`: build with TLS support. Requires OpenSSL. + * `USE_SYSTEMD=yes`: build with systemd support. Requires libsystemd. + * `PROG_SUFFIX="-suffix"`: Append "-suffix" to executable names +-- +2.39.2 + diff --git a/dev-db/redict/files/redict-sentinel-7.3.0-config.patch b/dev-db/redict/files/redict-sentinel-7.3.0-config.patch new file mode 100644 index 000000000000..8ed5da34b598 --- /dev/null +++ b/dev-db/redict/files/redict-sentinel-7.3.0-config.patch @@ -0,0 +1,27 @@ +Rebased from original redis-sentinel-5.0-config.patch + +diff --git a/sentinel.conf b/sentinel.conf +index b7b3604f0..a1d7bfea9 100644 +--- a/sentinel.conf ++++ b/sentinel.conf +@@ -17,7 +17,7 @@ daemonize no + # When running daemonized, redict Sentinel writes a pid file in + # /var/run/redict-sentinel.pid by default. You can specify a custom pid file + # location here. +-pidfile /var/run/redict-sentinel.pid ++pidfile /run/redict-sentinel.pid + + # Specify the server verbosity level. + # This can be one of: +@@ -31,7 +31,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/redict/sentinel.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. +-- +2.41.0 + diff --git a/dev-db/redict/files/redict-sentinel.confd b/dev-db/redict/files/redict-sentinel.confd new file mode 100644 index 000000000000..e168b46b14f7 --- /dev/null +++ b/dev-db/redict/files/redict-sentinel.confd @@ -0,0 +1,16 @@ +# Redict-sentinel user. +REDICT_SENTINEL_USER="redict" + +# Redict-sentinel group. +REDICT_SENTINEL_GROUP="redict" + +# Redict-sentinel configuration file. +REDICT_SENTINEL_CONF="/etc/redict/sentinel.conf" + +# Redict-sentinel working directory. +REDICT_SENTINEL_DIR="/tmp" + +# Specify the network service that corresponds to the "bind" setting +# in your sentinel.conf. For example, if you bind to 127.0.0.1, this should +# be set to "net.lo" which provides the loopback interface. +rc_need="net.lo" diff --git a/dev-db/redict/files/redict-sentinel.initd b/dev-db/redict/files/redict-sentinel.initd new file mode 100644 index 000000000000..f2d4afcd3cad --- /dev/null +++ b/dev-db/redict/files/redict-sentinel.initd @@ -0,0 +1,22 @@ +#!/sbin/openrc-run +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +: ${REDICT_SENTINEL_DIR:=/tmp} +: ${REDICT_SENTINEL_CONF:=/etc/redict/sentinel.conf} +: ${REDICT_SENTINEL_USER:=redict} +: ${REDICT_SENTINEL_GROUP:=redict} +: ${REDICT_SENTINEL_TIMEOUT:=30} + +depend() { + use localmount logger + after keepalived redict +} + +command="/usr/sbin/redict-sentinel" +command_args="${REDICT_SENTINEL_CONF}" +command_background="true" +command_user="${REDICT_SENTINEL_USER}:${REDICT_SENTINEL_GROUP}" +pidfile="/run/${RC_SVCNAME}.pid" +retry="${REDICT_SENTINEL_TIMEOUT}" +start_stop_daemon_args="--chdir \"${REDICT_SENTINEL_DIR}\"" diff --git a/dev-db/redict/files/redict.confd b/dev-db/redict/files/redict.confd new file mode 100644 index 000000000000..02814e18f140 --- /dev/null +++ b/dev-db/redict/files/redict.confd @@ -0,0 +1,20 @@ +# Redict user. +REDICT_USER="redict" + +# Redict group. +REDICT_GROUP="redict" + +# Redict configuration file. +REDICT_CONF="/etc/redict/redict.conf" + +# Redict dump directory. +REDICT_DIR="/var/lib/redict" + +# Redict options. +# (Redict expects the first argument to be the configuration file.) +REDICT_OPTS="${REDICT_CONF}" + +# Specify the network service that corresponds to the "bind" setting +# in your redict.conf. For example, if you bind to 127.0.0.1, this should +# be set to "net.lo" which provides the loopback interface. +rc_need="net.lo" diff --git a/dev-db/redict/files/redict.initd b/dev-db/redict/files/redict.initd new file mode 100644 index 000000000000..80b086fbfce1 --- /dev/null +++ b/dev-db/redict/files/redict.initd @@ -0,0 +1,25 @@ +#!/sbin/openrc-run +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +: ${REDICT_DIR:=/var/lib/redict} +: ${REDICT_CONF:=/etc/redict/redict.conf} +: ${REDICT_OPTS:="${REDICT_CONF}"} +: ${REDICT_USER:=redict} +: ${REDICT_GROUP:=redict} +: ${REDICT_TIMEOUT:=30} + +# https://bugs.gentoo.org/631002#c10 +# Force '--daemonize no' to override the config file +command="/usr/sbin/redict-server" +command_args="${REDICT_OPTS} --daemonize no" +command_background="true" +command_user="${REDICT_USER}:${REDICT_GROUP}" +pidfile="/run/${RC_SVCNAME}.pid" +retry="${REDICT_TIMEOUT}" +start_stop_daemon_args="--chdir \"${REDICT_DIR}\"" + +depend() { + use localmount logger + after keepalived +} diff --git a/dev-db/redict/files/redict.logrotate b/dev-db/redict/files/redict.logrotate new file mode 100644 index 000000000000..01608529dac4 --- /dev/null +++ b/dev-db/redict/files/redict.logrotate @@ -0,0 +1,6 @@ +/var/log/redict/redict.log /var/log/redict/sentinel.log { + compress + delaycompress + notifempty + missingok +} diff --git a/dev-db/redict/files/redict.service b/dev-db/redict/files/redict.service new file mode 100644 index 000000000000..97fabd001d8e --- /dev/null +++ b/dev-db/redict/files/redict.service @@ -0,0 +1,14 @@ +[Unit] +Description=A persistent key-value database +After=syslog.target network.target + +[Service] +Type=simple +PIDFile=/run/redict/redict.pid +ExecStart=/usr/sbin/redict-server /etc/redict/redict.conf +User=redict +Group=redict + +[Install] +WantedBy=multi-user.target + diff --git a/dev-db/redict/files/redict.tmpfiles b/dev-db/redict/files/redict.tmpfiles new file mode 100644 index 000000000000..45e56d32afe7 --- /dev/null +++ b/dev-db/redict/files/redict.tmpfiles @@ -0,0 +1,2 @@ +# redict runtime directory +d /run/redict 0755 redict root - |