Complete.Org: Mailing Lists: Archives: offlineimap: December 2002:
Server-style restart
Home

Server-style restart

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: offlineimap@xxxxxxxxxxxx
Subject: Server-style restart
From: Jared Rhine <jared@xxxxxxxxxxx>
Date: Mon, 09 Dec 2002 01:48:54 -0800

Just thought I'd follow up to a previous posting regarding ways to
"daemonize" offlineimap fully.  (That is, restart when it dies, keep
logs, only run one copy at a time, etc).  No queries or problems
below, just a report of success.

DJB's daemontools's seemed to fit the bill, so I set up offlineimap as
a daemontools service.  It's been working great in service for a few
weeks now.  Restarts are fine, logging is fine.  Daemontools runs as
root, but properly runs offlineimap as me.

If connectivity is poor (the problem that started me looking for a
daemon-style solution) to the point where 'no route to host' is
returned immediately upon opening a connection, daemontools will try
to start the program every 5 seconds, which isn't trivial, CPU-wise.

A couple of times, it appeared that a running offlineimap was stalled,
in that I had new remote mail, but nothing was getting pulled locally.
After giving it sufficient time to try to wake up itself, I restored
service by telling daemontools to stop and start again.  I could
probably turn on imap debugging now and try to capture some output the
next time this problem occurs (if it does).  DAMN, that puts out a lot
of output.  Good, that's what debugging's for.  I'll let daemontools
keep about 20Mb in the rotation; hopefully that'll be enough.

So daemontools is a viable option for this issue.  Probably a good
option if you're already a daemontools user.  If you're not already a
user, I'd encourage you to try it, but beware that it'll take you a
while to wrap your head around it, if only because of its utter
simplicity.  Like most DJB software, it does exactly what it is
supposed to in an extremely robust way.

My service run script is:

-- begin --

#!/bin/sh
exec 2>&1
exec setuidgid jared envdir ./env /usr/bin/offlineimap

-- end --

and my log run script is:

-- begin --

#!/bin/sh
exec setuidgid jared multilog t s200000 n25 ./logs

-- end --

-- jared@xxxxxxxxxxx

"Better to be of a rare breed than a long line." -- TDK


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