]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
* add afs-rootvol debian/1.0.snap20001106-3
authorSam Hartman <hartmans@debian.org>
Thu, 16 Nov 2000 06:40:49 +0000 (06:40 +0000)
committerSam Hartman <hartmans@debian.org>
Thu, 16 Nov 2000 06:40:49 +0000 (06:40 +0000)
* update changelog
* update depends for control file

debian/afs-rootvol [new file with mode: 0644]
debian/changelog
debian/control
debian/openafs-dbserver.dirs
debian/openafs-fileserver.dirs
debian/rules

diff --git a/debian/afs-rootvol b/debian/afs-rootvol
new file mode 100644 (file)
index 0000000..1ba8e71
--- /dev/null
@@ -0,0 +1,186 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Term::ReadLine;
+use Getopt::Long;
+
+=head1  NAME
+
+   afs-rootvol - Generate and populate root volumes for new AFS cells.
+
+=head1 SYNOPSIS
+
+B<afs-rootvol> [B<--requirements-met>] [B<--server> server-name] [B<--partition> partition-letter]
+
+=head1 DESCRIPTION
+
+This script sets up an AFS cell's root volumes.  It assumes that you
+already have a fileserver and database servers.  The fileserver should
+have an empty root.afs.
+  This script creates root.cell, user, service and populates root.afs.  
+
+=head1 AUTHOR
+
+Sam Hartman <hartmans@mit.edu>
+
+=cut
+
+use vars qw($rl $server  $part $requirements_met);
+use vars qw( @unwinds);
+
+sub run ($) {
+  print join(' ', @_);
+  print "\n";
+  system (@_)  == 0
+    or die "Filed: $?\n";
+}
+
+# This subroutine takes a command to run in case of failure.  After
+# each succesful step, this routine should be run with a command to
+# undo the successful step.
+
+        sub unwind($) {
+          push @unwinds, $_[0];
+        }
+
+
+# This subroutine creates a volume, mounts it and then sets the access
+# to allow read by anyuser.  The volume is scheduled for deletion in
+# case of error.
+# mkvol(volume, mount)
+                   sub mkvol($$) {
+                     my ($vol, $mnt) = @_;
+                     run("vos create $server $part $vol -localauth");
+                     unwind("vos remove $server $part $vol -localauth");
+                     run("fs mkm $mnt $vol ");
+                     run("fs sa $mnt system:anyuser rl");
+                   }
+
+# main script
+$rl = new Term::ReadLine('AFS');
+
+
+GetOptions (
+           "requirements-met" => \$requirements_met, 
+           "server=s" => \$server,
+           "partition=s" => \$part
+           );
+unless ($requirements_met) {
+      print <<eotext;
+                           Prerequisites
+
+In order to set up the root.afs volume, you must meet the following pre-conditions:
+
+1) The cell must be configured, running a database server with a
+   volume location and protection server.
+
+2)  You must be logged into the cell with  tokens in
+    system:administrators and with a principal that is in the susers
+    file of the servers in the cell.
+
+3) You need a fileserver in the cell with partitions mounted.
+   Presumably, it has no volumes on it, although the script will work
+   so long as root.afs and root.cell do not exist.
+
+4) The AFS client must not be running on this workstation.  The
+   workstation will be moved into the new cell and the client started
+   as part of the process.
+
+eotext
+    $_ = $rl->readline("Do you meet these conditions? (Y/n) ");
+    unless (/^y/i ) {
+       print "Please restart the script when you meet these conditions.\n";
+       exit(1);
+    }
+
+}
+
+open(MOUNT, "mount |") or die "Failed to run mount: $!\n";
+while(<MOUNT>) {
+if(m:^AFS:) {
+print "The AFS client is currently running on this workstation.\n";
+print "Please restart this script after running /etc/init.d/openafs-client stop\n";
+exit(1);
+}
+}
+close MOUNT;
+
+
+# Get configuration information we need
+
+open(CELL, "/etc/openafs/server/ThisCell")
+or die "Unable to find out what cell this machine serves: $!\n";
+my $cell = <CELL>;
+close CELL;
+chomp $cell;
+
+unless ($server) {
+  print <<eotext; 
+You will need to select a server (hostname) and AFS
+partition on which to create the root volumes.
+eotext
+
+  $server = $rl->readline("What AFS Server should volumes be placed on? ");
+  die "Please select a server.\n" unless $server;
+}
+unless ($part) {
+  $part = $rl    ->readline("What partition? [a] ");
+$part = "a" unless $part;
+}
+
+
+
+
+run("echo $cell >/etc/openafs/ThisCell");
+
+run("vos create $server $part root.afs -localauth -cell $cell");
+unwind("vos remove $server $part root.afs -localauth");
+
+
+run("/etc/init.d/openafs-client start");
+unwind("/etc/init.d/openafs-client stop");
+
+run("aklog snorklewacker.mit.edu -k ZONE.MIT.EDU");
+
+run("fs sa /afs system:anyuser rl");
+
+run("vos create $server $part root.cell -localauth");
+unwind("vos remove $server $part root.cell -localauth");
+# We make root.cell s:anyuser readable after we mount in the next
+# loop.
+
+
+open(CELLSERVDB, "/etc/openafs/CellServDB")
+    or die "Unable to open /etc/openafs/CellServDB: $!\n";
+while(<CELLSERVDB>) {
+    chomp;
+    if (/^>\s*([a-z0-9_\-.]+)/ ) {
+       run("fs mkm /afs/$1 root.cell -cell $1 ");
+    }
+}
+
+run("fs sa /afs/$cell system:anyuser rl");
+run ("fs mkm /afs/.$cell root.cell -cell $cell -rw");
+run("fs mkm /afs/.root.afs root.afs -rw");
+
+mkvol( "user", "/afs/$cell/user" );
+mkvol( "service", "/afs/$cell/service" );
+
+$cell =~ /^([^.]*)/;
+my $cellpart = $1;
+run("ln -s /afs/$cell /afs/$cellpart");
+run( "ln -s /afs/.$cell /afs/.$cellpart" );
+
+run( "vos addsite $server $part root.afs -localauth" );
+run( "vos addsite $server $part root.cell -localauth" );
+run( "vos release root.afs -localauth" );
+run( "vos release root.cell -localauth" );
+unwind( "vos remove $server $part root.cell.readonly -localauth ");
+unwind( "vos remove $server $part root.afs.readonly -localauth ");
+
+#@unwinds = ();
+
+END {
+  run(pop @unwinds) while @unwinds;
+  }
+
index e70cebbe2c077b70019c35ebb1aeee4d6c4e70e2..ae7d643f0b3921d1e137df7b6b12d52b05e9e106 100644 (file)
@@ -1,3 +1,20 @@
+openafs (1.0.snap20001106-3) unstable; urgency=low
+
+  * Increase stacksize for server processes so they don't dump core.
+  * New script: afs-rootvol--creates the root.afs and root.cell.  Works
+    fairly well except that it is overly verbose and that it has my test
+    cell hardcoded.  This script will evolve into part of a new cell
+    config tool. 
+
+
+  --
+  * Support removing module for smP
+  * Prune build directories out of modules sources--oops
+  * Fix bogus depends for module sources--note that it really does want
+    bison and flex at least for now.
+
+ --  Sam Hartman <hartmans@mit.edu>  Thu, 16 Nov 2000 01:39:48 -0500
+
 openafs (1.0.snap20001106-2) unstable; urgency=low
 
   * Fix directories for servers to be FHS-reasonable
