Re: [Dovecot] How to upgrade a running Dovecot?
Have you considered sending out a message to each user to the effect
that on some day, darned-early a.m. the system will be offline for 30
minutes for maintenance (no incoming email will be lost, etc., etc.).
Message: 3 Date: Thu, 4 Oct 2007 13:57:03 +0100 From: Mike Brudenell pmb1@york.ac.uk Subject: [Dovecot] How to upgrade a running Dovecot? To: Dovecot Mailing List dovecot@dovecot.org Message-ID: 06B4C604-41E3-4061-96B2-C7C719E21D49@york.ac.uk Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Greetings -
Could someone confirm how to perform various upgrades on a live system running Dovecot please?
Scenario 1: Change to dovecot.conf
If I make a change to dovecot.conf am I right in thinking I can simply send a HUP signal to the main dovecot process to get it to re- read the configuration file and act on its revised content?
Yes, this is correct.
Scenario 2: Altered SSL Certificates
I need to replace our current certificates and have prepared new files containing the replacement certificate and private key. Am I right in thinking that I can simply modify dovecot.conf to point at the new files and send a HUP signal to dovecot? Specifically, will new connections use the revised certificates, and existing connections continue to work OK without interruption?
Ehh not really, the auth child processes can be killed and new ones
started. See your next scenario question.
Scenario 3: Software Upgrade
I build a particular version of Dovecot into the tree /usr/local/ dovecot-A.B.C and then have a symlink called "dovecot" pointing at the this directory. To upgrade I can then build the new version into /usr/local/dovecot-X.Y.Z and test.
To actually switch over the live service to the new X.Y.Z version do I need to:
a) Totally shut down the old A.B.C version of Dovecot, thereby breaking all open connections for users? or
b) Assuming I am using "shutdown_clients = no" can I just kill the master "dovecot" process and then start up the new version?
See the preface, do the update when you typically have few folks
using the system -- which gives you fewer complaints from users
should things break on their end.
Ideally I want existing connections to remain running, but new connections to start up using the new X.Y.Z version of Dovecot.
The comment for "shutdown_clients" implies this, but also says:
"This however means that after master process has died, the
client processes can't write to log files anymore."
So if I understand this correctly then with "shutdown_clients = no" in force then the sequence and behaviour is this? ...
1. Old version A.B.C of Dovecot running, clients can log
through the master "dovecot" process to the logfiles.
2. Kill the old master "dovecot" process, start new X.Y.Z
version up.
3. New connections get served by version X.Y.Z. Old connections DON'T get killed and can continue, BUT can
no longer write anything to the logfiles?
With many thanks, Mike B-)
-- The Computing Service, University of York, Heslington, York Yo10
5DD, UK Tel:+44-1904-433811 FAX:+44-1904-433740
- Unsolicited commercial e-mail is NOT welcome at this e-mail
address. *
Hi, Jerry/et al -
On 4 Oct 2007, at 20:47, Jerry Yeager wrote:
Have you considered sending out a message to each user to the
effect that on some day, darned-early a.m. the system will be
offline for 30 minutes for maintenance (no incoming email will be
lost, etc., etc.).
We have around 20,000 users at our site and need to keep downtime of
the e-mail service to an absolute minimum. The quietest time is at
around 4:00am ... when I am sound asleep in bed, and plan to stay
that way! :-)
Seriously... I'm not new to timing and managing software upgrades:
I've been doing it for around 19 years here now.
But what I _am_ new to is Dovecot. Not knowing the software well
yet, my questions are in an attempt to find the best way to flip it
to a new configuration or version with minimal/no disruption to
connected users.
Scenario 1: Change to dovecot.conf
If I make a change to dovecot.conf am I right in thinking I can simply send a HUP signal to the main dovecot process to get it to re- read the configuration file and act on its revised content?
Yes, this is correct.
Good...
Scenario 2: Altered SSL Certificates
I need to replace our current certificates and have prepared new files containing the replacement certificate and private key. Am I right in thinking that I can simply modify dovecot.conf to point at the new files and send a HUP signal to dovecot? Specifically, will new connections use the revised certificates, and existing connections continue to work OK without interruption?
Ehh not really, the auth child processes can be killed and new ones
started. See your next scenario question.
...So here you're saying that although the "dovecot" master process
re-reads the configuration file, it doing so has no effect on the
existing authenticator child processes? And is it these processes
that are dealing with the SSL connection? ... I'd have thought it was
either the "imap-login" or "imap" processes?
Scenario 3: Software Upgrade
I build a particular version of Dovecot into the tree /usr/local/ dovecot-A.B.C and then have a symlink called "dovecot" pointing at the this directory. To upgrade I can then build the new version into /usr/local/dovecot-X.Y.Z and test.
To actually switch over the live service to the new X.Y.Z version do I need to:
a) Totally shut down the old A.B.C version of Dovecot, thereby breaking all open connections for users? or
b) Assuming I am using "shutdown_clients = no" can I just kill the master "dovecot" process and then start up the new version?
See the preface, do the update when you typically have few folks
using the system -- which gives you fewer complaints from users
should things break on their end.
Yes... However the dovecot.conf configuration file includes a comment
which says this:
# Should all IMAP and POP3 processes be killed when Dovecot master
process
# shuts down. Setting this to "no" means that Dovecot can be upgraded
without
# forcing existing client connections to close (although that could
also be
# a problem if the upgrade is eg. because of a security fix). This
however
# means that after master process has died, the client processes
can't write
# to log files anymore.
#shutdown_clients = yes
This implies it *is* possible to upgrade the software without
breaking existing live connections. I'm trying to get confirmation
of this along with any side-effects -- for example the comment seems
to warn that pre-existing connections will no longer be able to write
to the logfiles after the changeover?
Cheers, Mike B-)
-- The Computing Service, University of York, Heslington, York Yo10 5DD, UK Tel:+44-1904-433811 FAX:+44-1904-433740
- Unsolicited commercial e-mail is NOT welcome at this e-mail address. *
Mike Brudenell wrote:
Yes... However the dovecot.conf configuration file includes a comment which says this:
# Should all IMAP and POP3 processes be killed when Dovecot master process # shuts down. Setting this to "no" means that Dovecot can be upgraded without # forcing existing client connections to close (although that could also be # a problem if the upgrade is eg. because of a security fix). This however # means that after master process has died, the client processes can't write # to log files anymore. #shutdown_clients = yes
This implies it *is* possible to upgrade the software without breaking existing live connections. I'm trying to get confirmation of this along with any side-effects -- for example the comment seems to warn that pre-existing connections will no longer be able to write to the logfiles after the changeover?
Cheers, Mike B-)
I think you're safe enough to do this if the upgrade is between similar versions (but not, say, between Dovecot 1.0.x and 1.1.x where things like the index files format changed).
Yes, you lose the logging, but I've not known it cause us any problems when we've done it. I think the most likely issue is where a client has multiple IMAP connections and some are to the new version and some are to the old and it might get upset if they appear different in some way (e.g. a version war over indexes).
It *is* neater to kill off the older version processes though. Most of our clients (<cough>Outlook Express </cough> and Prayer Webmail) will reconnect automatically anyway.
Chris
-- --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- Christopher Wakelin, c.d.wakelin@reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094
It *is* neater to kill off the older version processes though. Most of our clients (<cough>Outlook Express </cough> and Prayer Webmail) will reconnect automatically anyway.
Agreed. I haven't come across any clients that puke when you abruptly cut off their connection. All the common ones I tried seem to simply reconnect and continue
Ed W
participants (4)
-
Chris Wakelin
-
Ed W
-
Jerry Yeager
-
Mike Brudenell