[OpenAFS] Amanda-afs

Rob See rob@rsee.net
Mon, 05 Sep 2005 19:37:31 -0400


This is a multi-part message in MIME format.
--------------050800030202090206070107
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit


>Have you tried to compile it on OpenAFS 1.3.81?  I had problems and
>got the ideia it is abandoned or no one use it.
>
>  
>
I've been using it in production at my site for a year and a half or so. 
Attached are a couple patches I had to apply to get it to work. Parts 
are site specific, and I'm not a programmer so I can't explain why any 
of the changes were necessary/work. The segf patch may not be necessary 
to apply, but it fixed a segfault I had while running it under Gentoo.

-Rob

--------------050800030202090206070107
Content-Type: text/plain;
 name="amanda-afs-fix.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="amanda-afs-fix.patch"

diff -rC 4 amanda-afs/Makefile amanda-afs.save/Makefile
*** amanda-afs/Makefile	Mon Feb 17 17:21:42 2003
--- amanda-afs.save/Makefile	Mon Aug  1 20:01:11 2005
***************
*** 1,7 ****
  include ./Makefile.conf
  
! AMANDA_AFS_VERSION = amanda-afs version 0.0.3
  
  UTIL = afs_estimate dump_tools volset gtar-wrapper.pl
  COMMON = config.h fileseek.o
  
--- 1,7 ----
  include ./Makefile.conf
  
! AMANDA_AFS_VERSION = amanda-afs version 0.0.4
  
  UTIL = afs_estimate dump_tools volset gtar-wrapper.pl
  COMMON = config.h fileseek.o
  
diff -rC 4 amanda-afs/Makefile.conf amanda-afs.save/Makefile.conf
*** amanda-afs/Makefile.conf	Sat May 11 17:39:59 2002
--- amanda-afs.save/Makefile.conf	Mon Aug  1 20:53:52 2005
***************
*** 5,22 ****
  
  #--------------
  
  # Specify the full path to the destination directory for the utilities
! INSTALL_DIR = /usr/local/amanda/sbin
  
  #--------------
  
  # Specify directory AFS_PREFIX, so that the afs libs are in
  # $(AFS_PREFIX)/lib and $(AFS_PREFIX)/lib/afs
  # OpenAFS will probably have this set to /usr or /usr/local
  # AFS_PREFIX = /usr
  # IBM AFS will probably have this set to /usr/afsws
! AFS_PREFIX = /usr/afsws
  
  #--------------
  
  # Specify location of the vos utility
--- 5,22 ----
  
  #--------------
  
  # Specify the full path to the destination directory for the utilities
! INSTALL_DIR = /usr/lib/amanda-afs
  
  #--------------
  
  # Specify directory AFS_PREFIX, so that the afs libs are in
  # $(AFS_PREFIX)/lib and $(AFS_PREFIX)/lib/afs
  # OpenAFS will probably have this set to /usr or /usr/local
  # AFS_PREFIX = /usr
  # IBM AFS will probably have this set to /usr/afsws
! AFS_PREFIX = /usr
  
  #--------------
  
  # Specify location of the vos utility
***************
*** 26,34 ****
  #
  # NOTE: make sure that vos actually is where you say it is
  #       otherwise, be prepared for 5k dumps on a 10G partition
  #       don't come crying, if you didn't set this correctly!
! AFS_VOS = $(AFS_PREFIX)/etc/vos
  
  #--------------
  
  # Specify directory AFS_INCLUDE, so that the afs headers are
--- 26,34 ----
  #
  # NOTE: make sure that vos actually is where you say it is
  #       otherwise, be prepared for 5k dumps on a 10G partition
  #       don't come crying, if you didn't set this correctly!
! AFS_VOS = /usr/sbin/vos
  
  #--------------
  
  # Specify directory AFS_INCLUDE, so that the afs headers are
***************
*** 54,60 ****
  LDFLAGS = 
  
  AFS_LIBDIR = -L$(AFS_PREFIX)/lib -L$(AFS_PREFIX)/lib/afs#
  LIBS = $(AFS_LIBDIR) -lresolv -lvolser -ldir -laudit $(AFS_PREFIX)/lib/afs/vlib.a -lsys -lvldb -lubik \
! 	-lauth -lcmd -lrxkad -ldes -lrxstat -lrx -llwp -lacl -lsys \
  	$(AFS_PREFIX)/lib/afs/libcom_err.a -lkauth -lusd $(AFS_PREFIX)/lib/afs/util.a -liberty 
  
--- 54,60 ----
  LDFLAGS = 
  
  AFS_LIBDIR = -L$(AFS_PREFIX)/lib -L$(AFS_PREFIX)/lib/afs#
  LIBS = $(AFS_LIBDIR) -lresolv -lvolser -ldir -laudit $(AFS_PREFIX)/lib/afs/vlib.a -lsys -lvldb -lubik \
