Skip to contentSkip to conversation

haveged: Fix missing initscript when both systemd and sysvinit are enabled

PATCH New Andreas Oberritter 1 participant 1 message Nov 7, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 haveged: Fix missing initscript when both systemd and sysvinit are enabled

Haveged's makefile installs either one or the other.

---
 meta-oe/recipes-extended/haveged/haveged_1.9.6.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta-oe/recipes-extended/haveged/haveged_1.9.6.bb +6 -0
index 0189e19c09..a2f0d07f24 100644
@@ -35,6 +35,12 @@ do_install_append() {
     # The exit status is 143 when the service is stopped
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
         sed -i '/ExecStart/a SuccessExitStatus=143' ${D}${systemd_system_unitdir}/haveged.service
+        # Hybrid systemd-sysvinit distros must install the initscript manually
+        if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+            install -d ${D}${INIT_D_DIR}
+            sed -e "s,@SBINDIR@,${sbindir},g" <${S}/init.d/sysv.redhat >${D}${INIT_D_DIR}/haveged
+            chmod 755 ${D}${INIT_D_DIR}/haveged
+        fi
     fi
 }
 
Signature · 1 line
2.17.1