Bug 1259829 - docker kill --name recommended in man atomic-stop(1) does not work
docker kill --name recommended in man atomic-stop(1) does not work
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: atomic (Show other bugs)
7.2
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Lokesh Mandvekar
atomic-bugs@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-03 11:07 EDT by Jan Pazdziora
Modified: 2016-03-31 19:24 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-31 19:24:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Pazdziora 2015-09-03 11:07:20 EDT
Description of problem:

I've realized I don't support atomic stop in my container. So I've read man atomic-stop(1) which recommends using

       If the container image has a LABEL STOP instruction like the following:

       CLABEL STOP /usr/bin/docker kill -s HUP --name $NAME $IMAGE

However, having that in my Dockerfile, atomic stop sssd fails with flag provided but not defined: --name.

Version-Release number of selected component (if applicable):

atomic-1.0-108.el7.x86_64
docker-1.7.1-115.el7.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. Run docker kill -s HUP --name sssd sssd for a container started with docker run --name sssd ...

Actual results:

flag provided but not defined: --name.

Expected results:

The man page probably ways to show

       LABEL STOP /usr/bin/docker kill -s HUP $NAME

Additional info:
Comment 2 Antonio Murdaca 2015-10-05 13:43:43 EDT
Fix is in https://github.com/projectatomic/atomic/pull/181
Comment 3 Daniel Walsh 2015-10-28 09:40:52 EDT
Should be fixed in atomic-1.5
Comment 5 Alex Jia 2016-01-20 05:02:28 EST
Fix typos in PR 181, https://github.com/projectatomic/atomic/pull/290
Comment 6 Alex Jia 2016-01-20 05:08:30 EST
1) w/o LABEL STOP

# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

# atomic images | grep centos
 docker.io/centos                                    latest c8a648134623 2015-12-24 23:30    196.63 MB 

# atomic stop centos
# echo $?
0

NOTE: no any output message, Is it an expected result?


2) w/ LABEL STOP

# cat Dockerfile.1
FROM centos
ENV container docker

LABEL STOP "/usr/bin/docker kill -s HUP \${NAME}"

# docker build -t centos_stop_label -f Dockerfile.1 .

# atomic info centos_stop_label | grep STOP
STOP: /usr/bin/docker kill -s HUP ${NAME}

# docker run -it centos_stop_label /bin/sh
Usage of loopback devices is strongly discouraged for production use. Either use `--storage-opt dm.thinpooldev` or use `--storage-opt dm.no_warn_on_loop_devices=true` to suppress this warning.
sh-4.2#

Open a new terminal window

# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
1436872bf388        centos_stop_label   "/bin/sh"           6 seconds ago       Up 4 seconds                            condescending_gates

# atomic stop 1436872bf388
/usr/bin/docker kill -s HUP 1436872bf388
1436872bf388
Comment 7 Alex Jia 2016-01-31 22:46:29 EST
It also works well on atomic-1.8-6.git1bc3814.el7.x86_64, move to the bug to VERIFIED status per comment 6.


# rpm -q atomic
atomic-1.8-6.git1bc3814.el7.x86_64

# man atomic-stop | grep "LABEL STOP /"
       LABEL STOP /usr/bin/docker kill -s HUP \${NAME}
Comment 9 errata-xmlrpc 2016-03-31 19:24:56 EDT
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/RHBA-2016-0527.html

Note You need to log in before you can comment on or make changes to this bug.