container: Stop gracefully on podman stop
Containers used `sleep infinity` as PID 1, which never reacts to SIGTERM: the kernel does not apply default signal dispositions to PID 1, and sleep has no SIGTERM handler, so every `podman stop` silently ignored the signal, waited out the full 10-second grace period, and fell back to SIGKILL. PID 1 now traps TERM and INT itself and exits on request, so one-off manual stops of a still-running agent container end immediately instead of after the kill timeout. The PID 1 command is baked in at create time, so containers predating this change are detected and recreated automatically on the next run.
This commit is contained in:
parent
43dc757b92
commit
fcbfa32545
2 changed files with 53 additions and 1 deletions
22
CHANGELOG.md
22
CHANGELOG.md
|
|
@ -1,5 +1,27 @@
|
|||
# Release notes
|
||||
|
||||
## 1.0.1 — 2026-10-29
|
||||
|
||||
`podman stop` now stops a running agent container immediately instead of
|
||||
after a 10-second SIGTERM timeout followed by SIGKILL.
|
||||
|
||||
### Why
|
||||
|
||||
Containers used `sleep infinity` as PID 1. The kernel does not apply
|
||||
default signal dispositions to PID 1, and `sleep` has no SIGTERM handler,
|
||||
so the stop signal was silently ignored and every stop fell through to
|
||||
SIGKILL. PID 1 now traps TERM (and INT) itself and exits on request:
|
||||
|
||||
```sh
|
||||
trap "exit 0" TERM INT; sleep infinity & wait
|
||||
```
|
||||
|
||||
### Upgrading
|
||||
|
||||
The PID 1 command is baked in when a container is created, so existing
|
||||
containers are detected on the next run and recreated automatically.
|
||||
Nothing in the container home is touched.
|
||||
|
||||
## 1.0.0 — 2026-10-29
|
||||
|
||||
Containers now run with rootless Podman instead of Docker.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue