Changeset 1786 in ProjectBuilder


Ignore:
Timestamp:
Aug 1, 2013, 10:02:49 PM (11 years ago)
Author:
Bruno Cornec
Message:
  • Add a command checkps -interface to the internal pb_check_ps)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r1780 r1786  
    376376
    377377Check the delivery of the packages on the repository
     378
     379=item B<checkps>
     380
     381Check the process running the VM concerned
    378382
    379383=item B<newver>
     
    956960} elsif ($action =~ /^checkssh$/) {
    957961    pb_announce("Check");
     962} elsif ($action =~ /^checkps$/) {
     963    my ($ptr2) = pb_conf_get("vmcmd");
     964    my $vmcmd = $ptr2->{$ENV{'PBPROJ'}};
     965    my ($vmexist,$vmmport) = pb_check_ps($vmcmd,$ENV{'PBV'});
     966    if (! $vmexist) {
     967        pb_log(0,"No VM found for $ENV{'PBV'}\n");
     968    } else {
     969        pb_log(0,"Found an existing VM for $ENV{'PBV'} PID: $vmexist - SSH port: $vmmport\n");
     970    }
    958971} elsif ($action =~ /^sbx2webpkg$/) {
    959972    require DBI;
     
    27012714            } else {
    27022715                # Is the SSH port free? if not kill the existing process using it after a build timeout period
    2703                 my $vmssh = pb_check_ps($tmpcmd,"tcp:127.0.0.1:$nport-:22");
     2716                my $vmssh = pb_check_ps($tmpcmd,$vmm);
    27042717                if ($vmssh) {
    27052718                    my $buildtm = $ENV{'PBVMTMOUT'};
     
    41784191        next if (! /$vmcmd/);
    41794192        next if (! /$vmm/);
    4180         my ($void1, $void2);
     4193        my $void1;
    41814194        ($void1, $vmexist, $vmport) = split(/ +/,$_,3);
    41824195        pb_log(2,"pb_check_ps $vmport\n");
    4183         $vmport =~ s/.*=tcp\:127\.0\.0\.1\:([0-9]+)-:22.*/$1/;
     4196        $vmport =~ s/.*=tcp:127\.0\.0\.1:([0-9]+)-:22.*/$1/;
    41844197        chomp($vmport);
    41854198        pb_log(2,"pb_check_ps found a VM $vmexist using port $vmport\n");
Note: See TracChangeset for help on using the changeset viewer.