From: Bruce Ashfield <bruce.ashfi...@gmail.com>

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 <bruce.ashfi...@gmail.com>
---
 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

diff --git a/recipes-containers/docker/README b/recipes-containers/docker/README
new file mode 100644
index 0000000..565e350
--- /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 40a3642..b0bee4f 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
-- 
2.38.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#7761): 
https://lists.yoctoproject.org/g/meta-virtualization/message/7761
Mute This Topic: https://lists.yoctoproject.org/mt/95617037/21656
Group Owner: meta-virtualization+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to