From 8f8ac0a1bba6dd4a8b81b9923dd61a3f93ada8db Mon Sep 17 00:00:00 2001 From: nott Date: Mon, 7 Jun 2010 12:04:48 +0000 Subject: [PATCH] set permissions in lpp_source git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6362 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/updatenode.pm | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index ec36309e7..7f71e389b 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -259,6 +259,7 @@ sub preprocess_updatenode $::RERUNPS = $ARGV[0]; $ARGV[0] = ""; } + } } else @@ -1851,9 +1852,35 @@ sub updateAIXsoftware # $serv is the name of the nodes server as known by the node if (scalar(@pkglist)) { - +#ndebug foreach my $serv (@servers) { + + # make sure the permissions are correct in the lpp_source + my $chmcmd = qq~/bin/chmod -R +r $pkgdir~; + + # if server is me then just do chmod + if (xCAT::InstUtils->is_me($serv)) { + my @result = xCAT::Utils->runcmd("$chmcmd", -1); + if ($::RUNCMD_RC != 0) + { + my $rsp; + push @{$rsp->{data}}, "Could not set permissions for $pkgdir.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + + } else { # if server is remote then use xdsh + my $output = xCAT::Utils->runxcmd({command => ["xdsh"], node => [$serv], arg => [$chmcmd]}, $subreq, -1, 1); + if ($::RUNCMD_RC != 0) + { + my $rsp; + push @{$rsp->{data}}, "Could not set permissions for $pkgdir.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + } + # mount source dir to node my $mcmd = qq~mkdir -m 644 -p /xcatmnt; mount $serv:$pkgdir /xcatmnt~;