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 <hugo@barrera.io>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Hugo Osvaldo Barrera 2017-06-01 13:14:10 -03:00 committed by Nicolas Sebrecht
parent 87d92badfc
commit e7a3fd55ac
7 changed files with 5 additions and 14 deletions

View File

@ -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 enable offlineimap.timer`. Additionally, specific accounts may be triggered by
using `offlineimap@myaccount.timer` or `offlineimap@myaccount.service`. 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 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`. values may be overridden by using `systemctl --user edit offlineimap.service`.
This'll prevent having to copy-and-edit the original file. This'll prevent having to copy-and-edit the original file.

View File

@ -1,5 +0,0 @@
[Unit]
Description=Mail Target
[Install]
WantedBy=default.target

View File

@ -9,4 +9,4 @@ ExecStart=/usr/bin/offlineimap -o -a %i -u basic
TimeoutStopSec=120 TimeoutStopSec=120
[Install] [Install]
WantedBy=mail.target WantedBy=default.target

View File

@ -8,4 +8,4 @@ Restart=on-failure
RestartSec=60 RestartSec=60
[Install] [Install]
WantedBy=mail.target WantedBy=default.target

View File

@ -7,4 +7,4 @@ OnUnitInactiveSec=15m
Unit=offlineimap-oneshot.service Unit=offlineimap-oneshot.service
[Install] [Install]
WantedBy=mail.target WantedBy=default.target

View File

@ -8,4 +8,4 @@ Restart=on-failure
RestartSec=60 RestartSec=60
[Install] [Install]
WantedBy=mail.target WantedBy=default.target

View File

@ -7,4 +7,4 @@ OnUnitInactiveSec=15m
Unit=offlineimap-oneshot@%i.service Unit=offlineimap-oneshot@%i.service
[Install] [Install]
WantedBy=mail.target WantedBy=default.target