containers / containers/crun

krun: Containers do not shut down cleanly

Open
#2,158 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
4.1k
Forks
444
Avg merge
2d 40m
Merged PRs (30d)
47

Description

When running with krun, Podman containers appear to never receive any kind of shutdown signal. This results in containers always being hard stopped with a kill signal, which can corrupt data that the container is interacting with. Running any container in a Quadlet makes this apparent, stopping the unit results in:
```
Stopping [container].service ...
...
level=warning msg="StopSignal SIGTERM failed to stop container [container] in 10 seconds, resorting to SIGKILL"
...
[container].service: Failed with result 'exit-code'.
```

Increasing the stop signal timeout on the systemd unit does nothing, increasing the Podman timeout using something like `PodmanArgs=--timeout=30s` just results in nothing happening for 30s instead of 10s before the container is killed. There is no log output of any kind to suggest that the container is doing anything to shut down cleanly at any point.

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Start by reproducing the shutdown failure with krun through a Podman Quadlet, then inspect the stop-signal behavior and compare the result with the expected SIGTERM path. Done means the container receives a shutdown signal and exits cleanly without falling back to SIGKILL.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
infrastructure, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.