Re: Why I get a error each time cron starts
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, Sep 18, 2003 at 01:53:20PM -0500, John Goerzen wrote:
> The error you are getting indicates that OfflineIMAP is already running.
> The problem, I think, is that you are using both cron and the autorefresh in
> the config file. You have to pick only one method.
You explained why he's getting an error, but you didn't answer his
question:
> On Tue, Sep 02, 2003 at 04:58:05PM +0000, Rolf Eric Anithason wrote:
> > sometimes
> > OfflineIMAP crashes, due to big emails because the IMAP server it syncs
> > with gives you easily time out, or some problem with UID... so then it
> > is important for me to have something that can activate it again so you
> > don't miss something important coming in.
Rolf (like me) thinks that when he starts offlineimap with
autorefresh, it ought to keep polling for mail until he tells it to
stop. If there's some minor error, for example if the connection is
lost because the imap server got rebooted, it should reconnect, not
silently crash.
This issue has come up before, and John defended the current behavior
as the right thing to do. I don't remember the reasons, but I
remember that I wasn't convinced. Offlineimap plays the same role as
an incoming SMTP server; the only difference is that it's a pull
instead of a push. Apparently, if John wrote an SMTP server, he would
write it so that it accepted incoming mail until the first time a
sending client timed out during the connection, at which point it
would exit, writing a backtrace to the syslog. Any subsequent
connection attempts would be refused, and the user would have no idea
anything was wrong until the next time he scanned the logs.
John, I assume that you wouldn't actually write an SMTP server like
that, so what part of the analogy do you take issue with?
Anyway, there are ways to work around this quirk. One is to run
offlineimap frequently from crontab, without autorefresh. Another,
which I use, is to run it with autorefresh from a script like this:
#!/bin/csh
while ( 1 )
offlineimap |& tee -a ~/offlineimaplog
echo "offlineimap exited; waiting 10 minutes before respawning." \
|& tee -a ~/offlineimaplog
sleep 600
end
The sleep is so that I don't continuously hammer the server with
connection requests if it's not accepting connections for some reason.
-Aaron
|
|