On Mon, Apr 21, 2008 at 10:45:59AM +0100, Andrew Suffield wrote:
> On Mon, Apr 21, 2008 at 10:22:01AM +0100, David Lee wrote:
> > Solaris doesn't have a "/proc/mounts".  What it does have is the ability
> > (like Linux) to list the kernel mount table from a simple "mount" command.
> 
> Irritatingly, the Linux 'mount' command doesn't do this, it merely
> dumps out whatever is in /etc/mtab at the time. This is because some
> information relating to loopback and user mounts is only available in
> mtab, since it's only used by the userspace tools.
> 
> This means it is similarly unreliable - the only way to find out
> what the kernel's really up to on Linux is to inspect /proc/mounts
> directly.

I wonder if entries that are not present in /proc/mounts might be a
problem, especially as this information is used to search for and
unmount sub-mounts under the managed mount-point.

In any case, is this patch what you were thinking of?

Index: heartbeat/resources/OCF/Filesystem
===================================================================
--- heartbeat.orig/resources/OCF/Filesystem     2008-04-23 14:23:53.000000000 
+1000
+++ heartbeat/resources/OCF/Filesystem  2008-04-23 14:35:55.000000000 +1000
@@ -177,9 +177,12 @@ flushbufs() {
     return 0
 }
 
-# Take advantage of /etc/mtab if present, use portable mount command
-# otherwise. Normalize format to "dev mountpoint fstype".
+# Take advantage of /proc/mounts or /etc/mtab if present,
+# use portable mount command otherwise.
+# Normalize format to "dev mountpoint fstype".
 list_mounts() {
+       if [ -f "/proc/mounts" -a -r "/proc/mounts" ]; then
+               cut -d' ' -f1,2,3 </proc/mounts
        if [ -f "/etc/mtab" -a -r "/etc/mtab" ]; then
                cut -d' ' -f1,2,3 </etc/mtab
        else




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to