On 1/11/06, [email protected]
<[email protected]> wrote:
> linux-ha CVS committal
>
> Author  : alan
> Host    :
> Project : linux-ha
> Module  : resources
>
> Dir     : linux-ha/resources/OCF
>
>
> Modified Files:
>         Filesystem.in
>
>
> Log Message:
> Changed Fileystem to not log status if it's called as a monitor operation.
> Also noted a bug about validate-all.
>
> ===================================================================
> RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/Filesystem.in,v
> retrieving revision 1.11
> retrieving revision 1.12
> diff -u -3 -r1.11 -r1.12
> --- Filesystem.in       20 Dec 2005 08:34:47 -0000      1.11
> +++ Filesystem.in       10 Jan 2006 17:32:35 -0000      1.12
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>  #
> -# $Id: Filesystem.in,v 1.11 2005/12/20 08:34:47 zhenh Exp $
> +# $Id: Filesystem.in,v 1.12 2006/01/10 17:32:35 alan Exp $
>  #
>  # Support:      [EMAIL PROTECTED]
>  # License:      GNU General Public License (GPL)
> @@ -96,7 +96,7 @@
>
>  cat <<-EOT;
>         usage: $0 {start|stop|status|monitor|validate-all|meta-data}
> -       $Id: Filesystem.in,v 1.11 2005/12/20 08:34:47 zhenh Exp $
> +       $Id: Filesystem.in,v 1.12 2006/01/10 17:32:35 alan Exp $
>         EOT
>  }
>
> @@ -323,26 +323,35 @@
>  #
>  Filesystem_status()
>  {
> -       if [ $blockdevice = "yes" ]; then
> -           grep -q -e "^$DEVICE $MOUNTPOINT " /proc/mounts
> -           rc=$?
> +       if
> +          [ $blockdevice = "yes" ]
> +        then
> +          greppat="^$DEVICE $MOUNTPOINT "
>         else
> -           grep -q -e " $MOUNTPOINT " /proc/mounts
> -           rc=$?
> +          greppat=" $MOUNTPOINT "
> +         rc=$?
>         fi
> +       if
> +         grep -q -e "${greppat}" /proc/mounts >/dev/null 2>&1
> +        then
> +         rc=$OCF_SUCCESS
> +          msg="$MOUNTPOINT is mounted (running)"
> +        else
> +          rc=$OCF_NOT_RUNNING
> +          msg="$MOUNTPOINT is unmounted (stopped)"
> +        fi
>
> -       if [ $rc = 0 ] ; then
> -               ocf_log info "$MOUNTPOINT is mounted (running)"
> -               return $OCF_SUCCESS
> -       else
> -               ocf_log info "$MOUNTPOINT is unmounted (stopped)"
> -               return $OCF_NOT_RUNNING
> -       fi
> +        case "$OP" in
> +         status)       ocf_log info "$msg";;
> +       esac
> +        return $rc
>  }
>  # end of Filesystem_status
>
>  #
>  # VALIDATE_ALL: Are the instance parameters valid?
> +#      FIXME!!  The only part that's useful is the return code.

Aren't the log messages useful at all? The reason it always returned
$OCF_SUCCESS was that I was not sure any of the unusual cases (mount
point non-existential or already in use, fs seems unsupported because
we don't detect it by too smart guess) was fatal, as discussed in
bugzilla #320.

And I just realized it does not try to validate $DEVICE...

> +#      This code always returns $OCF_SUCCESS (!)
>  #
>  Filesystem_validate_all()
>  {
>
>
> _______________________________________________
> Linux-ha-cvs mailing list
> [email protected]
> http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
>
--
Thanks & regards
Xun Sun
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to