index 4bfa4733fcbc4bce54823553f72980b7d5fe5441..dfef03a71a68a2b6866cf5b2371e090e4d9b3de1 100644 (file)
@@ -30,7 +30,7 @@ Description: The AFS distributed filesystem- file server
 
 Package: openafs-dbserver
 Architecture: i386
-Depends: ${shlibs:Depends}, debconf, openafs-fileserver (= ${Source-Version})
+Depends: ${shlibs:Depends}, debconf, openafs-fileserver (= ${Source-Version}), perl5
 Description: The AFS distributed filesystem- database server
    AFS is a distributed filesystem allowing cross-platform sharing of
    files among multiple computers.  Facilities are provided for access
@@ -52,7 +52,7 @@ Description: The AFS distributed filesystem- development libraries
 
 Package: openafs-modules-source
 Priority: extra
-Depends: libncurses5-dev, libpam0g-dev
+Depends: bison, flex
 Architecture: all
 Description: The AFS distributed filesystem- Module Sources
    AFS is a distributed filesystem allowing cross-platform sharing of
index 2cbb1448090e64d33496a3daca097ffd7c8d371f..7906da13b473c66e60863bda232baf525ad9a585 100644 (file)
@@ -1 +1,3 @@
 var/lib/openafs/db
+usr/share/man/man8
+usr/sbin
index ebf55bc2d859328e2761f8f41219fd75515a98a2..47613841bce181f3229ad0ee263746afda99fc99 100644 (file)
@@ -2,3 +2,4 @@ var/log/openafs
 etc/openafs/server
 etc/openafs/server-local
 var/lib/openafs/cores
+
index e44e4068d46fbac54294f7bc8a1185f7a3993108..12d8725007a1ab9aab4726cb2ecb6198689e42b7 100755 (executable)
@@ -77,6 +77,9 @@ install: build
        cp dest/root.client/usr/vice/etc/afs.rc debian/openafs-client/etc/init.d/openafs-client
        chmod 755 debian/openafs-client/etc/init.d/openafs-client
        cp dest/root.client/usr/vice/etc/afs.conf debian/openafs-client/etc/openafs/afs.conf
+       install -m 755 -o root -g root debian/afs-rootvol debian/openafs-dbserver/usr/sbin
+       (cd debian&&pod2man --section 8 --center "Debian GNU/Linux"  \
+               afs-rootvol ) >debian/openafs-dbserver/usr/share/man/man8/afs-rootvol.8
 
 # Build architecture-independent files here.
 # Pass -i to all debhelper commands in this target to reduce clutter.
@@ -180,7 +183,9 @@ binary-source:
 # Clean up the sources 
        install -d debian/$(srcpkg)/usr/src/modules/$(package)
        find . \( -name \*.o -o -path ./debian/$(srcpkg) -o -path \*/CVS -o -path ./src/WINNT  \
-               -o -path ./obj -o -path ./$(SYS_NAME) \) -prune -o -print | \
+               -o -path ./obj -o -path ./$(SYS_NAME)  \
+       -o \( -path ./debian/\* -type d \) \
+       -o -path ./debian/\*debhelper \) -prune -o -print | \
                cpio -admp debian/$(srcpkg)/usr/src/modules/$(package)
        ( cd debian/$(srcpkg)/usr/src/modules/$(package); \
                $(MAKE) -f debian/rules clean)