Complete.Org: Mailing Lists: Archives: offlineimap: April 2004:
Re: Connection problems: fix with wrapper
Home

Re: Connection problems: fix with wrapper

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jared Rhine <jared@xxxxxxxxxxx>
Cc: offlineimap@xxxxxxxxxxxx
Subject: Re: Connection problems: fix with wrapper
From: "Matthew P. Barnson" <matthew@xxxxxxxxxxx>
Date: Thu, 22 Apr 2004 12:01:33 -0600

The problem of daemons dying has been managed several ways (here are a
few examples):
1.  Use of "init".  This works well for TTY's and essential basic system
services.  Using it for a userspace tool like offlineimap is probably
overkill.  But init makes sure that any process that dies is respawned
immediately.
2.  Fetchmail spits out a log message to the console or syslog if it dies
off.  
3.  Apache 1.X spawns a single master fork that watches all the children.
This code is exceptionally reliable, handling little else but counting the
number of pages children have served, killing them off at appropriate
times, and starting new forks to handle increased load.
4.  A wrapper program either in the native language, or another language,
as mentioned.  I put up a little generic wrapper here; there are myriad
approaches.

My personal fave is to keep offlineimap in pure Python, and wrap
mail handling with a watcher process, like Apache.  That way you wouldn't
introduce any dependencies.

And for the curious, YES, I am working on this right now :)  I'm not a
Python master by any means, but there's also the Maildir bug that I want to
automatically detect when running under Cygwin, so it can spit out a more
informative error message if it finds it's trying to do Maildir on a mount
that's not managed.

The next stop in my personal offlineimap saga: a simple GUI to set up
accounts... but that's not for a while :)

-- 
Matthew P. Barnson
- - - -
Thought for the moment:
Rules:
        (1)  The boss is always right.
        (2)  When the boss is wrong, refer to rule 1.


[Prev in Thread] Current Thread [Next in Thread]