Changeset 30184e4 for fedkit


Ignore:
Timestamp:
Sep 27, 2007 1:53:16 PM (17 years ago)
Author:
John Hickey <jhickey@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
5166ad4
Parents:
45ed8ee
Message:

Fixed defaults to federation defaults (was working on code prior to teds
last checkin). Added working /proj mounts as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedkit/smbmount.pl

    r45ed8ee r30184e4  
    33#############################################################################
    44# smbmounts.pl: Setup Automounter to mount via SMB for federated experiments
    5 # $Id: smbmount.pl,v 1.3 2007-09-27 02:50:14 jhickey Exp $
     5# $Id: smbmount.pl,v 1.4 2007-09-27 20:53:16 jhickey Exp $
    66#
    77
    8 $ADDR="users.isi.deterlab.net";
    9 $TMCC="/usr/local/etc/emulab/tmcc";
    10 $SHARE="USERS";
     8$SHARE=shift || "USERS";
     9$ADDR=shift || `cat /usr/local/etc/emulab/bossnode`;
     10$PUSER=shift || "jhickey";
     11$PNAME=shift || "emulab-ops";
    1112$FSTAB="/etc/fstab";
    1213$HOMEROOT="/users";
     14$PROJROOT="/proj";
    1315$AMDROOT="/auto";
    1416$AMDMAP="/etc/amd.users";
     17$PAMDMAP="/etc/amd.proj";
    1518
     19chomp $ADDR;
     20
     21$TMCC="/usr/local/etc/emulab/tmcc";
    1622$UMOUNT="/sbin/umount";
    1723$MOUNT="/sbin/mount";
     
    3642open(TM, "$TMCC accounts windows |") or die("Failed to execute TMCC");
    3743open(CONFIG, ">/etc/nsmb.conf") or die("Failed to open /etc/nsmb.conf");
    38 open(MAP, ">$AMDMAP") or die("Failed to open /etc/amd.users");
     44open(MAP, ">$AMDMAP") or die("Failed to open $AMDMAP");
     45open(PMAP, ">$PAMDMAP") or die("Failed to open $PAMDMAP");
    3946open(FSTAB,">>$FSTAB") or die("Cannot Open File $FSTAB");
    4047
     
    7077                print MAP "mount:=\"$MOUNT mount $AMDROOT$homedir\";\\\n";
    7178                print MAP "unmount:=\"$UMOUNT unmount $AMDROOT$homedir\";";
     79
     80                #
     81                # If we are PUSER, the user assigned to mount the project directory,
     82                # then we add in the mount for that.  The share is called proj-$PNAME
     83                # where PNAME is the name of the project at the mothership.  We need
     84                # a second map for this since we will be mounting under /proj.
     85                # We should really not use share in federation.
     86                #
     87
     88                if($user =~ m/$PUSER/i) {
     89                        print FSTAB "//$user\@$SHARE/proj-$PNAME\t";
     90                        print FSTAB "$AMDROOT/proj\tsmbfs\t";
     91                        print FSTAB "noauto,rw,-N,-f774,-d775,-u$uid,-g$gid\t0\t0\n";
     92
     93                        print PMAP "$PNAME type:=program;fs:=$AMDROOT/proj;\\\n";
     94                        print PMAP "mount:=\"$MOUNT mount $AMDROOT/proj\";\\\n";
     95                        print PMAP "unmount:=\"$UMOUNT unmount $AMDROOT/proj\";\n";
     96
     97                        if(! -d "$AMDROOT/proj") {
     98                                system("$MKDIR -p $AMDROOT/proj") && die("Failed to make directory");
     99                        }
     100                }
    72101        }
    73102}
     
    76105close(FSTAB);
    77106close(MAP);
     107close(PMAP);
    78108
    79 print "Starting the automounter: $AMD -l syslog -a $AMDROOT $HOMEROOT $AMDMAP\n";
    80 system("$AMD -l syslog -a $AMDROOT $HOMEROOT $AMDMAP") && die("Unable to start amd");
     109print "Starting the automounter: $AMD -l syslog -a $AMDROOT $HOMEROOT $AMDMAP $PROJROOT $PAMDMAP\n";
     110system("$AMD -l syslog -a $AMDROOT $HOMEROOT $AMDMAP $PROJROOT $PAMDMAP") && die("Unable to start amd");
Note: See TracChangeset for help on using the changeset viewer.