Give Lima's autostart graceful shutdown time to finish - #184
Closed
samestep wants to merge 1 commit into
Closed
Conversation
On SIGTERM, Lima's hostagent gracefully powers off the guest and waits up
to 30s for it to halt (pkg/driver/vz/vz_driver_darwin.go). But its autostart
plists set no ExitTimeOut, so launchd's 5s default SIGKILLs the hostagent
when the Mac shuts down --- force-killing the guest mid-flush, which corrupts
Git repos and drops recent writes.
Patch the embedded LaunchAgent/LaunchDaemon plist templates to set
ExitTimeOut=60 (>= the driver's 30s stop timeout) so the graceful stop can
complete during host shutdown.
To try it out:
# 1. Rebuild so the new limactl is on PATH:
home-manager switch --flake ~/github/samestep/env#samueles
# 2. Regenerate the installed plist (it does not update itself):
limactl autostart disable sandbox-arm64 && limactl autostart enable sandbox-arm64
# 3. Confirm it took (expect: exit timeout = 60):
launchctl print gui/$(id -u)/io.lima-vm.autostart.sandbox-arm64 | grep -i 'exit timeout'
# 4. After the next "Shut Down...", boot back up and, inside the guest, look
# for a full shutdown sequence (Stopping.../Unmounted/Power-Off) that was
# previously absent --- its span will often exceed the old 5s window:
journalctl -b -1 -o short-precise | tail -30
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Superceded by #193. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.