[Ocfs2-tools-devel] [PATCH] A new ocfs2 configure file verify tool.

shawn xiaowei.hu at oracle.com
Wed Nov 28 23:20:06 PST 2007


On Thu, 2007-11-29 at 14:17 +0800, tao.ma wrote:
> ºúÏþΰ wrote:
> > A tool used for verify the ocfs2 configure file.Implemented using BASH
> > script.for detail information,see this wiki page:
> > http://oss.oracle.com/osswiki/OCFS2/DesignDocs/ClusterVerificationUtility
> > Signed-off-by: xiaowei.hu <http://xiaowei.hu> <xiaowei.hu at oracle.com 
> > <mailto:xiaowei.hu at oracle.com>>
> > ---
> >  ocfs2verify/verif.sh |  661
> > ++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 files changed, 661 insertions(+), 0 deletions(-)
> >  create mode 100755 ocfs2verify/verif.sh
> >
> > +check_ip()
> > +{
> > +local part1
> > +local part2
> > +local part3
> > +local part4
> > +#echo "---$1---"
> > +if (echo $1|egrep "^([0-9]{1,3}\.){3}[0-9]{1,3}$">/dev/null)
> > +then
> > +       part1=`echo $1|awk 'BEGIN{FS="."}{print $1}'`
> > +       part2=`echo $1|awk 'BEGIN{FS="."}{print $2}'`
> > +       part3=`echo $1|awk 'BEGIN{FS="."}{print $3}'`
> > +       part4=`echo $1|awk 'BEGIN{FS="."}{print $4}'`
> > +       #echo "$part1-$part2-$part3-$part4"
> > +       if [[ $part1 < 255 ]] #&& $part2 < 255 && $part3 < 255 && $part4 <
> > 255 ]]
> Check all the parts?

Yes,that's a mistake, I have changed it in the resend email
attachment.sorry for my mistake!


> > +       then
> > +               return $VALID
> > +       fi
> > +fi
> > +       return $INVALID
> > +}
> > +
> > +#parameter $value $node_num
> > +check_number()
> > +{
> > +local ret
> > +if ( [[ -n $1 ]] && (( $1 < 255 || $1 > 0 )) )
> It should be "if ( [[ -n $1 ]] && (( $1 < 255 && $1 > 0 )) )"?

Yes ,it should be && ,another mistake:(,sorry again

> > +get_ssh()
> > +{
> > +if ( check_ip $1;(( $? == $VALID )) )
> > +then
> > +       #echo "connecting"
> > +       if [[ -f "$TEMP_DIR/$value" ]]
> > +       then
> > +               echo -e "$line\e[0;31m......[Duplicated ip_address!]\e[0m"
> > +               continue
> > +       else
> > +               #echo "sshing.............."
> > +               #echo "$TEMP_DIR/$1"
> > +               #echo "$COMMAND"
> > +               ssh 255.255.255.255 >/dev/null 
> > 2>&1
> You'd better explain why you want to ssh this ip address?

That's because the different version of ssh,returns different values in
EL4 and EL5
for ssh in EL5,it returns 254 for connection failure, 1 for connection
success but the specified commands execution failed and 0 for no error.

But the ssh in EL4 ,it returns 1 for both ssh connection failure and the
command execuation failure.

As we know 255.255.255.255 is a invalid host ip address,ssh to this
address must fail.
So I can get to know how the ssh behavior on those two error conditions.







More information about the Ocfs2-tools-devel mailing list