On Mon, Apr 8, 2024 at 6:55 AM Johannes Kastl
Hi Thorsten,
On 08.04.24 08:58 Thorsten Kukuk wrote:
On Sun, Apr 7, 2024 at 4:24 PM Johannes Kastl
wrote: 1. How should I handle files in /etc/openbao that should "belong" to the package, but should not be packaged at all (the admin needs to create that herself)? Not having the file in the package means that querying RPM will not yield which package this file belongs to. Of course, the directory name might give a hint, but I would like to have rpm answer that question properly. My most educated guess whould be to %ghost those files. Not sure if that is the right way]tm]. :-)
%ghost entries are the worst you can do. I know here are several people who think files created by an admin should belong to a package, but: since RPM does not know anything about this file and if it got modified or not, making package changes here later is impossible. We have enough packages which suffer from this. So: don't use %ghost entries if not absolutely necessary.
OK.
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.
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. -- 真実はいつも一つ!/ Always, there's only one truth!