Changeset 2150 in ProjectBuilder for devel/pb


Ignore:
Timestamp:
Dec 22, 2016, 6:50:45 PM (7 years ago)
Author:
Bruno Cornec
Message:

The cidfile should be different for each container to avoid conflicts when launching multiple containers at the same time

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r2139 r2150  
    24582458    my $dkaccount = "";
    24592459    my $cmd1 = "";
     2460    my $cidfile = "$context/ctn-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.cid";
    24602461    my $homedir = "";
    24612462    if ($cmt =~ /^VE/) {
     
    25182519            } else {
    25192520                # As we are in run phase use docker run. cmd will be completed below
    2520                 $shcmd = "$cmd1 run --cidfile=\"$ENV{'PBTMP'}/ctn.cid\" --user $dkaccount --name $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}-$cmt";
     2521                $shcmd = "$cmd1 run --cidfile=\"$cidfile\" --user $dkaccount --name $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}-$cmt";
    25212522            }
    25222523            #$shcmd = "$cmd1 build $dockeropt->{$ENV{'PBPROJ'}} -t $tag{$pbstep+1} $context";
     
    25372538            if ($pbstep >= 2) {
    25382539                # We need to get the home dir of the target account to deliver in the right place
    2539                 $homedir = `$cmd1 run --cidfile="$ENV{'PBTMP'}/ctn.cid" $tag{$pbstep} grep -E '^$dkaccount:' /etc/passwd | cut -d: -f6`;
     2540                $homedir = `$cmd1 run --cidfile="$cidfile" $tag{$pbstep} grep -E '^$dkaccount:' /etc/passwd | cut -d: -f6`;
    25402541                chomp($homedir);
    2541                 open(CID,"$ENV{'PBTMP'}/ctn.cid") || confess "Unable to open $ENV{'PBTMP'}/ctn.cid";
     2542                open(CID,"$cidfile") || confess "Unable to open $cidfile";
    25422543                my $cid = <CID>;
    25432544                close(CID);
    25442545                pb_system("$cmd1 rm $cid","","quiet");
    2545                 unlink("$ENV{'PBTMP'}/ctn.cid");
     2546                unlink("$cidfile");
    25462547            } else {
    25472548                $homedir = "/";
Note: See TracChangeset for help on using the changeset viewer.