diff options
| author | Odd Stranne <odd@mullvad.net> | 2019-11-19 12:00:41 +0100 |
|---|---|---|
| committer | Odd Stranne <odd@mullvad.net> | 2019-11-19 12:00:41 +0100 |
| commit | 429e3dbfadceabc0756ba76fd8c760e8fba5d70d (patch) | |
| tree | efc26442c42723b270218e199ef24e68459ef3c5 | |
| parent | ed7da0db3030e76167a80119eddf0c5eabb87005 (diff) | |
| parent | 8a59bcdac1f3ed62e93fa0a1031506bb1e966fe9 (diff) | |
| download | mullvadvpn-429e3dbfadceabc0756ba76fd8c760e8fba5d70d.tar.xz mullvadvpn-429e3dbfadceabc0756ba76fd8c760e8fba5d70d.zip | |
Merge branch 'win-adjust-service-settings'
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | Cargo.lock | 16 | ||||
| -rw-r--r-- | mullvad-daemon/Cargo.toml | 2 | ||||
| -rw-r--r-- | mullvad-daemon/src/system_service.rs | 24 |
4 files changed, 27 insertions, 17 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 485bd41e9a..fecb1a7d92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ Line wrap the file at 100 chars. Th - Use a larger icon in notifications on Windows 10. - Only update DNS settings if updating would change the effective settings. This is a work-around to avoid invoking `netsh` unnecessarily and getting stuck in associated hangs. +- Don't restart the service immediately if it aborts several times in a row. Leave a window of ten + minutes to allow for addressing the issue. ### Fixed #### Windows diff --git a/Cargo.lock b/Cargo.lock index 3d7d25bb2b..d24b4e225a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1263,7 +1263,7 @@ dependencies = [ "tokio-timer 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "windows-service 0.2.0 (git+https://github.com/mullvad/windows-service-rs.git?rev=a5eb1dcbbcee4ec2c6479256305c64b25640c799)", + "windows-service 0.2.0 (git+https://github.com/mullvad/windows-service-rs.git?rev=f518cd53a842985eea08c236a6ebd072ee5d88ac)", "winres 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2989,11 +2989,6 @@ dependencies = [ [[package]] name = "widestring" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "widestring" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3076,11 +3071,11 @@ dependencies = [ [[package]] name = "windows-service" version = "0.2.0" -source = "git+https://github.com/mullvad/windows-service-rs.git?rev=a5eb1dcbbcee4ec2c6479256305c64b25640c799#a5eb1dcbbcee4ec2c6479256305c64b25640c799" +source = "git+https://github.com/mullvad/windows-service-rs.git?rev=f518cd53a842985eea08c236a6ebd072ee5d88ac#f518cd53a842985eea08c236a6ebd072ee5d88ac" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "err-derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "widestring 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "err-derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "widestring 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (git+https://github.com/mullvad/winapi-rs.git?rev=4bcf5cab87124bbeef8c1a445137494d874f8082)", ] @@ -3421,7 +3416,6 @@ dependencies = [ "checksum want 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a05d9d966753fa4b5c8db73fcab5eed4549cfe0e1e4e66911e5564a0085c35d1" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" "checksum which 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5475d47078209a02e60614f7ba5e645ef3ed60f771920ac1906d7c1cc65024c8" -"checksum widestring 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a212922ea58fbf5044f83663aa4fc6281ff890f1fd7546c0c3f52f5290831781" "checksum widestring 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "effc0e4ff8085673ea7b9b2e3c73f6bd4d118810c9009ed8f1e16bd96c331db6" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.7 (git+https://github.com/mullvad/winapi-rs.git?rev=4bcf5cab87124bbeef8c1a445137494d874f8082)" = "<none>" @@ -3434,7 +3428,7 @@ dependencies = [ "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" "checksum winconsole 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3ef84b96d10db72dd980056666d7f1e7663ce93d82fa33b63e71c966f4cf5032" -"checksum windows-service 0.2.0 (git+https://github.com/mullvad/windows-service-rs.git?rev=a5eb1dcbbcee4ec2c6479256305c64b25640c799)" = "<none>" +"checksum windows-service 0.2.0 (git+https://github.com/mullvad/windows-service-rs.git?rev=f518cd53a842985eea08c236a6ebd072ee5d88ac)" = "<none>" "checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" "checksum winres 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ff4fb510bbfe5b8992ff15f77a2e6fe6cf062878f0eda00c0f44963a807ca5dc" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/mullvad-daemon/Cargo.toml b/mullvad-daemon/Cargo.toml index bb7ada7094..7bc8ce4564 100644 --- a/mullvad-daemon/Cargo.toml +++ b/mullvad-daemon/Cargo.toml @@ -55,7 +55,7 @@ simple-signal = "1.1" [target.'cfg(windows)'.dependencies] ctrlc = "3.0" -windows-service = { git = "https://github.com/mullvad/windows-service-rs.git", rev = "a5eb1dcbbcee4ec2c6479256305c64b25640c799" } +windows-service = { git = "https://github.com/mullvad/windows-service-rs.git", rev = "f518cd53a842985eea08c236a6ebd072ee5d88ac" } winapi = "0.3" [target.'cfg(windows)'.build-dependencies] diff --git a/mullvad-daemon/src/system_service.rs b/mullvad-daemon/src/system_service.rs index ea273ee395..607f4b8162 100644 --- a/mullvad-daemon/src/system_service.rs +++ b/mullvad-daemon/src/system_service.rs @@ -257,13 +257,27 @@ pub fn install_service() -> Result<(), InstallError> { .or(service_manager.open_service(SERVICE_NAME, service_access)) .map_err(InstallError::CreateService)?; - let recovery_actions = vec![ServiceAction { - action_type: ServiceActionType::Restart, - delay: Duration::from_secs(3), - }]; + const TEN_MINUTES_AS_SECS: u64 = 60 * 10; + + let recovery_actions = vec![ + ServiceAction { + action_type: ServiceActionType::Restart, + delay: Duration::from_secs(3), + }, + ServiceAction { + action_type: ServiceActionType::Restart, + delay: Duration::from_secs(30), + }, + ServiceAction { + action_type: ServiceActionType::Restart, + delay: Duration::from_secs(TEN_MINUTES_AS_SECS), + }, + ]; + + const FIFTEEN_MINUTES_AS_SECS: u64 = 60 * 15; let failure_actions = ServiceFailureActions { - reset_period: ServiceFailureResetPeriod::After(Duration::from_secs(2)), + reset_period: ServiceFailureResetPeriod::After(Duration::from_secs(FIFTEEN_MINUTES_AS_SECS)), reboot_msg: None, command: None, actions: Some(recovery_actions), |
