Implement clean instance terminate when using systemd by benhillis · Pull Request #13552 · microsoft/WSL
Conversation
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements clean instance termination when using systemd by refactoring the termination logic to allow systemd proper time to shut down before falling back to a hard reboot.
- Extracts common termination logic into a new
InitTerminateInstanceInternalfunction - Changes systemd command from
systemctl reboottosystemctl poweroff - Adds timeout waiting for systemd to complete shutdown before forcing reboot
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