Borsenkow Andrej <[EMAIL PROTECTED]> writes:

> Most init scripts I have seen are defined as noreplace. It has unfortunate
> effect - if init script is changed, it is not replaced. It means that in
> postinstall section rpm actually runs restart with _old_ script. Which is
> obviously wrong (exactly in case when script has changed).
> 
> Is there any policy related to init scripts? I see absolutely no reasons to
> define them as noreplace except for very special cases (like rc.local
> probably).

Our policy (from mdk rpm howto) says:

To tell RPM that the file specified is a configuration file,
place a %config at the front of the file. That way, RPM will
upgrade the file, but save a copy of the old one on the local
hard drive. Most of the time, it is NOT the desired behaviour,
because you shall lose (temporarily) your precious configuration
in exchange of the default one which is obviously far poorer than
what you need. To address this issue, use %config(noreplace).

So, in general, when hesitating, we've been choosing
%config(noreplace). The rule of thumb being that %config should
be used when it's clearly needed.

The idea is that if the user ever changed an initscript, he sure
knows what he's doing, so we don't update it by default. If it
was not changed by the user (99.9% of the cases), RPM will update
the file anyway (be it %config or %config(noreplace) or
whatever).

> Is it possible to tell RPM to save old copy in *.rpmold on update?

Well a %config file gets ".rpmsave" for the old config file - and
a %config(noreplace) gets ".rpmnew" for the new config file.

-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/

Reply via email to