On Mon, Apr 8, 2024 at 1:02 PM Neal Gompa <ngompa13@gmail.com> wrote:
On Mon, Apr 8, 2024 at 6:55 AM Johannes Kastl <mail@johannes-kastl.de> wrote:
>
> Hi Thorsten,
>
> On 08.04.24 08:58 Thorsten Kukuk wrote:
> > On Sun, Apr 7, 2024 at 4:24 PM Johannes Kastl <mail@johannes-kastl.de>
> > 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.

And this guidance is wrong, since your only example ignores all the problems we face with %ghost and has drawbacks. %ghost files will always get completely removed without *.rpmsave file, which also makes it impossible to e.g. rename the RPM if necessary.

%ghost files are becoming a pain in the ass after some years, as written, we have enough examples.

And as written, the file does not belong to the RPM, it's created by the admin.

  Thorsten

--
Thorsten Kukuk, Distinguished Engineer, Senior Architect, Future Technologies
SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nuernberg, Germany
Managing Director: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG Nürnberg)