- Timestamp:
- May 17, 2008 5:09:31 PM (16 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 387408b
- Parents:
- 2396559e
- Location:
- fedkit
- Files:
-
- 3 added
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
fedkit/fed_bootstrap
r2396559e rf3691ff 22 22 23 23 # The copy 24 for f in federate.sh smbmount .pl; do24 for f in federate.sh smbmount*.pl *.patch; do 25 25 cp $SCRIPTDIR/$f /tmp && chmod 755 /tmp/$f 26 26 done -
fedkit/federate.sh
r2396559e rf3691ff 21 21 # automount process. 22 22 RCACCT="rc.accounts" 23 SMBMOUNT="smbmount.pl" 23 SMBMOUNT="smbmount.`uname`.pl" 24 25 # Find the right version of pkill. For killing. 26 if [ -x "/usr/bin/pkill" ] ; then 27 PKILL="/usr/bin/pkill" 28 else 29 if [ -x "/bin/pkill" ] ; then 30 PKILL="/bin/pkill" 31 else 32 PKILL="echo" 33 fi 34 fi 35 36 if [ -x "/usr/bin/perl" ]; then 37 PERL="/usr/bin/perl" 38 else 39 if [ -x "/usr/local/bin/perl" ]; then 40 PERL="/usr/local/bin/perl" 41 else 42 # Wing it... 43 PERL="perl" 44 fi 45 fi 24 46 25 47 # Find somewhere safe to stop … … 34 56 35 57 # Find this experiment's stashed scripts. (Perl for advanced parsing) 36 SCRIPTDIR=`$EMUDIR/tmcc -b status | perl-ne '/ALLOCATED=([^\/]+)\/([^\s]+)/ && print "/proj/$1/exp/$2/tmp\n";'`58 SCRIPTDIR=`$EMUDIR/tmcc -b status | $PERL -ne '/ALLOCATED=([^\/]+)\/([^\s]+)/ && print "/proj/$1/exp/$2/tmp\n";'` 37 59 38 60 # Die if Scripts are not where they should be. NB, this is checked by the … … 53 75 # Get our gateway, share, and mount user from the configuration file. 54 76 # There's probably a way to get all three at once, but this works. 55 GATEWAY=`perl -ne '/ControlGateway:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 56 SHARE=`perl -ne '/SMBShare:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 57 SMBUSER=`perl -ne '/ProjectUser:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 77 GATEWAY=`$PERL -ne '/ControlGateway:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 78 SHARE=`$PERL -ne '/SMBShare:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 79 SMBUSER=`$PERL -ne '/ProjectUser:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 80 SMBPROJECT=`$PERL -ne '/ProjectName:\s+(.*)/i && print "$1\n";' $SCRIPTDIR/client.conf` 81 82 # XXX: 83 # The standard emulab rc.accounts script won't replace existing user accounts 84 # with our new ones, so we have to patch it to do so. This is obviously pretty 85 # fragile and needs to change. To make matters worse, our FBSD62-SMB images 86 # contain the patched rc.accounts, so this patching step will fail there. 87 cd "$EMUDIR/rc" 88 patch -f < /tmp/rc.accounts.patch 89 cd /tmp 58 90 59 91 # … … 80 112 81 113 # 82 # Unmount stuff before messing with accounts 114 # Unmount stuff before messing with accounts 115 # Linux doesn't believe in -A so run umount without it if the first fails 83 116 # 84 umount -A -f -t nfs,smbfs85 117 118 umount -A -f -t nfs,smbfs,cifs || umount -a -f -t nfs,smbfs,cifs 86 119 87 120 # 88 121 # Setup new accounts 89 122 # 123 124 # Clear the cache, just in case: 125 rm -f /var/emulab/boot/tmcc/accounts 126 90 127 $RCDIR/rc.accounts reconfig 91 128 92 129 # 93 # Call the smbmount perl script, this invokes the automounter to mount t eh130 # Call the smbmount perl script, this invokes the automounter to mount the 94 131 # needed smb filesystems. 95 132 # 96 133 echo "Mounting via SMB." 97 "/tmp/$SMBMOUNT" $SHARE $GATEWAY $SMBUSER 134 $PERL "/tmp/$SMBMOUNT" $SHARE $GATEWAY $SMBUSER $SMBPROJECT 98 135 99 136 echo "Restoring old bossnode" … … 108 145 # partial topology -e.g. failed or partial bridging - that might have confused 109 146 # the router should be gone. 110 /bin/pkill ospf 111 /bin/pkill gated 147 $PKILL ospf 148 $PKILL gated 149 # XXX Danger, hack ahead. Apparently our FC6-SMB image and emulab disagree 150 # about where gated lives. This will alias it. 151 if [ ! -x /usr/sbin/gated ] ; then 152 if [ -x /sbin/gated ] ; then 153 ln /sbin/gated /usr/sbin/gated 154 fi 155 fi 112 156 /usr/local/etc/emulab/rc/rc.route boot 113 157 -
fedkit/smbmount.FreeBSD.pl
r2396559e rf3691ff 1 #!/usr/ local/bin/perl1 #!/usr/bin/perl 2 2 3 3 ############################################################################# 4 4 # smbmounts.pl: Setup Automounter to mount via SMB for federated experiments 5 # $Id: smbmount. pl,v 1.4 2007-09-27 20:53:16 jhickeyExp $5 # $Id: smbmount.FreeBSD.pl,v 1.1 2008-05-18 00:09:31 faber Exp $ 6 6 # 7 7 -
fedkit/splitter.pl
r2396559e rf3691ff 9 9 use File::Copy; 10 10 11 my @scripts = ("fed_bootstrap", "federate.sh", "smbmount.pl", 12 "make_hosts", "fed-tun.pl", "fed_evrepeater" ); 11 my @scripts = ("fed_bootstrap", "federate.sh", "smbmount.FreeBSD.pl", 12 "smbmount.Linux.pl", "make_hosts", "fed-tun.pl", "fed_evrepeater", 13 "rc.accounts.patch"); 13 14 my $local_script_dir = "."; 14 15 my($pid, $gid); # Process and group IDs for calling parse.tcl … … 492 493 $project_user = $opts{'smbuser'} || # User to mount project dirs as 493 494 die "Must give an SMB user\n"; 494 $auth_proj = $opts{'P'} || die "Must give an authentication project (-P)\n";495 $auth_proj = $opts{'P'}; 495 496 496 497 # tcl program to split experiments (changed during devel) … … 574 575 # If this testbed has not had its access parameters read from fedd, try 575 576 # to read them, if we have a way to talk to fedd 576 unless ($tbparams->{$tb}->{'access'} &&$fedd_client) {577 unless ($tbparams->{$tb}->{'access'} || !$fedd_client) { 577 578 my $access_pipe = new IO::Pipe || 578 579 die "Can't open pipe to fedd:$!\n"; 580 my $proj = $auth_proj ? " -p $auth_proj " : ""; 579 581 580 582 print("Checking access to $tb using " . $tbparams->{$tb}->{'uri'} … … 583 585 my $cmd = "$fedd_client -t " . 584 586 $tbparams->{$tb}->{'uri'} . " -T $ENV{HOME}/cacert.pem ". 585 "-l $tb -p $auth_proj | /usr/bin/tee fedd.$tb ";587 "-l $tb $proj | /usr/bin/tee fedd.$tb "; 586 588 print "$cmd\n" if $verbose; 587 589
Note: See TracChangeset
for help on using the changeset viewer.