diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index 1d84750..9377757 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -3,8 +3,8 @@ layout: page title: Integrating OfflineIMAP into systemd author: Ben Boeckel date: 2015-03-22 -contributors: Abdo Roig-Maranges -updated: 2015-03-25 +contributors: Abdo Roig-Maranges, benutzer193 +updated: 2017-06-01 --- @@ -25,25 +25,4 @@ 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. -## Signals - -Systemd supports a watchdog (via the WatchdogSec service file option) which -will send the program a SIGABRT when the timer expires. - -Offlineimap handles it in the same manner as SIGUSR2, so that the current -synchronisation is completed before the program exits safely. - -This makes offlineimap more flexible and robust for persistent setups that make -use of holdconnectionopen and autorefresh options. - -For example, it may be useful in assisting with the occasional situation where -offlineimap may not return successfully after a suspend and resume. - -To make use of this, users could add the following to the [Service] section of -their corresponding systemd offlineimap-oneshot service file (restart every 5 minutes): - -``` conf -Restart=on-watchdog -WatchdogSec=300 -``` diff --git a/contrib/systemd/offlineimap-oneshot.service b/contrib/systemd/offlineimap-oneshot.service index 97cfafb..901570d 100644 --- a/contrib/systemd/offlineimap-oneshot.service +++ b/contrib/systemd/offlineimap-oneshot.service @@ -5,10 +5,10 @@ Documentation=man:offlineimap(1) [Service] Type=oneshot ExecStart=/usr/bin/offlineimap -o -u syslog -# Give 12 seconds for offlineimap to gracefully stop before hard killing it. -TimeoutStopSec=12 -#Restart=on-watchdog -#WatchdogSec=300 +# Give 120 seconds for offlineimap to gracefully stop before hard killing it. +TimeoutStopSec=120 +Restart=on-failure +RestartSec=60 [Install] WantedBy=mail.target diff --git a/contrib/systemd/offlineimap-oneshot@.service b/contrib/systemd/offlineimap-oneshot@.service index c096282..35afa07 100644 --- a/contrib/systemd/offlineimap-oneshot@.service +++ b/contrib/systemd/offlineimap-oneshot@.service @@ -5,8 +5,11 @@ Documentation=man:offlineimap(1) [Service] Type=oneshot ExecStart=/usr/bin/offlineimap -o -a %i -u syslog -#Restart=on-watchdog -#WatchdogSec=300 +# Give 120 seconds for offlineimap to gracefully stop before hard killing it. +TimeoutStopSec=120 +Restart=on-failure +RestartSec=60 + [Install] WantedBy=mail.target diff --git a/contrib/systemd/offlineimap.service b/contrib/systemd/offlineimap.service index a574c42..13954e7 100644 --- a/contrib/systemd/offlineimap.service +++ b/contrib/systemd/offlineimap.service @@ -4,6 +4,8 @@ Documentation=man:offlineimap(1) [Service] ExecStart=/usr/bin/offlineimap -u syslog +Restart=on-failure +RestartSec=60 [Install] WantedBy=mail.target diff --git a/contrib/systemd/offlineimap@.service b/contrib/systemd/offlineimap@.service index ad3ec5a..66f62ac 100644 --- a/contrib/systemd/offlineimap@.service +++ b/contrib/systemd/offlineimap@.service @@ -4,6 +4,8 @@ Documentation=man:offlineimap(1) [Service] ExecStart=/usr/bin/offlineimap -a %i -u syslog +Restart=on-failure +RestartSec=60 [Install] WantedBy=mail.target