Red Hat Bugzilla – Bug 1330622
enhance condition judgement in /usr/bin/docker script
Last modified: 2016-05-12 11:18:28 EDT
Description of problem: The valid value only is /usr/bin/docker-current or /usr/bin/docker-latest for the argument DOCKERBINARY in /etc/sysconfig/docker, but we haven't any limitation for value of argument in /usr/bin/docker, a kind of bad case is user set DOCKERBINARY=/usr/bin/docker in /etc/sysconfig/docker then restart docker service, and restart command will hang forever. Version-Release number of selected component (if applicable): # rpm -q docker docker-common docker-1.9.1-33.el7.x86_64 docker-common-1.9.1-33.el7.x86_64 How reproducible: always Steps to Reproduce: 1. echo DOCKERBINARY=/usr/bin/docker >> /etc/sysconfig/docker 2. systemctl restart docker Actual results: # systemctl is-active docker inactive # systemctl is-active docker-latest inactive # systemctl restart docker NOTE: hang forever. Expected results: Additional info:
We should catch this situation, but I would not say this is a blocker bug.
While I'm still pushing fixes in, I could put something like: if [ ! -f ${DOCKERBINARY} ]; then echo "Please set $DOCKERBINARY to /usr/bin/docker-current or /usr/bin/docker-latest" else exec ${DOCKERBINARY} $@ fi wdyt?
ugh ... that doesn't catch /usr/bin/docker
if [ ${DOCKERBINARY} == "/usr/bin/docker ]; then echo "Please set $DOCKERBINARY to /usr/bin/docker-current or /usr/bin/docker-latest" else exec ${DOCKERBINARY} $@ fi
Lokesh, where can I see the script? Without having a RHEL system to install?
After looking at the script and at the packaging, only problem I have is we should not rename any of the plugins, they should work (eventually) with docker-latest or regular docker, (Once plugins are supported).
Plugins are now docker-novolume-plugin, docker-rhel-push-plugin, docker-lvm-plugin. Those are docker-latest. /usr/bin/docker now looks like this: #!/bin/sh . /etc/sysconfig/docker [ -e "${DOCKERBINARY}" ] || DOCKERBINARY=/usr/bin/docker-current if [ ! -f /usr/bin/docker-current ]; then DOCKERBINARY=/usr/bin/docker-latest fi if [[ ${DOCKERBINARY} != "/usr/bin/docker-current" && ${DOCKERBINARY} != /usr/bin/docker-latest ]]; then echo "DOCKERBINARY has been set to an invalid value:" $DOCKERBINARY echo "" echo "Please set DOCKERBINARY to /usr/bin/docker-current or /usr/bin/docker-latest by editing /etc/sysconfig/docker" else exec ${DOCKERBINARY} "$@" fi 1. If _only_ docker-latest is installed, /usr/bin/docker calls /usr/bin/docker-latest 2. If docker is installed, /usr/bin/docker calls /usr/bin/docker-current unless set otherwise in /etc/sysconfig/docker 3. If DOCKERBINARY is set to anything other than /usr/bin/docker-current or /usr/bin/docker-latest, it'll prompt the user about invalid values and ask to set them to -current or -latest. Fixed in upcoming build
In docker-1.9.1-38.el7.x86_64, works fine. # echo DOCKERBINARY=/usr/bin/docker >> /etc/sysconfig/docker # systemctl restart docker # systemctl is-active docker active
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-1034.html