add sudo dcp -F support SF 3403

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15402 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2013-03-06 17:48:53 +00:00
parent 361cd8c42b
commit 93bcbc5e71
2 changed files with 16 additions and 3 deletions

View File

@ -839,6 +839,7 @@ sub fork_fanout_dcp
$rcp_config{'preserve'} = $$options{'preserve'};
$rcp_config{'recursive'} = $$options{'recursive'};
$rcp_config{'sudo'} = $$options{'sudo'};
if ($$options{'pull'})
{
@ -4598,8 +4599,8 @@ sub parse_and_run_dcp
close FILE;
# now put the original syncfile on the queue to sync to the SN's
$rc =
&parse_rsync_input_file_on_MN(\@nodelist, \%options, $tmpsyncfile,
$::SYNCSN, $synfiledir,$nodesyncfiledir);
&parse_rsync_input_file_on_MN(\@nodelist, \%options,$tmpsyncfile,
$::SYNCSN, $synfiledir,$nodesyncfiledir);
# cleanup
my $cmd = "rm $tmpsyncfile";
my @output = xCAT::Utils->runcmd($cmd, 0);

View File

@ -98,13 +98,21 @@ sub remote_copy_command
{
if (-e ("/usr/bin/rsync")) {
if (($usersh == 0) || ($localhost == 1)) { # using ssh, or local
if ($$config{'sudo'}){
$sync_opt = '--rsync-path=sudo /usr/bin/rsync ';
} else {
$sync_opt = '--rsync-path /usr/bin/rsync ';
}
} else {
$sync_opt = '--rsh /bin/rsh --rsync-path /usr/bin/rsync ';
}
} else {
if (($usersh == 0) || ($localhost == 1)) { # using ssh, or local
$sync_opt = '--rsync-path /usr/local/bin/rsync ';
if ($$config{'sudo'}){
$sync_opt = '--rsync-path=sudo /usr/local/bin/rsync ';
} else {
$sync_opt = '--rsync-path=/usr/local/bin/rsync ';
}
} else {
$sync_opt = '--rsh /bin/rsh --rsync-path /usr/local/bin/rsync ';
}
@ -112,7 +120,11 @@ sub remote_copy_command
}
else #linux
{
if ($$config{'sudo'}) {
$sync_opt = '--rsync-path=\'sudo /usr/bin/rsync\' ';
} else {
$sync_opt = '--rsync-path /usr/bin/rsync ';
}
}
# if only syncing the service node or
# (no postscripts and no append lines) then do not