Skip to content

Commit 5a9f55d

Browse files
hhorakzmiklank
authored andcommitted
Gracefully shut down the original container
With keeping the container running, we see SELinux error messages and sudden crash of the PostgreSQL container. Let's properly shut down the container before using its volume privately mounted into a different container. Background: podman's :Z modificator for volumes works the way that the latest container run with the same volume directory mounted with :Z modificator has access, the previous containers are kept running, but access to the shared directory is suddenly removed. That caused the first instance of PostgreSQL server to crash with SIGSEGV actually, while triggering some SELinux error message during that.
1 parent 1567d0e commit 5a9f55d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: test/run_test

+7
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,13 @@ $volume_options
634634

635635
echo " Changing passwords"
636636

637+
echo "Kill the previous container and create a new one"
638+
local cidfile=$CID_FILE_DIR/"${name}"
639+
docker kill $(cat $cidfile)
640+
docker rm -f $(cat $cidfile)
641+
# Don't forget to remove its .cid file
642+
rm $cidfile
643+
637644
DOCKER_ARGS="
638645
-e POSTGRESQL_DATABASE=${database}
639646
-e POSTGRESQL_USER=${user}

0 commit comments

Comments
 (0)