diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2022-08-16 23:19:06 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2022-08-25 22:55:48 -0400 |
commit | f6bf30aca6cb16f4fe185965f56e4e59dd7848f8 (patch) | |
tree | c1b769065fb059fa8387fbab5a6decd19ad187f7 /recipes-containers | |
parent | 5cfc4c3f803de6c44a8da9b5d40779cc3bd0f199 (diff) | |
download | meta-virtualization-f6bf30aca6cb16f4fe185965f56e4e59dd7848f8.tar.gz |
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 <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers')
-rw-r--r-- | recipes-containers/docker/README | 7 | ||||
-rw-r--r-- | recipes-containers/docker/docker.inc | 9 |
2 files changed, 12 insertions, 4 deletions
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 @@ | |||
1 | if containerd is starting docker, and it is interfering with standalone | ||
2 | docker operation, you may need to kill the running daemon and restart | ||
3 | it: | ||
4 | |||
5 | % ps axf | grep docker | grep -v grep | awk '{print "kill -9 " $1}' | sh | ||
6 | % systemctl stop docker | ||
7 | % 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() { | |||
120 | # replaces one copied from above with one that uses the local registry for a mirror | 120 | # replaces one copied from above with one that uses the local registry for a mirror |
121 | install -m 644 ${S}/src/import/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system | 121 | install -m 644 ${S}/src/import/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system |
122 | rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm | 122 | rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm |
123 | fi | 123 | else |
124 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
125 | install -d ${D}${sysconfdir}/init.d | 124 | install -d ${D}${sysconfdir}/init.d |
126 | install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init | 125 | install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init |
127 | fi | 126 | fi |
@@ -142,8 +141,10 @@ SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','', | |||
142 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.socket','',d)}" | 141 | SYSTEMD_SERVICE:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.socket','',d)}" |
143 | SYSTEMD_AUTO_ENABLE:${PN} = "enable" | 142 | SYSTEMD_AUTO_ENABLE:${PN} = "enable" |
144 | 143 | ||
145 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" | 144 | # inverted logic warning. We ony want the sysvinit init to be installed if systemd |
146 | INITSCRIPT_NAME:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" | 145 | # is NOT in the distro features |
146 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','systemd','', '${PN}',d)}" | ||
147 | INITSCRIPT_NAME:${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','', 'docker.init',d)}" | ||
147 | INITSCRIPT_PARAMS:${PN} = "defaults" | 148 | INITSCRIPT_PARAMS:${PN} = "defaults" |
148 | 149 | ||
149 | inherit useradd | 150 | inherit useradd |