bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Amanda client on MS Windows w/ UWIN


From: Bruce Lilly
Subject: Amanda client on MS Windows w/ UWIN
Date: Mon, 23 Jun 2003 05:38:13 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Hi,

What: Amanda (client-only) built, installed, and running on
Windows 2000 Professional SP2 (2 installations) using the UWIN
(http://www.research.att.com/sw/tools/uwin/) package.  For those
cc'ed, amanda is described at http://www.amanda.org.

Why: After running Amanda for a couple of weeks using SAMBA
to back up MS Windows boxes, I tired of seeing the daily
"STRANGE" reports for "System Volume Information", etc.
There doesn't appear to be any mechanism for excluding
files or directories when using SAMBA with Amanda (unlike
exclude.gtar for gtar).  Also, it seemed rather pointless
to waste network bandwidth, tape server holding disk space,
and tape media space storing things like the Windows
pagefile.sys and hiberfil.sys.  And various "access denied"
problems via SAMBA prevented complete backups.

How: UWIN base and development packages are required (see above
URL for details, download, and commercially-licensed and
supported versions of UWIN).  The base package provides a
great shell (ksh) and the usual utilities.  The development
package requires a compiler, and can use either a native
compiler (e.g. MS VC++ v. 6.0, which I used (at SP 5)) or gcc
(available separately from http://www.wipro.com/uwin/uwin-ports.htm).
The development package includes a front end for the compiler,
a decent preprocessor, header files, make, etc., and supports
gcc and the native compilers (including the MS "Platform SDK"
if installed).

This was originally written July 1, 2002.  I've been waiting for
some of the issues to be resolved, but that hasn't happened yet. In
particular, GNU tar (ftp://alpha.gnu.org/tar) hasn't been updated
in literally years. SP2 is now SP3 and one of the two machines (the
one I'm editing this on) has been updated to a more reliable OS.

        Perl is required for Amanda, and a prebuilt perl package
is also available for UWIN (from the main site URL).  Gnuplot
uses X11, so the UWIN X base and X development packages should
also be installed.

        Other prerequisites are GNU tar (UWIN's tar is a shell
script interface to pax), GNU readline, GNU awk (UWIN comes
with "the one true awk"
(http://www.cs.bell-labs.com/who/bwk/index.html)), and gnuplot.

        I already had the UWIN packages installed and running.
Tweaks, modifications, caveats, persuasive techniques, etc. (but
omitting most of the cursing) for the prerequisites are detailed
below.

        Installation of the UWIN packages should be done by placing
UWIN installation executables somewhere on a local hard drive
of the machine on which the packages are to be installed (using
a UNC path to a network drive won't work).  Back up your services
file (.../winnt/system32/drivers/etc/services) first. No, it's
not a 32-bit system file, nor is it a driver, but that's where
Microsquish (in their infinitesimal wisdom) decided to put it.
Once UWIN is installed, you can refer to it as /etc/services
(a symbolic link, a.k.a. a Windows shortcut) or as
/sys/drivers/etc/services. You'll have to do the Microsoft shuffle
(close applications, log off, reboot, wait for Windows "starting
you pee", grab a meal and perhaps a nap while waiting, log back in,
try to remember what you were doing) after the base package
installation.  UWIN comes with a "control panel" applet for
configuring inetd services -- DO NOT USE IT (it might very well
truncate your services file to zero length, after which most
network services will fail); edit /etc/inetd.conf with your
choice of text editor instead, in the usual manner.  You can
only have one telnet server listening on the telnet port, one
ftp server on the ftp port, etc., so you have to choose between
the Windows version of network services and the UWIN version.
Some versions of Windows come with the services enabled by default,
as does UWIN.  That's a conflict which is resolved by either
disabling the corresponding Windows service (via the services
control panel applet or equivalent) or the UWIN service (by editing
/etc/inetd.conf and sending a HUP signal to the inetd process).
You can run 'netstat -Aa' to see what ports are being used; if
you see duplicate entries for a given protocol/port pair, you
aren't finished.  Don't forget the "Simple TCP/IP services"
(echo, discard, chargen, daytime).  Try not to get sidetracked
with non-essential services, and don't add an active line for
amandad yet (you could put in a commented-out line, see below
for the appropriate line to use). UWIN's inetd has a bug that
prevents it from working cleanly with amanda; I built a working
replacement from modified BSD sources.

        GNU tar, like many of the other prerequisites and amanda
itself, uses "configure".  For installation in standard places on
UWIN and Linux, I usually specify --p /usr as a configure option.  I also
usually run configure as 'CFLAGS=-I/usr/include/ast ./configure ..."
to take advantage of the AST library  (included w/ UWIN, see
http://www.research.att.com/sw/download for other platforms).  The
version of configure shipped with GNU tar 1.13 needs even more
tweaking; it fails to recognize host type, so I had to specify
--host=i686-configuresucks-svr4" as well (UWIN actually provides
POSIX compliance and includes System V and BSD features, but
configure has only a limited set of choices available). Configure
also makes the wrong choice for executable file suffix (it chose
.i instead of .exe).  And configure botched the size of unsigned
long and long long (which is supported by MSVC++ and the AST printf
emulation). I took the easy way out; I edited config.status,
ran it, and re-ran make. If you use unsigned long instead of long
long, beware that there are errors in the printf formats in src/arith.?
and there may be bugs in the code that emits incorrect sizes.
The following patch corrects the format strings for unsigned long,
but does not address computation of the archive size.
================================================================
*** src/arith.c.orig    Thu Jul  1 01:15:41 1999
--- src/arith.c Sun Jun 30 10:47:13 2002
***************
*** 144,150 ****
     while (counter > 0 && accumulator[counter] == 0)
       counter--;

!   fprintf (file, "%uld", accumulator[counter]);
     while (counter > 0)
       fprintf (file, TARLONG_FORMAT, accumulator[--counter]);
   }
--- 144,150 ----
     while (counter > 0 && accumulator[counter] == 0)
       counter--;

!   fprintf (file, "%lu", accumulator[counter]);
     while (counter > 0)
       fprintf (file, TARLONG_FORMAT, accumulator[--counter]);
   }
*** src/arith.h.orig    Thu Oct 30 20:58:55 1997
--- src/arith.h Sun Jun 30 10:43:37 2002
***************
*** 48,59 ****
   #  if BITS_PER_BYTE * SIZEOF_UNSIGNED_LONG >= 64
   #   define SUPERDIGIT 1000000000L
   #   define BITS_PER_SUPERDIGIT 29
! #   define TARLONG_FORMAT "%09uld"
   #  else
   #   if BITS_PER_BYTE * SIZEOF_UNSIGNED_LONG >= 32
   #    define SUPERDIGIT 10000L
   #    define BITS_PER_SUPERDIGIT 14
! #    define TARLONG_FORMAT "%04uld"
   #   endif
   #  endif
   # endif
--- 48,59 ----
   #  if BITS_PER_BYTE * SIZEOF_UNSIGNED_LONG >= 64
   #   define SUPERDIGIT 1000000000L
   #   define BITS_PER_SUPERDIGIT 29
! #   define TARLONG_FORMAT "%09lu"
   #  else
   #   if BITS_PER_BYTE * SIZEOF_UNSIGNED_LONG >= 32
   #    define SUPERDIGIT 10000L
   #    define BITS_PER_SUPERDIGIT 14
! #    define TARLONG_FORMAT "%04lu"
   #   endif
   #  endif
   # endif
=======================================================
Make install puts "tar.exe" in /usr/bin,
which already has "tar" and "tar.sh" (the UWIN tar commands).
In order to make sure amanda could find the tar that it insists
on using from among those (the default for 'tar' is /usr/bin/tar,
which is a copy of the tar.sh shell script), I ran
ln -s /usr/bin/tar.exe /usr/bin/gtar
so that 'gtar' will run the GNU version, and amanda will be able
to find it.

        The UWIN perl package is version 5.005, so is suitable for
amanda, avoiding the inevitable "configure" debacle with building
perl from source.  Probably saves several hours of configure-wrangling
time.

        GNU readline 4.2a also uses configure.  I really dislike
configure.  It usually botches things, different versions abound,
each with their own peculiar quirks, and I really don't like having
to grope through a 160 kB obfuscated shell script to figure out
what went awry.  In this case, UWIN defines sigsetjmp as a macro
that calls the underlying setjmp function, but readline attempts to
define setjmp in terms of sigsetjmp.  Ain't gonna work, fellas!  The
quick fix is to comment out the definition of HAVE_POSIX_SIGSETJMP
in config.h before running make (or run make again after fixing it).

        GNU awk 3.1.0 was a fairly straightforward installation.

        Gnuplot 3.7 required a source modification:
====================================================================
*** specfun.c.orig      Thu Dec 10 14:30:36 1998
--- specfun.c   Sat Jun 29 03:38:31 2002
***************
*** 97,103 ****
     #ifndef GAMMA
     int signgam = 0;
     #else
! extern int signgam;           /* this is not always declared in math.h */
     #endif

     /* Global variables, not visible outside this file */
--- 97,103 ----
     #ifndef GAMMA
     int signgam = 0;
     #else
! /*extern int signgam;         /* this is not always declared in math.h */
     #endif

     /* Global variables, not visible outside this file */
=====================================================================
The "helpful" (and incorrect) redeclaration of signgam caused a link
error.  The patch above fixes the bug (of course there are other ways...).

        Having installed the prerequisites, that left amanda itself. I
used SuSE-8.0-modified (for LHS compatibility) sources.  A plethora
of configure options were required [have I mentioned how much I hate
configure...].  In addition to the ones necessary for compatibility
with the SuSE installation paths (I had to rebuild from source on
the tape server which runs SuSE linux 8.0, since SuSE neglected to
build with SAMBA support even though SuSE ships with SAMBA!), I needed
to add a bunch of options.  I ended up using a modified config.site
file (WARNING: move it out of the way when not building amanda, or it
will screw up configure for other packages (another wonderful configure
"feature"). and a slew of command line options:
CFLAGS=-I/usr/include/ast LIBS="-lreadline -lm -lcurses -ldbm" ./configure 
--with-user=amanda --with-group=Backup+Operators --prefix=/usr 
--disable-dependency-tracking --without-server
in addition to specifying the tape server with --with-index-server=....
That was arrived at through many runs of configure, figuring out what
was screwed up after each run.  And amanda's configure takes a very, very,
very long time to run.  Amanda's configure also has a problem with
executable extensions; it caused make to issue a cc -o genversion.exe ...
command, which is incorrect, followed by ./genversion (no .exe) and
that failed. The fix was to set the executable extension to a null
string.

        Installation had a few nuances: first I created an amanda user
using the windows control panel applet for "users and passwords". I
specified "Administrators" group and gave a home directory path
corresponding to /var/lib/amanda (the path used for SuSE compatibility),
which was C:/progra~1/uwin/var/lib/amanda on one windows machine, and
similar but on the E: drive on the other machine.  UWIN's /etc/mkpasswd
was then used to build suitable /etc/passwd and /etc/group files.  I
edited /etc/passwd (as root) to put amanda in the Administrators
group as a primary group by copying the gid from the /etc/group file
into the gid field of the amanda line in /etc/passwd. The amanda line
from /etc/passwd must also be copied to /etc/passwd.add. /etc/services
was edited in the usual way.  The working inetd that I installed uses
the following inetd.conf line for amanda:
amanda dgram udp wait amanda.Administrators /usr/lib/amanda/amandad.exe amandad
That doesn't work with the stock UWIN inetd; the following is
a hack that permits operation, though there are some extraneous debug
files:
amanda dgram udp nowait amanda /usr/lib/amanda/amandad.exe amandad
It's not entirely clear whether the amanda client needs to have access
to disk device files when using gtar, but to be on the safe side, I
created the appropriate device files:
mknod /dev/hdc b 0 2
mknod /dev/hdd b 0 3
...
mknod /dev/hdy b 0 24
mknod /dev/hdz b 0 25
corresponding to Windows logical drives C: through Z: (where the minor
device number is the drive letter (upper case) - 'A'). I manually
created /var/lib/amanda and /var/lib/amanda/gnutar-lists directories,
/etc/amandates and /etc/dumpdates empty files, and /var/lib/amanda/.amandahosts
and /var/lib/amanda/exclude.gtar files with appropriate entries. To access
the man pages, I added /usr/share/man to the paths in the /usr/bin/man
shell script.

      I changed the disklist entries on the tape server to access the
clients directly rather than through SAMBA via the tape server itself.

It's now working fine; fewer "STRANGE" reports.  Here's what the
exclude.gtar files look like on the Windows machines:
===========================================================
./*/proc
./*/Temp
./*/tmp
./var/lib/amanda/*/*/*/*/*.tmp
./pagefile.sys
./hiberfil.sys
./System*Volume*Information
./.deleted
./RECYCLER
./Recycled
./~adpttmp
./msdownld.tmp
===========================================================

Best regards,
     Bruce Lilly









reply via email to

[Prev in Thread] Current Thread [Next in Thread]