add sudo dcp -F support SF 3403
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15403 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user