package/redis: add optional support for systemd
- Use the unit type=notify (Redis contacts systemd when ready) - Start redis with the supervised option, so it knows it should talk to systemd - USE_SYSTEMD is not documented, but it is used in the src/Makefile Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu> [yann.morin.1998@free.fr: add and explain USE_SYSTEMD] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
committed by
Yann E. MORIN
parent
ee3c813418
commit
ac3ab472e0
@@ -30,6 +30,13 @@ endif
|
|||||||
REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
|
REDIS_BUILDOPTS = $(TARGET_CONFIGURE_OPTS) \
|
||||||
PREFIX=$(TARGET_DIR)/usr MALLOC=libc
|
PREFIX=$(TARGET_DIR)/usr MALLOC=libc
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
|
||||||
|
REDIS_DEPENDENCIES += systemd
|
||||||
|
REDIS_BUILDOPTS += USE_SYSTEMD=yes
|
||||||
|
else
|
||||||
|
REDIS_BUILDOPTS += USE_SYSTEMD=no
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
|
ifeq ($(BR2_PACKAGE_LIBOPENSSL),y)
|
||||||
REDIS_DEPENDENCIES += libopenssl
|
REDIS_DEPENDENCIES += libopenssl
|
||||||
REDIS_BUILDOPTS += BUILD_TLS=yes
|
REDIS_BUILDOPTS += BUILD_TLS=yes
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Advanced key-value store
|
Description=Redis data structure server
|
||||||
|
Documentation=https://redis.io/documentation
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=notify
|
||||||
User=redis
|
User=redis
|
||||||
Group=redis
|
Group=redis
|
||||||
ExecStart=/usr/bin/redis-server /etc/redis.conf
|
ExecStart=/usr/bin/redis-server --supervised systemd --daemonize no
|
||||||
ExecStop=/usr/bin/redis-cli shutdown
|
TimeoutStartSec=5
|
||||||
|
TimeoutStopSec=5
|
||||||
CapabilityBoundingSet=
|
CapabilityBoundingSet=
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=true
|
PrivateDevices=true
|
||||||
|
|||||||
Reference in New Issue
Block a user