diff options
| author | Odd Stranne <odd@mullvad.net> | 2019-11-15 12:11:06 +0100 |
|---|---|---|
| committer | Odd Stranne <odd@mullvad.net> | 2019-11-19 12:00:17 +0100 |
| commit | 14524c92b1212d6bfa6489fa2f2203cf2727a6db (patch) | |
| tree | 439af1e765444b29d71e41d7b89530af9126b8d1 | |
| parent | d21741819a50b18ede393a8526c15d457cb369a7 (diff) | |
| download | mullvadvpn-14524c92b1212d6bfa6489fa2f2203cf2727a6db.tar.xz mullvadvpn-14524c92b1212d6bfa6489fa2f2203cf2727a6db.zip | |
Change service recovery settings
| -rw-r--r-- | mullvad-daemon/src/system_service.rs | 24 |
1 files changed, 19 insertions, 5 deletions
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), |
