From e7a3fd55acfdaf70db040e36c7a63762d2822a4a Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 1 Jun 2017 13:14:10 -0300 Subject: [PATCH] Use a pre-existing target for systemd services Providing mail.target is really confusing and poor UX: * When a user enables a unit, it's not truly enabled until they ALSO enable mail.target. This is very counter-intuitive. * `mail.target` provides no extra value in itself, nor is it anything "standard". * Any user wanting this specific target can still continue using it just dropping in a `mail.target` file. Signed-off-by: Hugo Osvaldo Barrera Signed-off-by: Nicolas Sebrecht --- contrib/systemd/README.md | 4 ---- contrib/systemd/mail.target | 5 ----- contrib/systemd/offlineimap-oneshot@.service | 2 +- contrib/systemd/offlineimap.service | 2 +- contrib/systemd/offlineimap.timer | 2 +- contrib/systemd/offlineimap@.service | 2 +- contrib/systemd/offlineimap@.timer | 2 +- 7 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 contrib/systemd/mail.target diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index b332b2f..566e79b 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -21,10 +21,6 @@ start offlineimap.service` or by enabling the timer unit using `systemctl --user enable offlineimap.timer`. Additionally, specific accounts may be triggered by using `offlineimap@myaccount.timer` or `offlineimap@myaccount.service`. -These unit files are installed as being enabled via a `mail.target` unit which -is intended to be a catch-all for mail-related unit files. A simple -`mail.target` file is also provided. - If the defaults provided by these units doesn't suit your setup, any of the values may be overridden by using `systemctl --user edit offlineimap.service`. This'll prevent having to copy-and-edit the original file. diff --git a/contrib/systemd/mail.target b/contrib/systemd/mail.target deleted file mode 100644 index 5a408b2..0000000 --- a/contrib/systemd/mail.target +++ /dev/null @@ -1,5 +0,0 @@ -[Unit] -Description=Mail Target - -[Install] -WantedBy=default.target diff --git a/contrib/systemd/offlineimap-oneshot@.service b/contrib/systemd/offlineimap-oneshot@.service index 7634662..4da1487 100644 --- a/contrib/systemd/offlineimap-oneshot@.service +++ b/contrib/systemd/offlineimap-oneshot@.service @@ -9,4 +9,4 @@ ExecStart=/usr/bin/offlineimap -o -a %i -u basic TimeoutStopSec=120 [Install] -WantedBy=mail.target +WantedBy=default.target diff --git a/contrib/systemd/offlineimap.service b/contrib/systemd/offlineimap.service index bce3152..7ef1363 100644 --- a/contrib/systemd/offlineimap.service +++ b/contrib/systemd/offlineimap.service @@ -8,4 +8,4 @@ Restart=on-failure RestartSec=60 [Install] -WantedBy=mail.target +WantedBy=default.target diff --git a/contrib/systemd/offlineimap.timer b/contrib/systemd/offlineimap.timer index 1ca906f..f71665f 100644 --- a/contrib/systemd/offlineimap.timer +++ b/contrib/systemd/offlineimap.timer @@ -7,4 +7,4 @@ OnUnitInactiveSec=15m Unit=offlineimap-oneshot.service [Install] -WantedBy=mail.target +WantedBy=default.target diff --git a/contrib/systemd/offlineimap@.service b/contrib/systemd/offlineimap@.service index 9a003a5..781897d 100644 --- a/contrib/systemd/offlineimap@.service +++ b/contrib/systemd/offlineimap@.service @@ -8,4 +8,4 @@ Restart=on-failure RestartSec=60 [Install] -WantedBy=mail.target +WantedBy=default.target diff --git a/contrib/systemd/offlineimap@.timer b/contrib/systemd/offlineimap@.timer index c8ac13d..f15599e 100644 --- a/contrib/systemd/offlineimap@.timer +++ b/contrib/systemd/offlineimap@.timer @@ -7,4 +7,4 @@ OnUnitInactiveSec=15m Unit=offlineimap-oneshot@%i.service [Install] -WantedBy=mail.target +WantedBy=default.target