dewrich closed pull request #1398: Get ats_uid after packages are installed URL: https://github.com/apache/incubator-trafficcontrol/pull/1398
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/traffic_ops/bin/traffic_ops_ort.pl b/traffic_ops/bin/traffic_ops_ort.pl index 3150c17e30..3bc04b9b11 100755 --- a/traffic_ops/bin/traffic_ops_ort.pl +++ b/traffic_ops/bin/traffic_ops_ort.pl @@ -202,8 +202,6 @@ my $header_comment = &get_header_comment($traffic_ops_host); -my $ats_uid = getpwnam("ats"); - if ( !defined $traffic_ops_host ) { print "FATAL Could not resolve Traffic Ops host!\n"; exit 1; @@ -1474,6 +1472,7 @@ sub replace_cfg_file { my $cfg_file = shift; my $return_code = 0; my $select = 2; + if ( $script_mode == $INTERACTIVE ) { ( $log_level >> $ERROR ) && print @@ -1495,6 +1494,7 @@ sub replace_cfg_file { chown 0, 0, "$cfg_file_tracker->{$cfg_file}->{'location'}/$cfg_file"; } else { + my $ats_uid = getpwnam("ats"); chown $ats_uid, $ats_uid, "$cfg_file_tracker->{$cfg_file}->{'location'}/$cfg_file"; } $cfg_file_tracker->{$cfg_file}->{'change_applied'}++; @@ -2769,6 +2769,7 @@ sub backup_file { my $file = $filepath . "/" . $filename; if ( $script_mode != $REPORT ) { + my $ats_uid = getpwnam("ats"); my $bkp_dir; my $bkp_file; if ( -e $file ) { ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services