summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-06-28 10:46:47 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-06-28 10:46:47 +0200
commitcb4297505cbc17a8daea908188decfc2a1f062e8 (patch)
tree9f50154b4b33011dcc358657cc3068499decf69e
parent3f1b105ae1a290db79da61f47c277a224b32031d (diff)
parent125bfce64b20e593ea62aacad959faea32a23ad1 (diff)
downloadmullvadvpn-cb4297505cbc17a8daea908188decfc2a1f062e8.tar.xz
mullvadvpn-cb4297505cbc17a8daea908188decfc2a1f062e8.zip
Merge branch 'switch-to-preshutdown'
-rw-r--r--mullvad-daemon/src/system_service.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/mullvad-daemon/src/system_service.rs b/mullvad-daemon/src/system_service.rs
index 3de37a2f7b..cb2793115c 100644
--- a/mullvad-daemon/src/system_service.rs
+++ b/mullvad-daemon/src/system_service.rs
@@ -53,7 +53,7 @@ fn run_service(_arguments: Vec<OsString>) -> Result<()> {
// control manager. Always return NO_ERROR even if not implemented.
ServiceControl::Interrogate => ServiceControlHandlerResult::NoError,
- ServiceControl::Shutdown | ServiceControl::Stop => {
+ ServiceControl::Stop | ServiceControl::Preshutdown => {
event_tx.send(control_event).unwrap();
ServiceControlHandlerResult::NoError
}
@@ -96,7 +96,7 @@ fn start_event_monitor(
thread::spawn(move || {
for event in event_rx {
match event {
- ServiceControl::Stop | ServiceControl::Shutdown => {
+ ServiceControl::Stop | ServiceControl::Preshutdown => {
persistent_service_status
.set_pending_stop(Duration::from_secs(3))
.unwrap();
@@ -201,8 +201,8 @@ fn accepted_controls_by_state(state: ServiceState) -> ServiceControlAccept {
ServiceState::StartPending | ServiceState::PausePending | ServiceState::ContinuePending => {
ServiceControlAccept::empty()
}
- ServiceState::Running => ServiceControlAccept::STOP | ServiceControlAccept::SHUTDOWN,
- ServiceState::Paused => ServiceControlAccept::STOP | ServiceControlAccept::SHUTDOWN,
+ ServiceState::Running => ServiceControlAccept::STOP | ServiceControlAccept::PRESHUTDOWN,
+ ServiceState::Paused => ServiceControlAccept::STOP | ServiceControlAccept::PRESHUTDOWN,
ServiceState::StopPending | ServiceState::Stopped => ServiceControlAccept::empty(),
}
}