From b5d1536cc1b14f86482424687b8134b5869c43ea Mon Sep 17 00:00:00 2001 From: ligc Date: Tue, 1 Jun 2010 05:40:46 +0000 Subject: [PATCH] IPv6 support: export /install/postscripts as nfs v3 and v4 compatible git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6280 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/sbin/xcatconfig | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/xCAT-server/sbin/xcatconfig b/xCAT-server/sbin/xcatconfig index 4e4d1a589..ee3ac4d15 100644 --- a/xCAT-server/sbin/xcatconfig +++ b/xCAT-server/sbin/xcatconfig @@ -1480,22 +1480,25 @@ sub setupAIXIPMITool sub setupAIXexports { - - # check if /install/postscripts is in /etc/exports - my $catcmd = - "/bin/cat /etc/exports 2>&1 | grep '$::INSTALLDIR/postscripts ' >/dev/null 2>&1"; - my $outref = xCAT::Utils->runcmd("$catcmd", -1); - if ($::RUNCMD_RC != 0) + # check if /install/postscripts is exported + my $lsnfsexpcmd = + "/usr/sbin/lsnfsexp -d $::INSTALLDIR/postscripts 2>&1"; + my $outref = xCAT::Utils->runcmd("$lsnfsexpcmd", -1); + if (($::RUNCMD_RC != 0) || ($outref !~ /-vers=3:4/)) { - # if not add it and make sure it is exported - my $ecmd = - "echo '$::INSTALLDIR/postscripts -ro' >> /etc/exports; exportfs -a"; - my $outref2 = xCAT::Utils->runcmd("$ecmd", -1); + # if not exported for both NFS version 3 and version 4, + # make sure it is exported with -vers=3:4 + my $rmnfsexpcmd = "/usr/sbin/rmnfsexp -d $::INSTALLDIR/postscripts 2>&1"; + xCAT::Utils->runcmd("$rmnfsexpcmd", -1); + + my $mknfsexpcmd = + "mknfsexp -d $::INSTALLDIR/postscripts '-B' -v '3,4' -t 'ro'"; + my $outref2 = xCAT::Utils->runcmd("$mknfsexpcmd", -1); if ($::RUNCMD_RC != 0) { xCAT::MsgUtils->message('E', - "Could not update the /etc/exports file."); + "Could not export directory $::INSTALLDIR/postscripts."); } } }