Skip to content
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

docker stop not properly stopping v14.2 containers #1017

Closed
JedMeister opened this issue Mar 2, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@JedMeister
Copy link
Member

commented Mar 2, 2018

Bernhard Seebass has reported in a comment on our Docker docs that under Docker v17.09.1-ce running on OpenSuSE Tumbleweed, that the docker stop <container> isn't working properly with 14.2 Core appliance (and therefore probably affects all TurnKey containers).

He has provided a work an updated start.sh script that works for him (use sleep instead su and exit start.sh on recieving signal):

#!/bin/bash

# not recommended, useful for testing though...
if [ -n "$SEC_UPDATES" ]; then
    PRESEED=/usr/lib/inithooks/firstboot.d/29preseed
    sed -i "s|SEC_UPDATES=.*|SEC_UPDATES=$SEC_UPDATES|" $PRESEED
fi

run-parts -a start /etc/rc2.d
trap "run-parts -a stop /etc/rc2.d; exit 0" INT TERM EXIT

turnkey-sysinfo

if [ -x /root/.profile.d/turnkey-init-fence ]; then
cat<<EOF

WARNING: The container requires initialization (performed on first login).
This can be performed from the host as follows:

    CID=\$(docker ps -l -q)
    CIP=\$(docker inspect --format='{{.NetworkSettings.IPAddress}}' \$CID)
    docker logs \$CID | grep "Random initial root password"
    ssh root@\$CIP
EOF
fi

#cat<<EOF
#
#WARNING: Exiting this shell will stop the container.
#For regular console usage, SSH is recommended.
#EOF

#/bin/su

while true
do
    # wait for SIGINT, SIGTERM or SIGEXIT (see trap above)
    # signal is only recieved while not sleeping, therefore use a short sleep period
    sleep 0.5
done

Assuming this script is reliable, then we should consider replacing the current default start.sh (found in buildtasks) for v15.0.

@JedMeister JedMeister added this to the 15.0 milestone Mar 2, 2018

@OnGle

This comment has been minimized.

Copy link
Member

commented May 4, 2018

This is quite possibly something we should fix however this issue and the original post do not specify details of expected behaviour or how to reproduce.

FWIW I ran and stopped turnkeylinux/core-14.2 container with docker 18.03 on a 14.2 TKLDev server and, docker container ls indicated it was not running and docker container stats indicated it was using no resources which to me seems like a reasonable shutdown state.

I'm closing this issue now due to lack of information, if anybody has further information on this issue please feel free to re-open this issue and continue discussion

@OnGle OnGle closed this May 4, 2018

@JedMeister

This comment has been minimized.

Copy link
Member Author

commented May 4, 2018

Thanks @OnGle FWIW, I commented back on the doc page. If we can get more info, then we may reopen this.

I've also added some (somewhat conflicting) tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.