cccs: switch daemon init method to inittab for sysvinit-based systems
This commit updates the CCCS recipe to support `inittab`-based daemon initialization for platforms using `sysvinit`, such as ConnectCore 6UL. By switching to `inittab` for daemon control in these systems, we guarantee automatic relaunch of `cccsd` if it exits unexpectedly (this functionality was previously only available with `systemd`) This improves reliability and aligns behavior across `systemd` and non-`systemd` platforms. See Confluence question "Why won't CC6-UL rejoin DRM after a planned DRM outage?" (https://onedigi.atlassian.net/wiki/plugins/servlet/ac/com.atlassian.confluence.plugins.confluence-questions/globalQuestionsViewer?ac.com.atlassian.confluence.plugins.confluence-questions.path=/questions/236710985798) Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com> (cherry picked from commit 5c667641a88437795fea3097ca5cf76c22de47c1)
This commit is contained in:
parent
7614d4ab39
commit
b154154a7e
|
|
@ -22,6 +22,7 @@ SRC_URI = " \
|
|||
${CC_GIT_URI};branch=${SRCBRANCH} \
|
||||
file://cccsd-init \
|
||||
file://cccsd.service \
|
||||
file://cccsd.tab \
|
||||
file://cccs-gs-demo-init \
|
||||
file://cccs-gs-demo.service \
|
||||
"
|
||||
|
|
@ -50,16 +51,21 @@ inherit pkgconfig systemd update-rc.d
|
|||
do_install() {
|
||||
oe_runmake DESTDIR=${D} install
|
||||
|
||||
install -d ${D}${sysconfdir}/init.d/
|
||||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
|
||||
# Install systemd unit files
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/cccsd.service ${D}${systemd_unitdir}/system/
|
||||
install -m 0644 ${WORKDIR}/cccs-gs-demo.service ${D}${systemd_unitdir}/system/
|
||||
fi
|
||||
|
||||
install -d ${D}${sysconfdir}/init.d/
|
||||
install -m 755 ${WORKDIR}/cccsd-init ${D}${sysconfdir}/cccsd
|
||||
ln -sf /etc/cccsd ${D}${sysconfdir}/init.d/cccsd
|
||||
else
|
||||
install -d ${D}${sysconfdir}/inittab.d/
|
||||
install -m 755 ${WORKDIR}/cccsd.tab ${D}${sysconfdir}/inittab.d/cccsd.tab
|
||||
fi
|
||||
|
||||
install -m 755 ${WORKDIR}/cccs-gs-demo-init ${D}${sysconfdir}/cccs-gs-demo
|
||||
ln -sf /etc/cccs-gs-demo ${D}${sysconfdir}/init.d/cccs-gs-demo
|
||||
|
||||
|
|
@ -100,9 +106,7 @@ REMOVE_POSTINST_RPN = "${PN}-daemon"
|
|||
inherit ${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "remove-pkg-postinst-ontarget", \
|
||||
oe.utils.ifelse(d.getVar("CCCS_CONF_PATH"), "remove-pkg-postinst-ontarget", ""), d)}
|
||||
|
||||
INITSCRIPT_PACKAGES = "${PN}-daemon ${PN}-gs-demo"
|
||||
INITSCRIPT_NAME:${PN}-daemon = "cccsd"
|
||||
INITSCRIPT_PARAMS:${PN}-daemon = "defaults 19 81"
|
||||
INITSCRIPT_PACKAGES = "${PN}-gs-demo"
|
||||
INITSCRIPT_NAME:${PN}-gs-demo = "cccs-gs-demo"
|
||||
INITSCRIPT_PARAMS:${PN}-gs-demo = "defaults 81 19"
|
||||
|
||||
|
|
@ -127,6 +131,7 @@ FILES:${PN}-daemon = " \
|
|||
${sysconfdir}/cccsd \
|
||||
${sysconfdir}/cccs.conf \
|
||||
${sysconfdir}/init.d/cccsd \
|
||||
${sysconfdir}/inittab/cccsd.tab \
|
||||
"
|
||||
|
||||
FILES:${PN}-gs-demo = " \
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
cccs:2345:respawn:/usr/bin/cccsd -d > /dev/null 2>&1
|
||||
Loading…
Reference in New Issue