From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 10 Dec 2021 14:09:12 +0100 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mvfeC-0024hR-N6 for lore@lore.pengutronix.de; Fri, 10 Dec 2021 14:09:12 +0100 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mvfeB-0007wU-Sh; Fri, 10 Dec 2021 14:09:11 +0100 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mvfcS-0005c7-R9; Fri, 10 Dec 2021 14:07:24 +0100 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1mvfcS-003mP7-R2; Fri, 10 Dec 2021 14:07:24 +0100 Received: from mol by dude03.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1mvfcR-00GNVS-5y; Fri, 10 Dec 2021 14:07:23 +0100 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Fri, 10 Dec 2021 14:07:23 +0100 Message-Id: <20211210130723.3903530-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211207144223.23091-1-clemens.gruber@pqgruber.com> References: <20211207144223.23091-1-clemens.gruber@pqgruber.com> MIME-Version: 1.0 Subject: Re: [ptxdist] [APPLIED] redis: new package X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Clemens Gruber Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as 2c0bed2bc1d8bf5307ad371b285ab0cce85ee31e. Michael [sent from post-receive hook] On Fri, 10 Dec 2021 14:07:22 +0100, Clemens Gruber wrote: > Adds a new package for redis, an open source (BSD licensed), in-memory > data structure store, used as a database, cache, and message broker. > > The systemd service file was taken from ArchLinux. > > Signed-off-by: Clemens Gruber > Message-Id: <20211207144223.23091-1-clemens.gruber@pqgruber.com> > Signed-off-by: Michael Olbrich > > diff --git a/patches/redis-6.2.6/0001-Support-systemd-and-set-a-data-directory.patch b/patches/redis-6.2.6/0001-Support-systemd-and-set-a-data-directory.patch > new file mode 100644 > index 000000000000..34d8fd283bfc > --- /dev/null > +++ b/patches/redis-6.2.6/0001-Support-systemd-and-set-a-data-directory.patch > @@ -0,0 +1,30 @@ > +From: Clemens Gruber > +Date: Mon, 15 Nov 2021 16:21:31 +0100 > +Subject: [PATCH] Support systemd and set a data directory > + > +--- > + redis.conf | 4 ++-- > + 1 file changed, 2 insertions(+), 2 deletions(-) > + > +diff --git a/redis.conf b/redis.conf > +index e8eff2774981..8f76ea1c84e4 100644 > +--- a/redis.conf > ++++ b/redis.conf > +@@ -272,7 +272,7 @@ daemonize no > + # The default is "no". To run under upstart/systemd, you can simply uncomment > + # the line below: > + # > +-# supervised auto > ++supervised auto > + > + # If a pid file is specified, Redis writes it where specified at startup > + # and removes it at exit. > +@@ -451,7 +451,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/redis/ > + > + ################################# REPLICATION ################################# > + > diff --git a/patches/redis-6.2.6/series b/patches/redis-6.2.6/series > new file mode 100644 > index 000000000000..1a299f8b7d69 > --- /dev/null > +++ b/patches/redis-6.2.6/series > @@ -0,0 +1,4 @@ > +# generated by git-ptx-patches > +#tag:base --start-number 1 > +0001-Support-systemd-and-set-a-data-directory.patch > +# a122637ab2789578ffe3ff7cc6f22faf - git-ptx-patches magic > diff --git a/projectroot/etc/group b/projectroot/etc/group > index 09df73ba064d..69d650510002 100644 > --- a/projectroot/etc/group > +++ b/projectroot/etc/group > @@ -33,4 +33,5 @@ render:x:209: > pulse:x:210: > chrony:x:211: > rauc-hawkbit:x:212: > +redis:x:213: > nogroup:x:65534: > diff --git a/projectroot/etc/passwd b/projectroot/etc/passwd > index 529f49a77b83..b4669abb59dd 100644 > --- a/projectroot/etc/passwd > +++ b/projectroot/etc/passwd > @@ -17,5 +17,6 @@ systemd-journal-upload:x:208:208:systemd-journal-upload:/dev/null:/bin/false > pulse:x:209:210:pulse:/dev/null:/bin/false > chrony:x:210:211:chrony:/dev/null:/bin/false > rauc-hawkbit:x:211:212:rauc-hawkbit:/dev/null:/bin/false > +redis:x:212:213:redis:/dev/null:/bin/false > rpcuser:x:65533:65534:RPC user:/dev/null:/bin/false > nobody:x:65534:65534:Unprivileged Nobody:/dev/null:/bin/false > diff --git a/projectroot/usr/lib/systemd/system/redis.service b/projectroot/usr/lib/systemd/system/redis.service > new file mode 100644 > index 000000000000..715e64d69e9b > --- /dev/null > +++ b/projectroot/usr/lib/systemd/system/redis.service > @@ -0,0 +1,23 @@ > +[Unit] > +Description=Advanced key-value store > +After=network.target > + > +[Service] > +Type=notify > +User=redis > +Group=redis > +ExecStart=/usr/bin/redis-server /etc/redis.conf > +TimeoutStartSec=60 > +TimeoutStopSec=60 > +CapabilityBoundingSet= > +PrivateTmp=true > +PrivateDevices=true > +ProtectSystem=full > +ProtectHome=true > +NoNewPrivileges=true > +RuntimeDirectory=redis > +RuntimeDirectoryMode=755 > +LimitNOFILE=10032 > + > +[Install] > +WantedBy=multi-user.target > diff --git a/projectroot/usr/lib/tmpfiles.d/redis.conf b/projectroot/usr/lib/tmpfiles.d/redis.conf > new file mode 100644 > index 000000000000..d9283eab56d2 > --- /dev/null > +++ b/projectroot/usr/lib/tmpfiles.d/redis.conf > @@ -0,0 +1 @@ > +d /var/lib/redis 0700 redis redis > diff --git a/rules/redis.in b/rules/redis.in > new file mode 100644 > index 000000000000..3cf67ea893ee > --- /dev/null > +++ b/rules/redis.in > @@ -0,0 +1,27 @@ > +## SECTION=system_libraries > +menuconfig REDIS > + tristate > + prompt "redis " > + select GCCLIBS_GCC_S > + select LIBC_DL > + select LIBC_PTHREAD > + select LIBC_CRYPT > + select SYSTEMD if REDIS_SYSTEMD > + help > + Redis is an open source (BSD licensed), in-memory data > + structure store, used as a database, cache, and message > + broker. > + > +if REDIS > + > +config REDIS_SYSTEMD > + bool > + default INITMETHOD_SYSTEMD > + > +config REDIS_SYSTEMD_UNIT > + bool > + default y > + depends on SYSTEMD > + prompt "Unit file for systemd" > + > +endif > diff --git a/rules/redis.make b/rules/redis.make > new file mode 100644 > index 000000000000..7b6ba48a3618 > --- /dev/null > +++ b/rules/redis.make > @@ -0,0 +1,97 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2021 by Clemens Gruber > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_REDIS) += redis > + > +# > +# Paths and names > +# > +REDIS_VERSION := 6.2.6 > +REDIS_MD5 := f69ca96b39ca93001add922d558f9842 > +REDIS := redis-$(REDIS_VERSION) > +REDIS_SUFFIX := tar.gz > +REDIS_URL := https://download.redis.io/releases/$(REDIS).$(REDIS_SUFFIX) > +REDIS_SOURCE := $(SRCDIR)/$(REDIS).$(REDIS_SUFFIX) > +REDIS_DIR := $(BUILDDIR)/$(REDIS) > +REDIS_LICENSE := BSD-3-Clause > +REDIS_LICENSE_FILES := file://COPYING;md5=8ffdd6c926faaece928cf9d9640132d2 > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +REDIS_CONF_TOOL := NO > + > +REDIS_MAKE_ENV := \ > + $(CROSS_ENV) > + > +REDIS_MAKE_OPT := \ > + CC=$(CROSS_CC) \ > + PREFIX=/usr \ > + USE_JEMALLOC=no \ > + USE_SYSTEMD=$(call ptx/ifdef,PTXCONF_REDIS_SYSTEMD,yes,no) \ > + all > + > +REDIS_PATH := PATH=$(CROSS_PATH) > + > +REDIS_INSTALL_OPT := \ > + PREFIX=$(REDIS_PKGDIR)/usr \ > + install > + > + > +# ---------------------------------------------------------------------------- > +# Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/redis.install: > + @$(call targetinfo) > + @$(call world/install, REDIS) > + @install -v -D -m644 $(REDIS_DIR)/redis.conf \ > + $(REDIS_PKGDIR)/etc/redis.conf > + @$(call touch) > + > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/redis.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, redis) > + @$(call install_fixup, redis,PRIORITY,optional) > + @$(call install_fixup, redis,SECTION,base) > + @$(call install_fixup, redis,AUTHOR,"Clemens Gruber ") > + @$(call install_fixup, redis,DESCRIPTION,"An in-memory database that persists on disk") > + > + @$(call install_copy, redis, 0, 0, 0755, -, /usr/bin/redis-benchmark) > + @$(call install_copy, redis, 0, 0, 0755, -, /usr/bin/redis-cli) > + @$(call install_copy, redis, 0, 0, 0755, -, /usr/bin/redis-server) > + > + @$(call install_link, redis, /usr/bin/redis-server, /usr/bin/redis-check-aof) > + @$(call install_link, redis, /usr/bin/redis-server, /usr/bin/redis-check-rdb) > + > + @$(call install_alternative, redis, 0, 0, 0644, /etc/redis.conf) > + > + @$(call install_copy, redis, 0, 0, 0700, /var/lib/redis) > + > +ifdef PTXCONF_REDIS_SYSTEMD_UNIT > + @$(call install_alternative, redis, 0, 0, 0644, /usr/lib/systemd/system/redis.service) > + @$(call install_link, redis, ../redis.service, \ > + /usr/lib/systemd/system/multi-user.target.wants/redis.service) > +endif > + @$(call install_alternative, redis, 0, 0, 0644, /usr/lib/tmpfiles.d/redis.conf) > + > + @$(call install_finish, redis) > + > + @$(call touch) > + > +# vim: syntax=make _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de