#51080 Container image does not gracefully shut down on SIGTERM (docker/podman stop)
Closed: wontfix 3 years ago by firstyear. Opened 3 years ago by robinr1.

Issue Description

When the 389-ds container is running and docker stop or podman stop is issued the container gets killed after the default 10sec timeout instead of performing a graceful shutdown. Exit code is then 137. Logs do not mention a shutdown of the 389 instance.

When running the container with a teminal attached and issuing Ctrl+C does start a graceful shutdown.

Examining /usr/lib/dirsrv/dscontainer learns me that it will only start a graceful shutdown on a KeyboardInterrupt Exception. But podman stop sends a SIGTERM which is ignored by dscontainer.
podman kill --signal=SIGINT indead makes the container shutdown gracefully with an exit code 0 and mentions the shutdown in the logs.

Package Version and Platform

  • os: openSUSE MicroOS
  • container runtime: podman 1.9.1
  • container image: docker.io/389ds/dirsrv:latest
  • 389 Directory Server Version: 1.4.4.1

Steps to reproduce

  1. podman stop dirsrv

Actual results

command takes 10 sec to stop the container. Exit code is 137
Last line in log:

INFO: 389-ds-container started.

Expected results

container stops almost immediatly. Exit code is 0.
Last line in log:

INFO: STOPPING: Shutting down 389-ds-container ...

It would appear the container definition doesn't have the correct signal handler set in the dockerfile. I will ammend that now.

Metadata Update from @firstyear:
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None

3 years ago

Interesting, we should be trapping sigterm anyway ... so maybe more investigation is needed.

Thanks! I tested your changed version of dscontainer and the container now stops gracefully.

Metadata Update from @mreynolds:
- Issue priority set to: normal
- Issue set to the milestone: 1.4.2

3 years ago

Metadata Update from @firstyear:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

3 years ago

I'll be backporting these and releasing updated containers related soon.

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/4133

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

3 years ago

Login to comment on this ticket.

Metadata