Bug 735645

Summary: readonly-root rwtab fail to copy directory contents for dirs directive
Product: [Fedora] Fedora Reporter: John L Magee <jlmagee>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: harald, iarlyy, initscripts-maint-list, johannbg, jonathan, kay, lpoetter, metherid, mschmidt, notting, plautrba, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 17:30:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John L Magee 2011-09-04 14:35:05 UTC
Description of problem:
The  find... | cpio... line in the following routine from /lib/systemd/fedora-readonly does not copy the contents of the directory as specified for the dirs directive of rwtab,

	mount_dirs() {
		if [ -e "$1" ]; then
			mkdir -p "$RW_MOUNT$1"
			find "$1" -type d -print0 | cpio -p -0vd "$RW_MOUNT" &>/dev/null
			mount -n --bind "$RW_MOUNT$1" "$1"
		fi
	}


Version-Release number of selected component (if applicable):
AFAICT, this has not worked since it was introduced around RHEL 5.2. There was a comment #fixme find fails in earlier versions of rc.sysinit

How reproducible:
run the following commands and note that there are no data files in the first tree but there  are files in the second. The fix could be a simple as the changing the -type d to -depth in the find but the root issue could be that cpio  does not copy directory contents as described in its man page.

rm -rf cpiotest
rm -rf /tmp/cpiotest
mkdir cpiotest
mkdir cpiotest/one
mkdir cpiotest/two
mkdir cpiotest/two/a
mkdir cpiotest/three
mkdir cpiotest/three/c
mkdir cpiotest/three/d
touch cpiotest/one/data001
touch cpiotest/one/data002
touch cpiotest/two/a/data003
touch cpiotest/three/d/data004
find cpiotest -type d -print0 | cpio -p -0vd /tmp/
tree /tmp/cpiotest/
find cpiotest -depth -print0 | cpio -p -0vd /tmp/
tree /tmp/cpiotest/


Additional info:  Filed under systemd because I thought it might get some attention.

Comment 1 Fedora End Of Life 2012-08-07 17:30:13 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping