diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md new file mode 100644 index 0000000..5ae31e4 --- /dev/null +++ b/contrib/systemd/README.md @@ -0,0 +1,16 @@ +Systemd units +============= + +These unit files are meant to be used in the user session. You may drop them +into `${XDG_DATA_HOME}/systemd/user` followed by `systemctl --user +daemon-reload` to have systemd aware of the unit files. + +These files are meant to be triggered either manually using `systemctl --user +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. diff --git a/contrib/systemd/mail.target b/contrib/systemd/mail.target new file mode 100644 index 0000000..5a408b2 --- /dev/null +++ b/contrib/systemd/mail.target @@ -0,0 +1,5 @@ +[Unit] +Description=Mail Target + +[Install] +WantedBy=default.target diff --git a/contrib/systemd/offlineimap.service b/contrib/systemd/offlineimap.service index c76a5f9..f29f93c 100644 --- a/contrib/systemd/offlineimap.service +++ b/contrib/systemd/offlineimap.service @@ -1,11 +1,9 @@ [Unit] Description=Offlineimap Service -After=xdg-env.service -Requires=xdg-env.service [Service] Type=oneshot -ExecStart=/usr/bin/offlineimap -o -c ${XDG_CONFIG_HOME}/offlineimap/offlineimaprc +ExecStart=/usr/bin/offlineimap -o [Install] WantedBy=mail.target diff --git a/contrib/systemd/offlineimap@.service b/contrib/systemd/offlineimap@.service index fa1eea0..7be965a 100644 --- a/contrib/systemd/offlineimap@.service +++ b/contrib/systemd/offlineimap@.service @@ -1,11 +1,9 @@ [Unit] Description=Offlineimap Service for account %i -After=xdg-env.service -Requires=xdg-env.service [Service] Type=oneshot -ExecStart=/usr/bin/offlineimap -o -a %i -c ${XDG_CONFIG_HOME}/offlineimap/offlineimaprc +ExecStart=/usr/bin/offlineimap -o -a %i [Install] WantedBy=mail.target