! 	-lauth -lcmd -lrxkad -ldes -lrxstat -lrx -llwp -lacl -lsys -lresolv \
  	$(AFS_PREFIX)/lib/afs/libcom_err.a -lkauth -lusd $(AFS_PREFIX)/lib/afs/util.a -liberty 
  
diff -rC 4 amanda-afs/afs_estimate/Makefile amanda-afs.save/afs_estimate/Makefile
*** amanda-afs/afs_estimate/Makefile	Sat May 11 17:39:59 2002
--- amanda-afs.save/afs_estimate/Makefile	Mon Aug  1 19:40:56 2005
***************
*** 1,9 ****
  include ../Makefile.conf
  
  AFS_LIBDIR = -L$(AFS_PREFIX)/lib -L$(AFS_PREFIX)/lib/afs#
  LIBS = $(AFS_LIBDIR) -lvolser -ldir -laudit $(AFS_PREFIX)/lib/afs/vlib.a -lsys -lvldb \
! 	-lubik -lauth -lcmd -lrxkad -ldes -lrxstat -lrx -llwp -lacl -lsys \
  	-lcom_err -lkauth -lusd $(AFS_PREFIX)/lib/afs/util.a -liberty #-lefence
  
  
  AFS_EST_CFLAGS = $(CFLAGS) -I$(AFS_INCLUDE) #-O # -Wall
--- 1,9 ----
  include ../Makefile.conf
  
  AFS_LIBDIR = -L$(AFS_PREFIX)/lib -L$(AFS_PREFIX)/lib/afs#
  LIBS = $(AFS_LIBDIR) -lvolser -ldir -laudit $(AFS_PREFIX)/lib/afs/vlib.a -lsys -lvldb \
! 	-lubik -lauth -lcmd -lrxkad -ldes -lrxstat -lrx -llwp -lacl -lsys -lresolv \
  	-lcom_err -lkauth -lusd $(AFS_PREFIX)/lib/afs/util.a -liberty #-lefence
  
  
  AFS_EST_CFLAGS = $(CFLAGS) -I$(AFS_INCLUDE) #-O # -Wall
diff -rC 4 amanda-afs/afs_estimate/afs_estimate.c amanda-afs.save/afs_estimate/afs_estimate.c
*** amanda-afs/afs_estimate/afs_estimate.c	Mon Feb 17 17:06:52 2003
--- amanda-afs.save/afs_estimate/afs_estimate.c	Mon Aug  1 19:38:39 2005
***************
*** 52,60 ****
  #include "config.h"
  
  #define EIGHT_BYTE_INT long long
  
! void DFlushVolume(void) {} ;
  
  EIGHT_BYTE_INT afs_estimate(char *volname, time_t prev_dump);
  
  EIGHT_BYTE_INT SumVnodeIndex(Volume *vp, VnodeClass class, afs_int32 prev_dump);
--- 52,60 ----
  #include "config.h"
  
  #define EIGHT_BYTE_INT long long
  
! extern int DFlushVolume(register afsint_32) {} ;
  
  EIGHT_BYTE_INT afs_estimate(char *volname, time_t prev_dump);
  
  EIGHT_BYTE_INT SumVnodeIndex(Volume *vp, VnodeClass class, afs_int32 prev_dump);
