mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-04 14:39:54 +00:00
redis: build with USE_SYSTEMD=yes when systemd is enabled
Compile redis with full systemd support when the chosen init system is systemd. Enabling systemd supervision allows redis to communicate the actual server status (i.e. "Loading dataset", "Waiting for master<->replica sync") to systemd, instead of declaring readiness right after initializing the server process. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -9,6 +9,7 @@ ExecStart=/usr/bin/redis-server /etc/redis/redis.conf
|
|||||||
ExecStop=/usr/bin/redis-cli shutdown
|
ExecStop=/usr/bin/redis-cli shutdown
|
||||||
Restart=always
|
Restart=always
|
||||||
LimitNOFILE=10032
|
LimitNOFILE=10032
|
||||||
|
Type=notify
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ USERADD_PACKAGES = "${PN}"
|
|||||||
USERADD_PARAM:${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis"
|
USERADD_PARAM:${PN} = "--system --home-dir /var/lib/redis -g redis --shell /bin/false redis"
|
||||||
GROUPADD_PARAM:${PN} = "--system redis"
|
GROUPADD_PARAM:${PN} = "--system redis"
|
||||||
|
|
||||||
REDIS_ON_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"
|
PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
|
||||||
|
PACKAGECONFIG[systemd] = "USE_SYSTEMD=yes,USE_SYSTEMD=no,systemd"
|
||||||
|
|
||||||
|
EXTRA_OEMAKE += "${PACKAGECONFIG_CONFARGS}"
|
||||||
|
|
||||||
do_compile:prepend() {
|
do_compile:prepend() {
|
||||||
(cd deps && oe_runmake hiredis lua linenoise)
|
(cd deps && oe_runmake hiredis lua linenoise)
|
||||||
@@ -55,8 +58,9 @@ do_install() {
|
|||||||
install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir}
|
install -m 0644 ${WORKDIR}/redis.service ${D}${systemd_system_unitdir}
|
||||||
sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service
|
sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${systemd_system_unitdir}/redis.service
|
||||||
|
|
||||||
if [ "${REDIS_ON_SYSTEMD}" = true ]; then
|
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||||
sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf
|
sed -i 's!daemonize yes!# daemonize yes!' ${D}/${sysconfdir}/redis/redis.conf
|
||||||
|
sed -i 's!supervised no!supervised systemd!' ${D}/${sysconfdir}/redis/redis.conf
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user