offlineimap daemon (auto-kill and restart)

Thomas Kahle tomka at gentoo.org
Mon Feb 14 06:18:22 GMT 2011


Hi!

On 10:23 Mon 14 Feb     , Ng Oon-Ee wrote:
> Hi all,
> 
> I've been thinking about an idea for 'offlineimapd' or something
> similar, but am not sure if the functionality is planned for offlineimap
> itself.
> 
> Firstly, I'm on 64-bit Arch Linux, offlineimap is at 6.3.1 currently.
> 
> Since the 6-series release back-in-the-day, offlineimap has given random
> hangs with gmail on spotty connections. This probably has more to do
> with gmail's sucky IMAP implementation than any inherent offlineimap
> fault (since the same does not occur on another gmail account I sync
> with), but the net result is that I have conky display the
> last-synced-time for offlineimap on my desktop, and when I realize its
> been a long time ago (maybe 20 minutes or so) I restart offlineimap.
> 
> I thought it'd be useful to have a simple script (offlineimapd for want
> of a better name) which monitors the main offlineimap process to restart
> it if it hangs. How I've done it manually is to have a hook activate
> after every successful sync.
> 
> Its not something very complicated, I could probably whip up a simple
> bash script which handles that. Would it be a good idea, though? Or
> would this sort of logic be best implemented within offlineimap (which
> is already multi-threaded, after all).

I have written such a script as part of my mail setup [1], but it does
not kill hung offlineimap instances yet.  What my script does is to run
offlineimap with different parameters depending on the last running
time.  The goal is to do a quick sync with only INBOXes every 3 minutes,
and a heavy sync with all the rest only every thirty minutes.  The
script is not a daemon itself, it is periodically called by cron.  Would
be nice to optimize it further.  Comments appreciated.

Cheers,
Thomas

Footnotes: 
[1]  http://dev.gentoo.org/~tomka/mail.html

-- 
Thomas Kahle
http://dev.gentoo.org/~tomka/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 316 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110214/b702ac6b/attachment-0001.sig>


More information about the OfflineIMAP-project mailing list