Hi Neal, On 08.04.24 13:01 Neal Gompa wrote:
On Mon, Apr 8, 2024 at 6:55 AM Johannes Kastl <mail@johannes-kastl.de> wrote:
And: if the admin creates the file, it does not belong to the RPM! So don't create the wrong impression that this config file does belong to a RPM if it does not.
Thanks for this insight. I have not looked at it from this point of view. My idea was more like "files is related to package" or "file is used by package".
This guidance is wrong. %ghost entries ensure that data is cleaned up only on final uninstall. Leaving random crap all over the filesystem even after uninstall is a nightmare. You should use %ghost for known names of files that you do not create and either the admin or the software creates.
Hmmm. Not sure if it is a good idea to remove the handcrafted config file just because the package is being uninstalled. But of course, now that I think of it, once the RPM got uninstalled rpm will no longer show a file as belonging to this RPM, either.
Third: no RPM should install or own files in /etc, this includes %ghost. See https://en.opensuse.org/openSUSE:Packaging_UsrEtc I updated that page now with upstream references.
Hmmm, so not even the config directory should be owned by the package? Even if the application is not adapted to stuff being in /usr/etc/ or /etc?
The configuration directory should be owned by the package.
What happens on uninstall, if only the directory is being owned by the package? Not the files within? Kind Regards, Johannes