Bug 201513

Summary: /etc/rc.d/rc.sysinit should create /proc directory before try to mount onto it
Product: [Fedora] Fedora Reporter: Richard Lloyd <rkl>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED CANTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-07 14:13:25 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 Richard Lloyd 2006-08-06 22:28:32 UTC
Description of problem:
If the /proc directory is missing, the boot sequence doesn't try to create it
before attempting to mount the proc filesystem onto it.

Version-Release number of selected component (if applicable):
Any version (FC4, FC5 and CentOS 4 all exhibit this problem)

How reproducible:
Always

Steps to Reproduce:
1. Install a Red Hat-based distro (e.g. FC5, FC6T1, RHEL4, CentOS etc) onto a
spare partition on your hard drive.
2. Mount that partition in your "original" OS and delete the /proc directory in
that freshly installed distro.
3. Reboot and select the freshly installed OS to be booted via GRUB.

Actual results:
A mount error message is displayed when trying to mount /proc (because of the
missing directory) and then the OS hangs a little further down in the boot
sequence (in the bit where it initialises storage).

Expected results:
The boot sequence should detect the missing /proc directory and try to recreate
it (and maybe display a warning/info message that it's done so) before trying to
mount /proc onto it.

Additional info:
Yes, it's unlikely anyone would delete the proc directory, particularly on the
currently running system (are you even allowed to...I've never dared trying!),
but it's clear that early creation of the missing /proc dir is needed. A quick
look at the initscripts code suggests that /etc/rc.d/rc.sysinit could do with
some love - it currently reads:

# Mount /proc and /sys (done here so volume labels can work with fsck)
mount -n -t proc /proc /proc

Can I suggest that at least a mkdir is placed before the mount command - e.g.:

# Mount /proc and /sys (done here so volume labels can work with fsck)
mkdir -p -m 555 /proc
mount -n -t proc /proc /proc

Yes, that's probably the one-liner no-brainer fix, but you can get fancier with
tests for the directory and warning messages if you want...

Comment 1 Bill Nottingham 2006-08-07 14:13:25 UTC
The root filesystem is read-only, so that won't work at that point.