Univention Bugzilla – Bug 39273
docker.io package fails to upgrade if docker is running
Last modified: 2015-11-17 12:12:43 CET
+++ This bug was initially created as a clone of Bug #38549 +++ docker.io version 1.6.2~dfsg1 (in the docker scope) wants to not restart the service in case of an upgrade, so they added to debian/rules "dh_installinit --no-restart-on-upgrade": override_dh_installinit: dh_installinit --name=docker --no-restart-on-upgrade This expands into ----------- prerm --------------------- # Automatically added by dh_installinit if [ -x "/etc/init.d/docker" ] && [ "$1" = remove ]; then invoke-rc.d docker stop || exit $? fi # End automatically added section ------------- postinst ----------------- # Automatically added by dh_installinit if [ -x "/etc/init.d/docker" ]; then update-rc.d docker defaults >/dev/null invoke-rc.d docker start || exit $? fi # End automatically added section -------------------------------------- Before (without --no-restart-on-upgrade) the prerm did not have the "&& [ "$1" = remove ]" condition. Now neither an update nor a reinstall is possible if the service is running, because postinst fails with "invoke-rc.d docker start || exit $?". To fix this a decision has to be made, if the package should restart the daemon (and thus all containers(!), see https://github.com/docker/docker/issues/2658) when upgrading/reinstalling or not.
The current behavior (docker 1.6.2~dfsg1-1.19.201 in UCS 4.1-0) if the "-d" flag is used when starting a Docker container is: * Containers are started as children of Docker and daemonized. So Docker can be closed (using start-stop-daemon / init script) without the containers getting killed. They stay fully functional. * The problem is, that when Docker is started again, it discovers all running containers… and kills them! Reattaching is not currently implemented. BTW: ucs-4.1-0/base/univention-firewall/conffiles/etc/security/packetfilter.d/20_docker.sh needs a running docker service to discover the used port forwardings. If the univention-firewall is restarted when docker is stopped, it will not recreate the necessary port forwardings for the existing, detached containers.
Fixed with 64771 in univention-docker: the docker init script exits with 0 if docker is already stopped or already started, both prerm und postinst are then happy in either case. @support: Please note, that if a user manually uninstalls docker.io and installs it again, the init script will be the original one of docker.io and an upgrade will fail, unless univention-docker is reinstalled, which will not be possible at that time, so a purge of docker.io will be needed first.
Ok, works. Changelog not required.
UCS 4.1 has been released: https://docs.software-univention.de/release-notes-4.1-0-en.html https://docs.software-univention.de/release-notes-4.1-0-de.html If this error occurs again, please use "Clone This Bug".