Fix propagation of "is shutdown user-initiated?" status#10291
Fix propagation of "is shutdown user-initiated?" status#10291MarkusPettersson98 wants to merge 2 commits intomainfrom
Conversation
2c93d37 to
a0e272b
Compare
a0e272b to
4fbc350
Compare
hulthe
left a comment
There was a problem hiding this comment.
@hulthe reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on hulthe).
mullvad-daemon/src/shutdown.rs line 50 at r1 (raw file):
#[cfg(target_os = "macos")] pub fn is_shutdown_user_initiated() -> bool { false
TODO:
There was a problem hiding this comment.
@hulthe made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on MarkusPettersson98).
mullvad-daemon/src/main.rs line 207 at r3 (raw file):
#[cfg(any(target_os = "linux", target_os = "macos"))] mullvad_daemon::shutdown::set_shutdown_signal_handler(move || { shutdown_handle.shutdown(!mullvad_daemon::shutdown::is_shutdown_user_initiated())
Did some testing and some thinking.
Since we're removing two ! operators on linux, the behavior will stay the same, except in the error case, i.e. where the user isn't running systemd.
On macOS, we currently remove a single !, inverting the behavior. This means the daemon will always block if it's stopped. On main, it never blocks when daemon is shut down, meaning that macOS network traffic can leak on reboot.
This change is