Bug 230 - makewhatis expects /usr to be rw
makewhatis expects /usr to be rw
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: man (Show other bugs)
5.2
i386 Linux
low Severity low
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1998-11-30 05:00 EST by Marc MERLIN
Modified: 2014-03-19 07:09 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1998-12-04 17:10:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marc MERLIN 1998-11-30 05:00:14 EST
Resending old report to bugzilla.

This "bug" doesn't show on a stock installation.

The problem is that makewhatis is non FHS compliant (since
one is supposed to be able to mount /usr as read
only)

If you replace the makewhatis cron job with the following
script, it should catch the most common setups (it won't
work though if for instance /usr/local/man is a mount point)

#!/bin/bash
#
# By marcsoft@merlins.org
(07/27/98)

USR=no
USRLOCAL=no
if [ ! -z "`cat /proc/mounts  | grep '/usr ' | grep ro`" ];
then

USR=yes
        mount -o remount,rw
/usr
fi
if [ ! -z "`cat /proc/mounts  | grep '/usr/local ' | grep
ro`" ]; then

USRLOCAL=yes
        mount -o remount,rw
/usr/local
fi

makewhatis
-w

if [ $USR = "yes" ];
then
        mount -o remount,ro
/usr
fi
if [ $USRLOCAL = "yes" ];
then
        mount -o remount,ro
/usr/local
fi
Comment 1 David Lawrence 1998-12-04 17:10:59 EST
This would be nice ideally but it unfortunately cannot happen
realistically. A multiuser machine requires /usr to be accessible most
of the time. When root wants to upgrade something, they would need to
unmount the partition and then remount rw in order to upgrade and then
back again. This would cause interruption. Most of the /usr tree is
already non writable by users other than root regardless.
Comment 2 Marc MERLIN 1998-12-04 17:20:59 EST
You don't need to umount /usr to remount as read write, there is no
interruption involved.

I use:
magic:~$ more /var/local/scr/rw
#!/bin/sh

echo Remounting /usr read-write
if [ ! -z "`cat /proc/mounts  | grep '/usr '`" ]; then
        mount -o remount,rw /usr
fi
if [ ! -z "`cat /proc/mounts  | grep '/usr/local '`" ]; then
        mount -o remount,rw /usr/local
fi

/usr has been read only on my systems for over two years with no
problems whatsoever (except the occasional script that I need to fix).
The main reason for having /usr ro is to prevent long fscks and
possible filesystem corruption when a crash/power outage does occur.

Note that it is still fine with me if you discard this though :-)

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