Medium: RA: Filesystem: implement monitor operation
Medium: RA: Filesystem: implement monitor operation

This patch implements a monitor operation for the Filesystem
RA. Previously, monitor was an alias for status, which monitor
continues to utilize, it only adds some functionality testing whether
I/O on the mounted filesystem is in fact possible.

To that end, the patch implements a new parameter "statusfile_prefix",
which is unset by default and if left unset, retains the old behavior
of monitor being functionally equivalent to status.

When set, statusfile_prefix is interpreted as the prefix to be used
for a status file for resource health monitoring. If this parameter is
set, then the monitor operation will read from, and optionally write
to, a file whose filename is constructed from the directory parameter,
the statusfile_prefix parameter, and the host name. Its expected
content is the name of the resource. If status files should live in
their own directory, users should include a trailing slash ("/") in
"statusfile_prefix". Note that the status file should not be
interpreted as a lock file of any kind -- it just records a
per-resource, per-node status.

If the "monitor" operation is configured with a depth of 0, and only
if statusfile_prefix is set, then the status file is just created once
(on resource startup, and only if it does not already exist), and
subsequently read. If "depth" is greater than 0, then the status file
is periodically read and re-written.

Note that if the filesystem is mounted read-only (NFS mounted from a
read-only export, for example), and one configures this parameter,
then one must create the status file manually or the resource will
fail on start.

Note also that for monitoring with a depth of greater than 0, the
status file must be writable by root. This is not always the case with
an NFS mount, as NFS exports usually have the "root_squash" option
set. In such a setup, one must either use read-only monitoring
(depth=0), export with "no_root_squash" on the NFS server, or grant
world write permissions on the directory where the status file is to
be placed.

Another caveat is that the monitor operations requires the
"oflag=direct" option to be supported by dd. Some ancient versions of
coreutils come with a dd that does not support this option -- on such
systems, status file based monitoring is simply not available.

stevenraspudic/resource-agents,stevenraspudic/resource-agents,stevenraspudic/resource-agents,asp24/resource-agents,asp24/resource-agents,asp24/resource-agents