Red Hat Bugzilla – Bug 1475214
package update filesystem-3.2-21.el7.x86_64 fails in el7 nspawn container because of readonly /sys
Last modified: 2017-09-18 13:00:22 EDT
Description of problem:
trying to update filesystem-3.2-21.el7.x86_64 fails in a nspawn el7 container because of readonly /sys
Version-Release number of selected component (if applicable):
start nspawn container, try to yum update filesystem in that el7 container
Updating : filesystem-3.2-21.el7.x86_64 1/2
Error unpacking rpm package filesystem-3.2-21.el7.x86_64
error: unpacking of archive failed on file /sys: cpio: chmod
filesystem-3.2-20.el7.x86_64 was supposed to be removed but is not!
filesystem.x86_64 0:3.2-20.el7 filesystem.x86_64 0:3.2-21.el7
updating cleanly :-)
Just as a confirmation of duplicate - is that on RHEL 6 host?
/sys is controlled by kernel - and kernel in containers is used from the host. Unfortunately, mode set by kernel changed between RHEL 6 and RHEL 7 (see #1037862) - so there is no good solution for this. It will be either broken on RHEL 6 host or on RHEL 7 host - or if I make this directory ghosted, it would show as "permissions modified" on one or other ghost - which is not perfect as well - could scare admin.
Btw. https://bugzilla.redhat.com/show_bug.cgi?id=1116516 is similar report.
It is a rhel 7 guest but I think I caused the problem myself. I'm using nsenter and remount parts of /sys to be able to set some settings using sysctl (I know it's bad) in the container - then remounting it ro but for some reason that changes the permissions on that directory like this
drwxr-xr-x. 9 root root 180 Jul 26 15:55 /sys