Skip to content

Commit

Permalink
Gracefully shut down the original container
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hhorak authored and zmiklank committed Jan 6, 2024
1 parent 1567d0e commit 5a9f55d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/run_test
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,13 @@ $volume_options

echo " Changing passwords"

echo "Kill the previous container and create a new one"
local cidfile=$CID_FILE_DIR/"${name}"
docker kill $(cat $cidfile)
docker rm -f $(cat $cidfile)
# Don't forget to remove its .cid file
rm $cidfile

DOCKER_ARGS="
-e POSTGRESQL_DATABASE=${database}
-e POSTGRESQL_USER=${user}
Expand Down

0 comments on commit 5a9f55d

Please sign in to comment.