Bug 1330622
| Summary: | enhance condition judgement in /usr/bin/docker script | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Alex Jia <ajia> |
| Component: | docker | Assignee: | Lokesh Mandvekar <lsm5> |
| Status: | CLOSED ERRATA | QA Contact: | atomic-bugs <atomic-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 7.2 | CC: | lsm5, lsu |
| Target Milestone: | rc | Keywords: | Extras, ZStream |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | docker-1.9.1-37.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-05-12 15:18:28 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Alex Jia
2016-04-26 15:14:46 UTC
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 |