(re)starting of a daemon after package update

Panu Matilainen pmatilai at laiskiainen.org
Wed Jun 20 15:42:06 UTC 2012

On 06/20/2012 03:37 PM, Reindl Harald wrote:
> Am 20.06.2012 14:32, schrieb Björn Persson:
>> Michal Hlavinka wrote:
>>> Correct approach would be to save state before installation of new
>>> version starts and start dovecot (if flag is set) after old version is
>>> removed - that would mean %postun script. This does not seem to work on
>>> reinstall (the same version is installed) - %postun script is not executed.
>> Please also consider what happens when the new version of Dovecot requires a
>> new version of some library. RPM will ensure that both packages are updated in
>> the same transaction, but if I understand correctly it's not until %posttrans
>> that you can be sure that the new library is in place.
> one reason more why the cuurent behavior re-starting services
> on updates is simply wrong:

It's also not true.

If new dovecot requires new version of libfoo, that new libfoo with all 
its files is guaranteed [*] to be installed before the new dovecot, 
ditto for all their dependencies recursively. Reverse for the erasure 
phase, eg the older libfoo version is only removed after everything 
depending on it has been removed. If you think about it a little, not a 
single upgrade involving soname bumps and the like would work properly 
if it wasn't like that.

Doesn't mean there aren't windows where things can get broken while a 
transaction is in progress, eg you can atomically rename multiple files.

[*] Guaranteed except in presence of dependency loops, in which case rpm 
tries to break up the loop(s) in the least disruptive way, but there can 
be no guarantees in such situations.

	- Panu -

More information about the devel mailing list