rpm overwriting config files again
Jeffrey Johnson
n3npq at me.com
Thu May 28 23:13:30 CEST 2015
On May 25, 2015, at 9:01 AM, Elan Ruusamäe wrote:
> again rpm is ovewriting existing files, not creating them as .rpmnew when the file is "new" in the package itself.
>
Claiming "overwriting" is premature (see below).
> imho this got solved at least in 4.5...
>
Comparisons to rpm-4.x behaviors aren't useful because
1) rpm.org has different (and changed at rpm.org) semantics for %config handling
2) rpm-4.5 went end-of-life back in 2007 and has no upgrade path.
And in this case, I believe your claim is incorrect.
The code in rpmfiDecideFile() is unchanged (except in some API cosmetic ways afaict)
since 09-Jul-2003 when first checked in.
Even the API cosmetic changes date back to 2008.
So if this "worked" in rpm-4.5, PLD likely patched a different behavior.
Not my problem, mon.
My belief is as valid as yours until someone (not me) actually provides evidence to the contrary.
> scenario:
> 1. foo.conf is present in filesystem, but not in package v1.0
> 2. package v1.1 contains foo.conf as %config(noreplace) %verify(not md5 mtime size)
> 3. upgrade package v1.0 -> v1.1 ovewrites foo.conf, not creating foo.conf.rpmnew
>
The confusion here starts with "noreplace", which does *NOT* mean
Never replace this file.
There are several circumstances under which a file marked %config(noreplace) *WILL*
be overwritten rather then installed with ".rpmnew", including
UNMODIFIED: the ondisk digest is identical to the file digest in the installed package.
FILETYPE changes: the file in the installed package has a different type than in the new package
> rpm-5.4.15-6.x86_64
>
>
> log from such system:
>
> # md5sum /etc/nagios/nrpe.d/commands.cfg
> a57588d1e0fb022e0e0bd5945d4ddeb1 /etc/nagios/nrpe.d/commands.cfg
>
> # rpm -qf /etc/nagios/nrpe.d/commands.cfg
> file /etc/nagios/nrpe.d/commands.cfg is not owned by any package
>
> Executing rpm --upgrade -vh --root / --define _check_dirname_deps 1...
> Preparing... ########################################### [100%]
> 1:nagios-nrpe warning: /etc/nagios/nrpe.cfg created as /etc/nagios/nrpe.cfg.rpmnew
> ########################################### [100%]
>
> # rpm -qfc /etc/nagios/nrpe.d/commands.cfg
> /etc/nagios/nrpe.cfg
> /etc/nagios/nrpe.d/commands.cfg
>
> # md5sum /etc/nagios/nrpe.d/commands.cfg
> 2e4e27f09f7e1efa04c121c6658536a1 /etc/nagios/nrpe.d/commands.cfg
>
> # ls -l /etc/nagios/nrpe.d/commands.cfg*
> -rw-r----- 1 root nagios 1.8K May 25 15:43 /etc/nagios/nrpe.d/commands.cfg
>
If you run with -Uvv (instead of -Uvh), you will see what RPM does with EVERY file
in the output.
My guess (similar to your previous claim of "overwritten") is that package order
ended up as erase-before-install as part of a multiple package upgrade.
Was this behavior seen in a multiple package upgrade that you have snipped out?
73 de Jeff
More information about the pld-devel-en
mailing list