Changeset 349


Ignore:
Timestamp:
04/03/08 10:55:27 (5 years ago)
Author:
bruno
Message:

First working steps for setupvm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r348 r349  
    918918 
    919919    # ssh communication if not VE 
     920    # should use a hash instead... 
    920921    my ($shcmd,$cpcmd,$cptarget,$cp2target); 
    921922    if ($cmt ne "ve") { 
     
    12491250# Name of the account to deal with for VM/VE 
    12501251# Do not use the one passed potentially with -a 
    1251 my $pbaccount = pb_conf_get($vtype."login"); 
     1252my ($pbaccount) = pb_conf_get($vtype."login"); 
    12521253 
    12531254if ($vtype eq "vm") { 
     
    12791280EOF 
    12801281print SCRIPT << "EOF"; 
    1281     \$found = 1 if (/^$pbaccount:/); 
     1282    \$found = 1 if (/^$pbaccount->{$ENV{'PBPROJ'}}:/); 
    12821283EOF 
    12831284print SCRIPT << 'EOF'; 
     
    12911292EOF 
    12921293print SCRIPT << "EOF"; 
    1293 system "groupadd $pbaccount"; 
    1294 system "useradd $pbaccount -g $pbaccount -m -d /home/$pbaccount"; 
     1294system "groupadd $pbaccount->{$ENV{'PBPROJ'}}"; 
     1295system "useradd $pbaccount->{$ENV{'PBPROJ'}} -g $pbaccount->{$ENV{'PBPROJ'}} -m -d /home/$pbaccount->{$ENV{'PBPROJ'}}"; 
    12951296 
    12961297# For pb 
    1297 chdir "/home/$pbaccount"; 
     1298chdir "/home/$pbaccount->{$ENV{'PBPROJ'}}"; 
    12981299mkdir ".ssh",0700; 
    12991300# Allow those accessing root to access the build account 
    13001301copy("\$ENV{'HOME'}/.ssh/authorized_keys",".ssh/authorized_keys"); 
    13011302chmod 0600,".ssh/authorized_keys"; 
    1302 system 'chown -R $pbaccount:$pbaccount .ssh'; 
     1303system 'chown -R $pbaccount->{$ENV{'PBPROJ'}}:$pbaccount->{$ENV{'PBPROJ'}} .ssh'; 
    13031304 
    13041305EOF 
     
    13131314EOF 
    13141315print SCRIPT << "EOF"; 
    1315     s/^$pbaccount:\!\!:/$pbaccount:*:/; 
    1316     s/^$pbaccount:\!:/$pbaccount:*:/;   #SLES 9 e.g. 
     1316    s/^$pbaccount->{$ENV{'PBPROJ'}}:\!\!:/$pbaccount->{$ENV{'PBPROJ'}}:*:/; 
     1317    s/^$pbaccount->{$ENV{'PBPROJ'}}:\!:/$pbaccount->{$ENV{'PBPROJ'}}:*:/;   #SLES 9 e.g. 
    13171318EOF 
    13181319print SCRIPT << 'EOF'; 
     
    13331334EOF 
    13341335print SCRIPT << "EOF"; 
    1335     next if (/^$pbaccount   /); 
     1336    next if (/^$pbaccount->{$ENV{'PBPROJ'}}   /); 
    13361337EOF 
    13371338print SCRIPT << 'EOF'; 
     
    13421343EOF 
    13431344print SCRIPT << "EOF"; 
    1344 # This is needed in order to be able to halt the machine from the $pbaccount account at least 
    1345 print PBOUT "$pbaccount   ALL=(ALL) NOPASSWD:ALL\n"; 
     1345# This is needed in order to be able to halt the machine from the $pbaccount->{$ENV{'PBPROJ'}} account at least 
     1346print PBOUT "$pbaccount->{$ENV{'PBPROJ'}}   ALL=(ALL) NOPASSWD:ALL\n"; 
    13461347EOF 
    13471348print SCRIPT << 'EOF'; 
     
    13681369EOF 
    13691370 
    1370 # Adds pb_distro_init from Project-Builder::Distribution 
     1371# Adds pb_distro_init from ProjectBuilder::Distribution 
    13711372foreach my $d (@INC) { 
    1372     my $f = "$d/Project-Builder/Distribution.pm"; 
     1373    my $f = "$d/ProjectBuilder/Distribution.pm"; 
    13731374    if (-f "$f") { 
    13741375        open(PBD,"$f") || die "Unable to open $f"; 
Note: See TracChangeset for help on using the changeset viewer.