Am Wed, 23 Mar 2011 13:47:34 +0100 schrieb Lars Marowsky-Bree <l...@novell.com>:
> On 2011-03-23T11:50:02, Lars Ellenberg <lars.ellenb...@linbit.com> wrote: > > > > # Take advantage of /etc/mtab if present, use portable mount command > > > # otherwise. Normalize format to "dev mountpoint fstype". > > I wonder if we shouldn't just always rely on "mount" and insist on that > providing proper data. > > Re-implementing mount seems like a bad idea. If more extensive checks > than a binary "mounted xor not" are needed, this would be noticed by the > deeper monitor levels or the application-level monitor, no? > > > Regards, > Lars > I had a weird case in which a filesystem (GFS2) had gotten unmounted without /etc/mtab being modified. It is possible to enforce that behavour by calling the umount() system call directly from any program that has sufficient privileges. (For example by executing `umount <mountpoint> -n` ) It can apparently also happen if a hardware (or in this case network) caused event leads to a unmount by the kernel. mount without arguments as well as the the filesystem resource agent both still list the filesystem as mounted, simply because BOTH just look at /etc/mtab. The application level resource agent of course noticed the errors, but were unable to recover (the application on course depends on its filesystem being mounted) pacemaker did not remount the filesystem because the resource agents monitor() function did not notice that it wasn't. I agree, the "correct" way of doing this would be to use a system tool that lists all mounted filesystems for us, regardless of the actual system used. However `mount` is the wrong tool, since `mount` without parameters only prints out thew contents of /etc/mtab (even if given an additional "-n" flag this doesn't change) and as such is not suitable as a `monitor()` IMHO. Currently neither /etc/mtab nor `mount` are reliable to monitor the mount state of a device or mountpoint. /proc/mounts is accurate with some limitations. regards Corvus _______________________________________________________ Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/