- Timestamp:
- Mar 10, 2013, 6:17:47 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r1712 r1714 1915 1915 my $tmout = undef; 1916 1916 my $path = undef; 1917 1917 1918 if ($cmt =~ /^VM/) { 1918 1919 $login = "vmlogin"; … … 2746 2747 my $nontp = shift || 0; 2747 2748 2749 pb_log(1,"Entering pb_date2v\n"); 2748 2750 # VE gets time from parent OS. 2749 2751 return "/bin/true" if ($vtype) =~ /^ve/o; 2750 2752 2751 2753 my ($ntp) = pb_conf_get_if($vtype."ntp"); 2752 my $vntp = $ntp->{$ENV{'PBPROJ'}} if (defined $ntp);2754 my $vntp = undef; 2753 2755 my $ntpline = undef; 2756 $vntp = $ntp->{$ENV{'PBPROJ'}} if (defined $ntp); 2754 2757 2755 2758 if ((defined $vntp) && ($vntp !~ /^\s*$/)) { 2759 pb_log(2,"ntp server is $vntp\n"); 2756 2760 # ntp command depends on pbos 2757 my $vntpcmd = pb_distro_get_param($pbos,pb_conf_get( $vtype."ntpcmd"));2761 my $vntpcmd = pb_distro_get_param($pbos,pb_conf_get("oscmdntp")); 2758 2762 $ntpline = "sudo $vntpcmd $vntp"; 2759 2763 } … … 2765 2769 my $dateline = "sudo /bin/date $upddate"; 2766 2770 if ((defined $ntpline) && ($nontp == 0)) { 2771 pb_log(1,"pb_date2v returns $ntpline\n"); 2767 2772 return($ntpline); 2768 2773 } else { 2774 pb_log(1,"pb_date2v returns $dateline\n"); 2769 2775 return($dateline); 2770 2776 } … … 3408 3414 print PBOUT "$pbac->{$ENV{'PBPROJ'}} ALL=(ALL) NOPASSWD:ALL\n"; 3409 3415 EOF 3410 }3416 } 3411 3417 print SCRIPT << 'EOF'; 3412 3418 close(PBOUT); … … 3419 3425 # Sync date 3420 3426 # do it after sudoers is setup 3421 print SCRIPT "pb_system(\"$ntpline\",\"Updating time with $ntpline\",\"mayfail\");\n"; 3427 print SCRIPT "my \$res = pb_system(\"$ntpline\",\"Updating time with $ntpline\",\"mayfailverbose\");\n"; 3428 print SCRIPT "if (\$res != 0) {\n"; 3429 # try again with another method 3430 $ntpline = pb_date2v($vtype,$pbos,1); 3431 print SCRIPT " pb_system(\"$ntpline\",\"Updating time with $ntpline\",\"mayfailverbose\");\n"; 3432 print SCRIPT "}\n"; 3422 3433 } 3423 3434 … … 4382 4393 4383 4394 my $pbos = shift; 4395 my @cmds = @_; 4384 4396 my %sudocmds; 4385 4397 4386 pb_log(2,"pb_get_sudocmds entering with lines:".Dumper(@ _)."\n");4387 foreach my $c (split(/;/,$pbos->{'update'}),split(/;/,$pbos->{'install'}),@ _) {4398 pb_log(2,"pb_get_sudocmds entering with lines:".Dumper(@cmds)."\n"); 4399 foreach my $c (split(/;/,$pbos->{'update'}),split(/;/,$pbos->{'install'}),@cmds) { 4388 4400 pb_log(2,"pb_get_sudocmds analyses $c\n"); 4389 4401 next if ($c !~ /^\s*sudo/);
Note:
See TracChangeset
for help on using the changeset viewer.