Bug 1122319 - rwtab makes directories for non-installed packages
Summary: rwtab makes directories for non-installed packages
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: initscripts
Version: 7.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: initscripts Maintenance Team
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks: 1154125
TreeView+ depends on / blocked
 
Reported: 2014-07-22 23:25 UTC by Ben Woodard
Modified: 2016-11-25 13:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-27 09:28:57 UTC


Attachments (Terms of Use)

Description Ben Woodard 2014-07-22 23:25:42 UTC
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):
initscripts-9.49.17-1.el7.x86_64

How reproducible:
always

Steps to Reproduce:
# sed -e 's;[^/]*/;/;' -e '/^$/d' /etc/rwtab | while read file;do echo -n "$file: "; rpm -qf $file;done


Actual results:
/var/cache/man: man-db-2.6.3-9.el7.x86_64

/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/log: filesystem-3.2-18.el7.x86_64

/var/lib/puppet: error: file /var/lib/puppet: No such file or directory

/var/lib/dbus: dbus-1.6.12-8.el7.x86_64

/var/lib/nfs: nfs-utils-1.3.0-0.el7.x86_64

/tmp: filesystem-3.2-18.el7.x86_64

/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/dhclient: dhclient-4.2.5-27.el7.x86_64

/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

/var/tmp: filesystem-3.2-18.el7.x86_64

/etc/adjtime: initscripts-9.49.17-1.el7.x86_64

/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/lib/NetworkManager: NetworkManager-0.9.9.1-23.git20140326.4dba720.el7_0.x86_64

/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/logrotate.status: logrotate-3.8.6-4.el7.x86_64

/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/spool: filesystem-3.2-18.el7.x86_64

/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




Expected results:
/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 
/var/lib/nfs: nfs-utils-1.3.0-0.el7.x86_64

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.

Additional info:
The resolution to bz#971930 was probably not the correct one. The correct solution would have been to put:

files	/var/lib/samba

in /etc/rwtab.d/samba

Comment 2 Lukáš Nykrýn 2014-07-23 07:23:07 UTC
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.

Comment 3 Ben Woodard 2014-07-23 17:38:04 UTC
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.

Comment 5 Lukáš Nykrýn 2015-03-27 09:28:57 UTC
In fedora this would make sense, but in rhel, I don't think it is worthy to fix all of those packages.


Note You need to log in before you can comment on or make changes to this bug.