mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-15 21:02:07 +00:00
[PR #70] [MERGED] fix(lxc): force-stop PVE CTs that ignore the shutdown signal #70
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/70
Author: @JBailes
Created: 6/7/2026
Status: ✅ Merged
Merged: 6/7/2026
Merged by: @JBailes
Base:
main← Head:fix/pve-graceful-stop📝 Commits (1)
b54364efix(lxc): force-stop PVE CTs that ignore the shutdown signal📊 Changes
1 file changed (+18 additions, -6 deletions)
View changed files
📝
internal/lxc/manager.go(+18 -6)📄 Description
Fixes the "container cannot shut down gracefully" report in #53.
docker stopon a Proxmox CT ranpct shutdown <vmid> --timeout N.pct shutdowndefaults toforceStop=0, which (perPVE::LXC::vm_stop) runslxc-stop --nokill— it sends the shutdown signal, waits, and then gives up without killing. A container whose init ignores that signal (Wolf does) is never stopped: the grace period expires,lxc-stopfails withexit code 1, but the surrounding task can still finishTASK OK, and the CT keeps running. The daemon only ran itspct stopfallback on a non-zero exit code, so it returned success while the CT was still up — leaving the user topct enterandkill 1by hand.Two changes:
--forceStop 1so PVE escalates to a hard stop once the timeout elapses (vm_stopthen runslxc-stopwithout--nokill, i.e. kill-after-timeout). This matchesdocker stopsemantics: grace period, then SIGKILL.pct status, not the exit code, since the shutdown task can report success while the CT is still running. Anything left getspct stop.Reported on PVE 9.2;
forceStopdefault confirmed0inPVE/API2/LXC/Status.pmand the--nokillpath inPVE::LXC::vm_stop. Build and unit tests pass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.