***************
*** 242,251 ****
     size = OS_SIZE(fdP->fd_fd);
     assert(size != -1);
     nVnodes = (size / vcp->diskSize) - 1;
     if (nVnodes > 0) {
!       assert((nVnodes+1)*vcp->diskSize == size)
!       assert(STREAM_SEEK(file, vcp->diskSize, 0) == 0)
     }
     else nVnodes = 0;
     for (vnodeIndex = 0;
  	nVnodes && STREAM_READ(vnode, vcp->diskSize, 1, file) == 1;
--- 242,251 ----
     size = OS_SIZE(fdP->fd_fd);
     assert(size != -1);
     nVnodes = (size / vcp->diskSize) - 1;
     if (nVnodes > 0) {
!       assert((nVnodes+1)*vcp->diskSize == size);
!       assert(STREAM_SEEK(file, vcp->diskSize, 0) == 0);
     }
     else nVnodes = 0;
     for (vnodeIndex = 0;
  	nVnodes && STREAM_READ(vnode, vcp->diskSize, 1, file) == 1;
diff -rC 4 amanda-afs/gtar-wrapper.pl.in amanda-afs.save/gtar-wrapper.pl.in
*** amanda-afs/gtar-wrapper.pl.in	Sat May 11 17:39:59 2002
--- amanda-afs.save/gtar-wrapper.pl.in	Mon Aug  1 20:00:13 2005
***************
*** 1,5 ****
! #!/usr/local/bin/perl
  
  use Getopt::Long;
  use Getopt::Std;
  use POSIX qw(strftime);
--- 1,5 ----
! #!/usr/bin/perl
  
  use Getopt::Long;
  use Getopt::Std;
  use POSIX qw(strftime);
diff -rC 4 amanda-afs/volset/volset-estimate.c amanda-afs.save/volset/volset-estimate.c
*** amanda-afs/volset/volset-estimate.c	Sat May 11 17:39:59 2002
--- amanda-afs.save/volset/volset-estimate.c	Mon Aug  1 19:40:21 2005
***************
*** 197,206 ****
     size = OS_SIZE(fdP->fd_fd);
     assert(size != -1);
     nVnodes = (size / vcp->diskSize) - 1;
     if (nVnodes > 0) {
!       assert((nVnodes+1)*vcp->diskSize == size)
!       assert(STREAM_SEEK(file, vcp->diskSize, 0) == 0)
     }
     else nVnodes = 0;
     for (vnodeIndex = 0;
  	nVnodes && STREAM_READ(vnode, vcp->diskSize, 1, file) == 1;
--- 197,206 ----
     size = OS_SIZE(fdP->fd_fd);
     assert(size != -1);
     nVnodes = (size / vcp->diskSize) - 1;
     if (nVnodes > 0) {
!       assert((nVnodes+1)*vcp->diskSize == size);
!       assert(STREAM_SEEK(file, vcp->diskSize, 0) == 0);
     }
     else nVnodes = 0;
     for (vnodeIndex = 0;
  	nVnodes && STREAM_READ(vnode, vcp->diskSize, 1, file) == 1;
diff -rC 4 amanda-afs/volset/volset-helper.c amanda-afs.save/volset/volset-helper.c
*** amanda-afs/volset/volset-helper.c	Sat May 11 17:39:59 2002
--- amanda-afs.save/volset/volset-helper.c	Mon Aug  1 19:39:31 2005
***************
*** 10,18 ****
     
     return checksum;
  }
  
! void DFlushVolume(void) {};
  
  /*
   * int osi_audit())
   * 
--- 10,18 ----
     
     return checksum;
  }
  
! int DFlushVolume(afs32int) {};
  
  /*
   * int osi_audit())
   * 
diff -rC 4 amanda-afs/volset/volset-helper.h amanda-afs.save/volset/volset-helper.h
*** amanda-afs/volset/volset-helper.h	Sat May 11 17:39:59 2002
--- amanda-afs.save/volset/volset-helper.h	Mon Aug  1 19:41:22 2005
***************
*** 3,11 ****
  
  extern afs_int32 ParseHost(char *aname, struct sockaddr_in *asockaddr);
  extern afs_int32 SafeATOI(char *anum);
  extern afs_int32 GetPartitionID(afs_int32 *aval, char *aname);
! extern void DFlushVolume(void);
  extern int osi_audit();
  extern ONE_BYTE_INT CheckSum(ONE_BYTE_INT *memory, int length);
  
  #endif /* _VOLSET_HELPER_H */
--- 3,11 ----
  
  extern afs_int32 ParseHost(char *aname, struct sockaddr_in *asockaddr);
  extern afs_int32 SafeATOI(char *anum);
  extern afs_int32 GetPartitionID(afs_int32 *aval, char *aname);
! extern int DFlushVolume(register afs32int);
  extern int osi_audit();
  extern ONE_BYTE_INT CheckSum(ONE_BYTE_INT *memory, int length);
  
  #endif /* _VOLSET_HELPER_H */

--------------050800030202090206070107
Content-Type: text/plain;
 name="amanda-afs-segf.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="amanda-afs-segf.patch"

diff -ur amanda-afs/volset/volset-estimate.c amanda-afs.004/volset/volset-estimate.c
--- amanda-afs/volset/volset.c	2002-05-11 17:39:59.000000000 -0400
+++ amanda-afs.004/volset/volset.c	2004-12-30 23:15:59.714563000 -0500
@@ -145,6 +145,7 @@
    afs_int32 partition;
    char volname[32];
    Node *vols;
+   Node *curvols;
    char serv[32];
    char file[32];
    struct sockaddr_in server;
@@ -244,7 +245,8 @@
 	 
 	 while(vols)
 	 {
-	    written += DumpVolume(out, get(&vols), prev_time, vols->next?0:1);
+	    curvols=vols;
+	    written += DumpVolume(out, get(&vols), prev_time, curvols->next?0:1);
 	 }
 	 
 	 close(out);

--------------050800030202090206070107--