Init: Graceful termination and signal propagation #8
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?
The
chvm-initbinary (pid 1) handles signals insignal.rs. The implementation needs to ensure atomic cleanup of mounts and termination of child processes.Proposed Changes:
Changes implemented:
Re-entrancy guard on
poweroffAdded AtomicBool flag. The first thread to call poweroff() claims it. Any subsequent callers loop on pause() forever, preventing concurrent shutdown races on unmounts and the reboot syscall.
Child process termination before unmounting
Added
terminate_all_children()which runs before sync() and unmounts:This ensures all file handles on mounts are released before umount runs