From f6bf30aca6cb16f4fe185965f56e4e59dd7848f8 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Tue, 16 Aug 2022 23:19:06 -0400 Subject: docker: ensure that sysvinit and systemd are exclusive The sysvinit functionality conflicts with the docker daemon settings required for the systemd docker.socket. Ensure that the sysvinit capabilities are only enabled if systemd is not present. Signed-off-by: Bruce Ashfield --- recipes-containers/docker/README | 7 +++++++ recipes-containers/docker/docker.inc | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 recipes-containers/docker/README (limited to 'recipes-containers') diff --git a/recipes-containers/docker/README b/recipes-containers/docker/README new file mode 100644 index 00000000..565e3501 --- /dev/null +++ b/recipes-containers/docker/README @@ -0,0 +1,7 @@ +if containerd is starting docker, and it is interfering with standalone +docker operation, you may need to kill the running daemon and restart +it: + + % ps axf | grep docker | grep -v grep | awk '{print "kill -9 " $1}' | sh + % systemctl stop docker + % systemctl start docker diff --git a/recipes-containers/docker/docker.inc b/recipes-containers/docker/docker.inc index 40a3642c..b0bee4f0 100644 --- a/recipes-containers/docker/docker.inc +++ b/recipes-containers/docker/docker.inc @@ -120,8 +120,7 @@ do_install() { # replaces one copied from above with one that uses the local registry for a mirror install -m 644 ${S}/src/import/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm - fi - if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then + else install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init fi @@ -142,8 +141,10 @@ SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','', SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.socket','',d)}" SYSTEMD_AUTO_ENABLE:${PN} = "enable" -INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" -INITSCRIPT_NAME:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" +# inverted logic warning. We ony want the sysvinit init to be installed if systemd +# is NOT in the distro features +INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','systemd','', '${PN}',d)}" +INITSCRIPT_NAME:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','', 'docker.init',d)}" INITSCRIPT_PARAMS:${PN} = "defaults" inherit useradd -- cgit v1.2.3-54-g00ecf