3

How is best to handle files in an rpm spec file that may or may not exist with these specifics:

Part of the files delivered are example files under a /conf.d/ directory. The files are installed as conf.d/example.conf-. It is expected that the user would copy or rename the files with the end hyphen removed so the application will use it. The application uses /conf.d/*.conf as is common.

All files with and without a hyphen suffix should be part of the package with permissions managed by the rpm. The original hyphen-suffixed files may or may not exist at update or remove time. Same with the non hyphen-suffixed versions.

It appears that both file name versions must be added to buildroot but I'm not sure of best practice to name some as ghost. The user may also add a conf file of their own. Is it possible to enforce permissions for files in a package owned directory but not known to the package?

The conf.d/*conf strategy is commonly used but I haven't found any example of handling this other than ignoring user created files and not deleting the directory on remove if any exist. Advice, references and/or examples would be appreciated.

Z0OM
  • 1
  • 4
  • 24
  • 56
EddieSub
  • 31
  • 2
  • 1
    Either make a usable conf file with examples as comments, or put examples in another directory (somewhere in `/usr/share`). "Enforcing" permissions on files created by the user is not the package management system's job. If your application expects certain permissions, then have it do the "enforcing" – muru Jun 24 '23 at 01:39

0 Answers0