Description of problem:
/etc/rwtab is supposed to list directories and files needed for stateless operation. However, it creates directories that are not needed for the installed packages. These files and directories should not be enumerated in the system rwtab but rather in
Version-Release number of selected component (if applicable):
Steps to Reproduce:
# sed -e 's;[^/]*/;/;' -e '/^$/d' /etc/rwtab | while read file;do echo -n "$file: "; rpm -qf $file;done
/var/gdm: error: file /var/gdm: No such file or directory
/var/lib/xkb: error: file /var/lib/xkb: No such file or directory
/var/lib/puppet: error: file /var/lib/puppet: No such file or directory
/var/cache/foomatic: error: file /var/cache/foomatic: No such file or directory
/var/cache/logwatch: error: file /var/cache/logwatch: No such file or directory
/var/cache/httpd/ssl: error: file /var/cache/httpd/ssl: No such file or directory
/var/cache/httpd/proxy: error: file /var/cache/httpd/proxy: No such file or directory
/var/cache/php-pear: error: file /var/cache/php-pear: No such file or directory
/var/cache/systemtap: error: file /var/cache/systemtap: No such file or directory
/var/db/nscd: error: file /var/db/nscd: No such file or directory
/var/lib/dav: error: file /var/lib/dav: No such file or directory
/var/lib/dhcpd: error: file /var/lib/dhcpd: No such file or directory
/var/lib/php: error: file /var/lib/php: No such file or directory
/var/lib/pulse: error: file /var/lib/pulse: No such file or directory
/var/lib/ups: error: file /var/lib/ups: No such file or directory
/etc/ntp.conf: error: file /etc/ntp.conf: No such file or directory
/etc/resolv.conf: file /etc/resolv.conf is not owned by any package
/etc/lvm/cache: error: file /etc/lvm/cache: No such file or directory
/etc/lvm/archive: error: file /etc/lvm/archive: No such file or directory
/etc/lvm/backup: error: file /etc/lvm/backup: No such file or directory
/var/account: error: file /var/account: No such file or directory
/var/lib/arpwatch: error: file /var/lib/arpwatch: No such file or directory
/var/cache/alchemist: error: file /var/cache/alchemist: No such file or directory
/var/lib/gdm: error: file /var/lib/gdm: No such file or directory
/var/lib/iscsi: error: file /var/lib/iscsi: No such file or directory
/var/lib/ntp: error: file /var/lib/ntp: No such file or directory
/var/lib/xen: error: file /var/lib/xen: No such file or directory
/var/empty/sshd/etc/localtime: error: file /var/empty/sshd/etc/localtime: No such file or directory
/var/lib/random-seed: error: file /var/lib/random-seed: No such file or directory
/var/lib/samba: error: file /var/lib/samba: No such file or directory
/var/log/audit/audit.log: file /var/log/audit/audit.log is not owned by any package
/var/cache/man should be in a small file called /etc/rwtab.d/man that belongs to man-db-*.rpm
likewise /var/lib/dhclient should be in a small file called /etc/rwtab.d/man that belongs to dhclient-*.rpm
The same with: /var/lib/dbus: dbus-1.6.12-8.el7.x86_64 and
This one perplexes me: /etc/adjtime: initscripts-9.49.17-1.el7.x86_64
All the ones above which are listed as: "No such file or directory" either should be removed from rwtab and put in their respective packages as small often times single line files in /etc/rwtab.d/ or they should be dropped from rwtab. A couple seem to be historical and it looks like rwtab has been accumulating cruft for example: /var/lib/xen probably doesn't belong in there anymore.
The resolution to bz#971930 was probably not the correct one. The correct solution would have been to put:
I am tend to close this one as wontfix. Yes I agree that it would be better if every package have its own drop-in for rwtab, but it would require changes in so many packages, that I don't think it is practical for rhel.
Also we have completely different plans how to implement read-only system in RHEL8.
I'd say, use this one as a tracker and then I'll fork off BZ's for the various packages and then if and when they get updated due to other reasons, they can include the patch for that specific patch. When that related BZ closes, then you can remove it from the master rwtab.
Also, I'll clone this issue for Fedora and we can work on it there.
I'm familiar with the way that much of this functionality is being rolled into systemd for rhel8 http://0pointer.de/blog/projects/stateless.html and that sounds like a better approach overall. Never the less rwtab and rwtab.d provides a good reference for what needs to be migrated to tmpfiles.d as we make that transition. Going through and cleaning the cruft out will make it an easier transition.
In fedora this would make sense, but in rhel, I don't think it is worthy to fix all of those packages.