-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deb pkg stop service before upgrade, start after upgrade #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
+1, thanks! |
|
||
case "$1" in | ||
upgrade) | ||
invoke-rc.d docker stop || exit $? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewhsu what if docker was already stopped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the result of that command will always be exit code 0
@@ -9,6 +9,9 @@ case "$1" in | |||
fi | |||
fi | |||
;; | |||
upgrade) | |||
invoke-rc.d docker start || exit $? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewhsu what is the expected behavior when docker was not running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expected behaviour is to have docker service started after completion of install of a docker-ce deb package. this is what happens on a new install of a docker-ce deb package.
https://manpages.debian.org/stretch/debhelper/dh_installinit.1.en.html is probably a useful link to get an idea of the code we're getting automatically via |
@tianon if you get docker from http://apt.dockerproject.org/repo/pool/main/d/docker-engine/ and then update to https://download.docker.com/linux/ such as https://download.docker.com/linux/ubuntu/dists/xenial/pool/test/amd64/docker-ce_17.06.0~ce~rc4-0~ubuntu_amd64.deb then it "fails" (aka docker does not stop). BUT, if you got docker from, say https://download.docker.com/linux/ubuntu/dists/xenial/pool/stable/amd64/docker-ce_17.03.1~ce-0~ubuntu-xenial_amd64.deb, it's the same |
Signed-off-by: Andrew Hsu <andrewhsu@docker.com>
Closing this in favour of PR #24 also have deb pkg conflict docker-engine because tested with that one and it solves the problem. |
Similar to PR #20 restart docker service if needed for rpm upgrade, this PR addresses issue moby/moby#33688 Container can not start after docker engine upgrade from 17.03.1-ce to 17.06.0-ce-rc3 for deb packages.
This PR will stop the docker service if it is running in an upgrade scenario. It will then start the service after the new files are installed so that the new daemon is used to launch the service. Unlike rpm packages, installing the docker-ce deb package is always expected to finish by starting the service.
For reference, deb pkg script event hooks: https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html#s-maintscripts
To build a xenial deb pkg:
Signed-off-by: Andrew Hsu andrewhsu@docker.com