Changeset 30184e4
- Timestamp:
- Sep 27, 2007 1:53:16 PM (17 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 5166ad4
- Parents:
- 45ed8ee
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedkit/smbmount.pl
r45ed8ee r30184e4 3 3 ############################################################################# 4 4 # smbmounts.pl: Setup Automounter to mount via SMB for federated experiments 5 # $Id: smbmount.pl,v 1. 3 2007-09-27 02:50:14jhickey Exp $5 # $Id: smbmount.pl,v 1.4 2007-09-27 20:53:16 jhickey Exp $ 6 6 # 7 7 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"; 11 12 $FSTAB="/etc/fstab"; 12 13 $HOMEROOT="/users"; 14 $PROJROOT="/proj"; 13 15 $AMDROOT="/auto"; 14 16 $AMDMAP="/etc/amd.users"; 17 $PAMDMAP="/etc/amd.proj"; 15 18 19 chomp $ADDR; 20 21 $TMCC="/usr/local/etc/emulab/tmcc"; 16 22 $UMOUNT="/sbin/umount"; 17 23 $MOUNT="/sbin/mount"; … … 36 42 open(TM, "$TMCC accounts windows |") or die("Failed to execute TMCC"); 37 43 open(CONFIG, ">/etc/nsmb.conf") or die("Failed to open /etc/nsmb.conf"); 38 open(MAP, ">$AMDMAP") or die("Failed to open /etc/amd.users"); 44 open(MAP, ">$AMDMAP") or die("Failed to open $AMDMAP"); 45 open(PMAP, ">$PAMDMAP") or die("Failed to open $PAMDMAP"); 39 46 open(FSTAB,">>$FSTAB") or die("Cannot Open File $FSTAB"); 40 47 … … 70 77 print MAP "mount:=\"$MOUNT mount $AMDROOT$homedir\";\\\n"; 71 78 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 } 72 101 } 73 102 } … … 76 105 close(FSTAB); 77 106 close(MAP); 107 close(PMAP); 78 108 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");109 print "Starting the automounter: $AMD -l syslog -a $AMDROOT $HOMEROOT $AMDMAP $PROJROOT $PAMDMAP\n"; 110 system("$AMD -l syslog -a $AMDROOT $HOMEROOT $AMDMAP $PROJROOT $PAMDMAP") && die("Unable to start amd");
Note: See TracChangeset
for help on using the changeset viewer.