Identify existing configuration files
v2 cover Identify existing configuration files
Some package formats explicitly track which files are configuration files so that they are not overwritten on updates.
This series explicitly identifies files that were already being packaged, but not known as configuration files.
I built the RPM packages and compared the output of rpm -qp --filesbypkg with rpm -qp --configfiles against the equivalent packages in CentOS 7.
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb | 7 +++++++ 1 file changed, 7 insertions(+)
meta/recipes-extended/logrotate/logrotate_3.8.8.bb | 3 +++ 1 file changed, 3 insertions(+)
UPDATE: I updated the patches to use the proper GNU Coding Standard directory variables. I also added a patch to add nfsmount.conf to nfs-utils-client as it seemed to be missing by accident rather than by omission.
PATCH v2 1/3 nfs-utils: Install nfsmount.conf
The file nfsmount.conf is present in nfs-utils but not installed to the filesystem. It has been added to nfs-utils-client as it seemed to be missing accidentally rather than being removed intentionally. The binary files in nfs-utils-client have a hard-coded reference to it and we already provide the manpage for it in nfs-utils-doc.
Signed-off by: Rob Woolley <[email protected]>
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb +3 -0
@@ -73,6 +73,7 @@ FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \ ${sbindir}/showmount ${sbindir}/nfsstat \ ${localstatedir}/lib/nfs \ ${sysconfdir}/nfs-utils.conf \ + ${sysconfdir}/nfsmount.conf \ ${sysconfdir}/init.d/nfscommon \ ${systemd_unitdir}/system/nfs-statd.service" FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
@@ -90,6 +91,8 @@ do_install_append () { install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir} + install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir} + install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/ install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
PATCH v2 2/3 nfs-utils: Identify CONFFILES
In reply to Rob WoolleySome package formats explicitly track which files are configuration files so that they are not overwritten on updates. We must use an explicit list instead of a wildcard as nfs-utils-client provides files under ${localstatedir}/lib/nfs that are not configuration files.
Signed-off by: Rob Woolley <[email protected]>
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb +7 -0
@@ -68,6 +68,13 @@ PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils" INHIBIT_AUTO_STAGE = "1" PACKAGES =+ "${PN}-client ${PN}-stats" + +CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \ + ${localstatedir}/lib/nfs/rmtab \ + ${localstatedir}/lib/nfs/xtab \ + ${localstatedir}/lib/nfs/statd/state \ + ${sysconfdir}/nfsmount.conf" + FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \ ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \ ${sbindir}/showmount ${sbindir}/nfsstat \
Re: [PATCH v2 2/3] nfs-utils: Identify CONFFILES
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils" · line 76
Quoted 6 lines · Rob Woolley
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb +5
-0+CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \ + ${localstatedir}/lib/nfs/rmtab \ + ${localstatedir}/lib/nfs/xtab \ + ${localstatedir}/lib/nfs/statd/state \ + ${sysconfdir}/nfsmount.conf"
NFS puts configuration files in /var/lib? Are files called "state" really configuration files?
Ross
Re: [PATCH v2 2/3] nfs-utils: Identify CONFFILES
Hi Ross,
My understanding is that they are used to help make NFS state-full. The "state" file is part of the extension to add Network Status Monitoring (NSM) to NFS.
In the RPM world, they need to label them as configuration files to avoid them getting overwritten during an upgrade.
The Debian approach removes them on a "purge" in the postrm stage and ignore them when doing an "upgrade" in the prerm stage.
So, technically they are not configuration files. Would another approach such as removing them as packaged files and touching the files in a postinstall script be preferred?
Regards,
Rob
Quoted 13 lines · Ross
On 9 March 2015 at 23:52, Rob Woolley <[email protected] <mailto:[email protected]>> wrote:
+CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
+ ${localstatedir}/lib/nfs/rmtab \
+ ${localstatedir}/lib/nfs/xtab \
+ ${localstatedir}/lib/nfs/statd/state \
+${sysconfdir}/nfsmount.conf"NFS puts configuration files in
/var/lib? Are files called "state" really configuration files?Ross
PATCH v2 3/3 logrotate: Identify CONFFILES
In reply to Rob WoolleySome package formats explicitly track which files are configuration files so that they are not overwritten on updates. We must use an explicit list instead of a wildcard as logrotate also provides files under ${sysconfdir} that are not configuration files.
Signed-off by: Rob Woolley <[email protected]>
meta/recipes-extended/logrotate/logrotate_3.8.8.bb +3 -0
@@ -27,6 +27,9 @@ PACKAGECONFIG ?= "\ PACKAGECONFIG[acl] = ",,acl" PACKAGECONFIG[selinux] = ",,libselinux" +CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \ + ${sysconfdir}/logrotate.conf" + # If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our # optimization variables, so use it rather than EXTRA_CFLAGS. EXTRA_OEMAKE = "\
Hi Rob,
Quoted 6 lines · Rob Woolley
Some package formats explicitly track which files are configuration files so that they are not overwritten on updates.
This series explicitly identifies files that were already being packaged, but not known as configuration files.
Do you have these patches in a branch? git am is claiming they're corrupted, so something must have happened to them in transit.
Cheers,
Ross
Hi Ross,
Sure thing.
I applied them to a fresh clone of openembedded-core.git and pushed it to the conffiles branch on github:
https://github.com/rcwoolley/openembedded-core/tree/conffiles
Regards,
Rob
Quoted 17 lines · Ross
Hi Rob,
On 9 March 2015 at 23:52, Rob Woolley <[email protected] <mailto:[email protected]>> wrote:
Some package formats explicitly track which files are configuration files
so that they are not overwritten on updates.This series explicitly identifies files that were already being packaged,
but not known as configuration files.Do you have these patches in a branch? git am is claiming they're corrupted, so something must have happened to them in transit.
Cheers,
Ross