From d0154ca5c3c53455b7e2b0e6f2379bcab76805b5 Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Thu, 14 Jan 2016 19:53:12 -0800 Subject: [PATCH] remove mailsync boot delay This isn't needed when we can just specify that the service runs after network.target. --- README.md | 5 ++--- group_vars/all | 1 - roles/mail/files/mailsync.service | 1 + roles/mail/templates/mailsync.timer.j2 | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2095ad1..4ac9c39 100644 --- a/README.md +++ b/README.md @@ -132,9 +132,8 @@ connectivity using NetworkMananger. `mailsync` may be called directly by the user, ie by configuring a hotkey in Mutt. A [systemd timer][15] is also included to periodically call `mailsync`. The -timer includes a 2 minute boot delay (to allow time for network connectivity to -be established, configurable through the `mail.sync_boot_delay` variable) and -syncs every 10 minutes (configurable through the `mail.sync_time` variable). +timer is set to sync every 10 minutes (configurable through the +`mail.sync_time` variable). The timer is not started or enabled by default. Instead, a NetworkManager dispatcher is installed, which activates the timer whenever a connection is diff --git a/group_vars/all b/group_vars/all index fdb38ab..3ea35cf 100644 --- a/group_vars/all +++ b/group_vars/all @@ -26,7 +26,6 @@ ssh: mail: sync_tool: isync sync_time: 10min - sync_boot_delay: 2min sync_on: trusted network: diff --git a/roles/mail/files/mailsync.service b/roles/mail/files/mailsync.service index cae9fbb..57b3673 100644 --- a/roles/mail/files/mailsync.service +++ b/roles/mail/files/mailsync.service @@ -1,5 +1,6 @@ [Unit] Description=Mailbox synchronization service for user %I +After=network.target [Service] Type=oneshot diff --git a/roles/mail/templates/mailsync.timer.j2 b/roles/mail/templates/mailsync.timer.j2 index ccf5d60..93e8e1f 100644 --- a/roles/mail/templates/mailsync.timer.j2 +++ b/roles/mail/templates/mailsync.timer.j2 @@ -3,7 +3,6 @@ Description=Mailbox synchronization timer [Timer] -OnBootSec={{ mail.sync_boot_delay }} OnUnitActiveSec={{ mail.sync_time }} Unit=mailsync@%i.service