On Sat, 19 Apr 2008, Simon Horman wrote:
> On Fri, Apr 18, 2008 at 02:52:41PM +0100, Andrew Suffield wrote:
> > Package: heartbeat
> >
> > The OCF Filesystem agent uses this code to monitor the mounted
> > filesystems:
> >
> > list_mounts() {
> > if [ -f "/etc/mtab" -a -r "/etc/mtab" ]; then
> > cut -d' ' -f1,2,3 </etc/mtab
> > else
> > $MOUNT | cut -d' ' -f1,3,5
> > fi
> > }
> >
> > Since what we're interested in is servers which are failing, there's a
> > chance that mtab will be out of date compared to the kernel status. It
> > should be checking /proc/mounts when that's available.
>
> Hi Andrew,
>
> that sounds entirely reasonable to me. I've CCed this to
> linux-ha-dev for further comment.
Sounds worth exploring. Thanks.
If you are going to work in that area, might you be able to consider
portability aspects?
It has almost certainly never worked under Solaris, where the filename is
"/etc/mnttab". But we can take this opportunity to try to rectify that,
and I would be happy to try to assist you in this.
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.
But (perversely!) the results are different:
Linux: "mount" gives:
/dev/md0 on / type ext3 (rw)
Solaris: "mount" gives:
/ on /dev/dsk/c0t0d0s0
read/write/setuid/intr/largefiles/onerror=panic/dev=2200000 on Thu Oct 18
16:35:16 2007
Note (amongst other things) the reversed order of the device and the
mountpoint.
If we could at least get the structure in place, that could help. See,
for example, OCF/IPaddr, whose "find_interface()" does a 'case' statement
of OS types. (Whilst autotools suggests _not_ programming to the OS, but
rather to the feature, nevertheless in these particular cases, programming
to the OS seems pragmatically satisfactory, and straightforward to
achieve.)
(I've no idea what BSD offers. But at least getting a portability
structure in place would give the BSD folk a framework in which they could
fill in their blanks.)
Best wishes.
--
: David Lee I.T. Service :
: Senior Systems Programmer Computer Centre :
: UNIX Team Leader Durham University :
: South Road :
: http://www.dur.ac.uk/t.d.lee/ Durham DH1 3LE :
: Phone: +44 191 334 2752 U.K. :
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]