Operating System - HP-UX
1771236 Members
2621 Online
109004 Solutions
New Discussion

Re: Serviceguard NFS: exportfs: invalid argument

 
Petr Wünsch
Advisor

Serviceguard NFS: exportfs: invalid argument

Hello all,

I have some troubles with hanfs.sh and exportfs in Serviceguard environment.

When I halt NFS package it fails:
# cmhaltpkg sgnfs
Halting package sgnfs
The package script for sgnfs failed with no restart. sgnfs should not be restarted
Unable to halt package sgnfs
Check the syslog and pkg log files for more detailed information

sgnfs.log shows:
ERROR: Failed to stop NFS
ERROR: Function verify_ha_nfs
HANFS -- Aug 16 18:53:51 - Node "lab09a1": Restarting rpc.lockd
HANFS -- Aug 16 18:53:51 - Node "lab09a1": Restarting rpc.statd
killing rpc.statd pid = 1625
killing rpc.lockd pid = 1629
ERROR: Failed to unexport /mnt/SGnfs
ERROR: Function nfs_un_export_fs

Funny thing is the NFS is unexported correctly.

I looked up the part which does exportfs -u in hanfs.sh script:
function nfs_un_export_fs
{
for I in "${XFS[@]}"
do
#
# INDaa25642
# This was added because in the case of unexport
# we only want the dir name
#
I=${I##* }
while :
do
UN_EXPORT_ERROR=`exportfs -u $I 2>&1`
XTAB_IN_USE=`echo $UN_EXPORT_ERROR | grep -E 'xtab in use|Cannot open'`
#
# Check to see if the message returned by
# calling exportfs is "xtab in use"

if [[ -n "$XTAB_IN_USE" ]]; then
#
# xtab is in use so randomly sleep for
# a while before retrying to unexport again
#
SECOND=$(($RANDOM%3+1))
print "HANFS -- $(date '+%b %e %X') - WARNING:Node \"$(hostname)\" - exportfs -u $I: $UN_EXPORT_ERROR. Retrying in $SECOND second(s)"
sleep $SECOND
else
#
# xtab is not in use so check
# to see if there is any error
#
if [[ -n "$UN_EXPORT_ERROR" ]] ; then
#
# `let 0` is used to set the value of $? to 1.
# The function nfs_test_return requires $? to
# be set to 1 if it has to print an error message.
#
let 0
nfs_test_return 3
else
print "HANFS -- $(date '+%b %e %X') - Node \"$(hostname)\": Unexporting filesystem on $I"
fi
break
fi
done
done
}

So the error message comes from:
UN_EXPORT_ERROR=`exportfs -u $I 2>&1`
I have checked the variable $I is correct.
And, as I already said, the dir gets unexported successfully.
If I put:
unset UN_EXPORT_ERROR
into the script it works fine. I can run/halt package on any node and NFS works as expected. But it is of course VERY bad fix.

Any experinece with this behavior?

Some details:
SG is A.11.18
HP-UX 11.23
NFS toolkit A.11.23.07

System recently patched with B.11.23.0712.070a QKPAPPS
1 REPLY 1
Deepak Kr
Respected Contributor

Re: Serviceguard NFS: exportfs: invalid argument

Have you checked with HP technical support regarding this behaviour?

Is this patch bundle contains updates or fixes for NFS or SG?
"There is always some scope for improvement"