containers: cc-container-mng: add shutdown service
Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
parent
a82412530c
commit
6a75e08023
|
|
@ -19,13 +19,14 @@ CC_CONTAINER_MNG_GIT_URI ?= "${@oe.utils.conditional('DIGI_INTERNAL_GIT', '1', '
|
||||||
SRC_URI = " \
|
SRC_URI = " \
|
||||||
${CC_CONTAINER_MNG_GIT_URI};branch=${SRCBRANCH} \
|
${CC_CONTAINER_MNG_GIT_URI};branch=${SRCBRANCH} \
|
||||||
file://cc-containerd.service \
|
file://cc-containerd.service \
|
||||||
|
file://cc-containerd-shutdown.service \
|
||||||
"
|
"
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
inherit python_setuptools_build_meta systemd
|
inherit python_setuptools_build_meta systemd
|
||||||
|
|
||||||
SYSTEMD_SERVICE:${PN} = "cc-containerd.service"
|
SYSTEMD_SERVICE:${PN} = "cc-containerd.service cc-containerd-shutdown.service"
|
||||||
SYSTEMD_AUTO_ENABLE ?= "enable"
|
SYSTEMD_AUTO_ENABLE ?= "enable"
|
||||||
|
|
||||||
RDEPENDS:${PN} += " \
|
RDEPENDS:${PN} += " \
|
||||||
|
|
@ -38,6 +39,7 @@ RDEPENDS:${PN} += " \
|
||||||
do_install:append() {
|
do_install:append() {
|
||||||
install -d ${D}${systemd_system_unitdir}
|
install -d ${D}${systemd_system_unitdir}
|
||||||
install -m 0644 ${WORKDIR}/cc-containerd.service ${D}${systemd_system_unitdir}/cc-containerd.service
|
install -m 0644 ${WORKDIR}/cc-containerd.service ${D}${systemd_system_unitdir}/cc-containerd.service
|
||||||
|
install -m 0644 ${WORKDIR}/cc-containerd-shutdown.service ${D}${systemd_system_unitdir}/cc-containerd-shutdown.service
|
||||||
|
|
||||||
install -d ${D}${sysconfdir}/cc-container
|
install -d ${D}${sysconfdir}/cc-container
|
||||||
install -m 0644 ${S}/cc-container-mng.conf ${D}${sysconfdir}/cc-container/cc-container-mng.conf
|
install -m 0644 ${S}/cc-container-mng.conf ${D}${sysconfdir}/cc-container/cc-container-mng.conf
|
||||||
|
|
@ -51,6 +53,7 @@ do_install:append() {
|
||||||
|
|
||||||
FILES:${PN}:append = " \
|
FILES:${PN}:append = " \
|
||||||
${systemd_system_unitdir}/cc-containerd.service \
|
${systemd_system_unitdir}/cc-containerd.service \
|
||||||
|
${systemd_system_unitdir}/cc-containerd-shutdown.service \
|
||||||
${sysconfdir}/cc-container/cc-container-mng.conf \
|
${sysconfdir}/cc-container/cc-container-mng.conf \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Stop managed containers during system shutdown
|
||||||
|
DefaultDependencies=no
|
||||||
|
Before=shutdown.target reboot.target halt.target poweroff.target kexec.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/bin/cc-containerd --config-file /etc/cc-container/cc-container-mng.conf --stop-managed-containers
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=reboot.target
|
||||||
|
WantedBy=halt.target
|
||||||
|
WantedBy=poweroff.target
|
||||||
|
WantedBy=kexec.target
|
||||||
Loading…
Reference in New Issue