From a6127998ee6dcab6bb034f6ca985b07804a86f9a Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Tue, 8 Jul 2008 03:04:09 -0600 Subject: [PATCH] Imported Upstream version 2.6.0p1 --- ChangeLog | 113 +- NEWS | 9 + common-src/conffile.c | 34 +- common-src/debug.c | 9 +- common-src/file.c | 16 +- common-src/genversion.h | 2 +- common-src/security-util.c | 2 +- common-src/svn-info.h | 2 +- common-src/util.c | 13 +- common-src/versuff.c | 6 +- config/amanda/dumpers.m4 | 36 +- configure | 92 +- configure.in | 2 +- device-src/tape-device.c | 6 + man/amaddclient.8 | 6 +- man/amadmin.8 | 6 +- man/amaespipe.8 | 6 +- man/amanda-client.conf.5 | 6 +- man/amanda.8 | 8 +- man/amanda.conf.5 | 10 +- man/amcheck.8 | 6 +- man/amcheckdb.8 | 6 +- man/amcheckdump.8 | 8 +- man/amcleanup.8 | 6 +- man/amcrypt-ossl-asym.8 | 6 +- man/amcrypt-ossl.8 | 6 +- man/amcrypt.8 | 6 +- man/amcryptsimple.8 | 6 +- man/amdd.8 | 6 +- man/amdevcheck.8 | 6 +- man/amdump.8 | 6 +- man/amfetchdump.8 | 6 +- man/amflush.8 | 6 +- man/amgetconf.8 | 6 +- man/amgpgcrypt.8 | 6 +- man/amlabel.8 | 6 +- man/ammt.8 | 6 +- man/amoverview.8 | 6 +- man/amplot.8 | 6 +- man/amrecover.8 | 6 +- man/amreport.8 | 6 +- man/amrestore.8 | 6 +- man/amrmtape.8 | 6 +- man/amserverconfig.8 | 6 +- man/amstatus.8 | 6 +- man/amtape.8 | 6 +- man/amtapetype.8 | 6 +- man/amtoc.8 | 6 +- man/amverify.8 | 6 +- man/amverifyrun.8 | 6 +- man/xml-source/amaddclient.8.xml | 2 +- man/xml-source/amadmin.8.xml | 2 +- man/xml-source/amaespipe.8.xml | 2 +- man/xml-source/amanda-client.conf.5.xml | 2 +- man/xml-source/amanda.8.xml | 5 +- man/xml-source/amanda.conf.5.xml | 7 +- man/xml-source/amcheck.8.xml | 2 +- man/xml-source/amcheckdb.8.xml | 2 +- man/xml-source/amcheckdump.8.xml | 5 + man/xml-source/amcleanup.8.xml | 2 +- man/xml-source/amcrypt-ossl-asym.8.xml | 2 +- man/xml-source/amcrypt-ossl.8.xml | 2 +- man/xml-source/amcrypt.8.xml | 2 +- man/xml-source/amcryptsimple.8.xml | 2 +- man/xml-source/amdd.8.xml | 2 +- man/xml-source/amdevcheck.8.xml | 2 +- man/xml-source/amdump.8.xml | 2 +- man/xml-source/amfetchdump.8.xml | 2 +- man/xml-source/amflush.8.xml | 2 +- man/xml-source/amgetconf.8.xml | 2 +- man/xml-source/amgpgcrypt.8.xml | 2 +- man/xml-source/amlabel.8.xml | 2 +- man/xml-source/ammt.8.xml | 2 +- man/xml-source/amoverview.8.xml | 2 +- man/xml-source/amplot.8.xml | 2 +- man/xml-source/amrecover.8.xml | 2 +- man/xml-source/amreport.8.xml | 2 +- man/xml-source/amrestore.8.xml | 2 +- man/xml-source/amrmtape.8.xml | 2 +- man/xml-source/amserverconfig.8.xml | 2 +- man/xml-source/amstatus.8.xml | 2 +- man/xml-source/amtape.8.xml | 2 +- man/xml-source/amtapetype.8.xml | 2 +- man/xml-source/amtoc.8.xml | 2 +- man/xml-source/amverify.8.xml | 2 +- man/xml-source/amverifyrun.8.xml | 2 +- packaging/deb/amanda-backup-client.dirs | 1 + packaging/deb/amanda-backup-server.dirs | 1 + packaging/deb/amanda-backup-server.postinst | 21 +- packaging/deb/buildpkg | 8 +- packaging/deb/changelog | 5 +- packaging/deb/preinst | 12 +- packaging/deb/rules | 24 +- packaging/rpm/amanda.spec | 10 +- packaging/rpm/amanda.spec.orig | 1788 +++++++++++++++++++ packaging/rpm/amanda.spec.rej | 31 +- packaging/rpm/buildpkg | 2 +- packaging/rpm/buildpkg.orig | 50 + packaging/rpm/buildpkg.rej | 17 + perl/Amanda/Cmdline.c | 33 +- perl/Amanda/Cmdline.swg | 28 +- perl/Amanda/Logfile.c | 174 +- perl/Amanda/Logfile.pm | 2 + perl/Amanda/Logfile.swg | 6 + perl/Makefile.am | 1 + perl/Makefile.in | 17 +- perl/amglue/dumpspecs.swg | 91 + restore-src/amfetchdump.c | 173 +- restore-src/amrestore.c | 14 +- restore-src/restore.c | 11 +- server-src/amadmin.c | 9 +- server-src/amtrmlog.c | 4 +- server-src/driver.c | 6 +- server-src/dumper.c | 2 +- server-src/find.c | 54 + server-src/find.h | 3 + server-src/infofile.c | 2 +- server-src/planner.c | 21 +- server-src/server_util.c | 2 +- tape-src/tapetype.c | 3 + 120 files changed, 2832 insertions(+), 443 deletions(-) create mode 100644 packaging/rpm/amanda.spec.orig create mode 100755 packaging/rpm/buildpkg.orig create mode 100644 packaging/rpm/buildpkg.rej create mode 100644 perl/amglue/dumpspecs.swg diff --git a/ChangeLog b/ChangeLog index c531c6d..42929cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,115 @@ - 2008-03-31 Dan Locks +2008-05-13 Dan Locks + * packaging/deb/buildpkg: modified build script to create unsigned + packages + +2008-05-12 Jean-Louis Martineau + Patch by Orion Poplawski + * server-src/planner.c: Warn about overwrite of last level 1, and + force backup of level 1 if overwrite on this run. + +2008-05-12 Dustin J. Mitchell + * server-src/dumper.c server-src/server_util.c + server-src/infofile.c server-src/amtrmlog.c common-src/debug.c + common-src/file.c: Always call mkpdir without the 02000 bit set, + as it is not needed and causes problems on MacOS X. + +2008-05-08 Jean-Louis Martineau + * packaging/deb/buildpkg packaging/rpm/buildpkg: AMVER=amanda-2.6.0p1 + * packaging/deb/changelog: amanda (2.6.0p1-1) + * packaging/deb/rules: AMVER=2.6.0p1 + * packaging/rpm/amanda.spec: amanda_version 2.6.0p1, amanda_release 1 + * NEWS: Update for 2.6.0p1 + * configure.in: AM_INIT_AUTOMAKE(amanda, "2.6.0p1") + +2008-05-08 Jean-Louis Martineau + * common-src/conffile.c: Define default tapetype. + +2008-05-07 Jean-Louis Martineau + * common-src/conffile.c: Check the tapetype is defined. + +2008-05-07 Jean-Louis Martineau + * device-src/tape-device.c: Allow user to set "read_buffer_size" + property. + * restore-src/amrestore.c: Don't limit blocksize to + --with-maxtapeblocksize. + * common-src/conffile.c: Increase readblocksize to blocksize. + blocksize and readblocksize can be bigger than + --with-maxtapeblocksize. + +2008-05-02 Dan Locks + * packaging/rpm/amanda.spec: Replace ${ with %{ where applicable. + +2008-04-23 Jean-Louis Martineau + * common-src/security-util.c: Typo. + +2008-04-23 Jean-Louis Martineau + * server-src/driver.c: Always sent a FAILED to taper if dumper failed. + +2008-04-23 Jean-Louis Martineau + * server-src/planner.c: Fix vstrextend use. + +2008-04-16 Dan Locks + * Fixes to debian package reported by daniel_P + * packaging/deb/preinst: remove spaces near ${amanda_group} + * packaging/deb/amanda-backup-server.dirs + packaging/deb/amanda-backup-client.dirs: added var/amanda and + usr/share/lintian/overrides + * packaging/deb/rules: added logic to find PERLSITELIB and append that + to amanda-backup-server.install, removed broken brace expansion + * packaging/deb/buildpkg: removed extraneous configure step + * packaging/deb/amanda-backup-server.postinst: added check for correct + permissions on /tmp/amanda + +2008-04-16 Jean-Louis Martineau + * server-src/amadmin.c: Improve message. + * man/xml-source/amanda.conf.5.xml: Fix man page. + * server-src/planner.c: Fix DS_INCRONLY and FORCE_FULL + +2008-04-16 Dustin J. Mitchell + * config/amanda/dumpers.m4: continue searching for gnutar if we + find a binary claiming to be gnu tar that is not. This gets + around serious breakage on Ubuntu, where star is installed as + /bin/gnutar, but /bin/tar is actually GNU Tar. + +2008-04-15 Dustin J. Mitchell + * common-src/file.c(mk1dir): fix reversed conditional to handle + a race condition + +2008-04-15 Jean-Louis Martineau + * common-src/debug.c (debug_logging_handler, debug_printf): Don't print + msg_timestamp() to stderr. + +2008-04-15 Jean-Louis Martineau + * server-src/find.c (dumps_match_dumpspecs): New function to only keep + dumps that match a dumpspecs, using it simplify amfetchdump. + * server-src/find.h (dumps_match_dumpspecs): Prototype. + * restore-src/amrestore.c: Add a first_restored_file to + search_a_tape(), to allow restore ot stop after the first image. + * restore-src/restore.c: Set first_restored_file, it was never set, + it's needed to stop after the first image. + * restore-src/restore.c (restore_from_tapelist): break if piping to + stdout. + * restore-src/amfetchdump.c: Use dumps_match_dumpspecs. + * restore-src/amfetchdump.c: If -p, the keep only one dump. + * perl/Amanda/Logfile.swg (dumps_match_dumpspecs): New prototype. + * perl/Amanda/Cmdline.swg: cmdline_parse_dumpspecs. + * perl/amglue/dumpspecs.swg: Map dumpspecs to perl. + * perl/Makefile.am (AMGLUE_SWG): Add amglue/dumpspecs.swg. + +2008-04-15 Jean-Louis Martineau + * tape-src/tapetype.c: Initialize an default config. + +2008-04-15 Jean-Louis Martineau + * common-src/util.c (connect_portrange, connect_port, bind_portrange): + Return the latest errno reported. + +2008-04-04 Jean-Louis Martineau + * man/xml-source/*.xml: Use ulink tag to link to wiki.zmanda.com. + +2008-04-04 Jean-Louis Martineau + * restore-src/restore.c: Check last_header->type != F_UNKNOWN. + +2008-03-31 Dan Locks * packaging/deb/buildpkg packaging/rpm/buildpkg: added -p to cp to preserve file timestamps. diff --git a/NEWS b/NEWS index 02362b7..88b0c32 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,12 @@ +Changes in release 2.6.0p1 + + * Bugs fix only: + o amfetchdump -p + o amtapetype crash + o Fix DS_INCRONLY and FORCE_FULL + o planner crash + o others small bugs + Changes in release 2.6.0 * configure --disable-shared doesn't work because perl modules require diff --git a/common-src/conffile.c b/common-src/conffile.c index 2cc9cba..b254845 100644 --- a/common-src/conffile.c +++ b/common-src/conffile.c @@ -1814,6 +1814,11 @@ get_tapetype(void) _("tapetype parameter expected"), 1, copy_tapetype); get_conftoken(CONF_NL); + if (tapetype_get_readblocksize(&tpcur) < + tapetype_get_blocksize(&tpcur)) { + conf_init_size(&tpcur.value[TAPETYPE_READBLOCKSIZE], + tapetype_get_blocksize(&tpcur)); + } save_tapetype(); allow_overwrites = save_overwrites; @@ -2918,9 +2923,6 @@ validate_blocksize( if(val_t__size(val) < DISK_BLOCK_KB) { conf_parserror(_("Tape blocksize must be at least %d KBytes"), DISK_BLOCK_KB); - } else if(val_t__size(val) > MAX_TAPE_BLOCK_KB) { - conf_parserror(_("Tape blocksize must not be larger than %d KBytes"), - MAX_TAPE_BLOCK_KB); } } @@ -3369,6 +3371,22 @@ update_derived_values( val_t__int(v) = getconf_int(CNF_NETUSAGE); val_t__seen(v) = getconf_seen(CNF_NETUSAGE); } + + /* Check the tapetype is defined */ + if (lookup_tapetype(getconf_str(CNF_TAPETYPE)) == NULL) { + /* Create a default tapetype */ + if (!getconf_seen(CNF_TAPETYPE) && + strcmp(getconf_str(CNF_TAPETYPE), "EXABYTE") == 0 && + !lookup_tapetype("EXABYTE")) { + init_tapetype_defaults(); + tpcur.name = stralloc("EXABYTE"); + tpcur.seen = -1; + save_tapetype(); + } else { + conf_parserror(_("tapetype %s is not defined"), + getconf_str(CNF_TAPETYPE)); + } + } } /* fill in the debug_* values */ @@ -4415,7 +4433,11 @@ dump_configuration(void) } for(tp = tapelist; tp != NULL; tp = tp->next) { - g_printf("\nDEFINE TAPETYPE %s {\n", tp->name); + if(tp->seen == -1) + prefix = "#"; + else + prefix = ""; + g_printf("\n%sDEFINE TAPETYPE %s {\n", prefix, tp->name); for(i=0; i < TAPETYPE_TAPETYPE; i++) { for(np=tapetype_var; np->token != CONF_UNKNOWN; np++) if(np->parm == i) break; @@ -4427,9 +4449,9 @@ dump_configuration(void) if(kt->token == CONF_UNKNOWN) error(_("tapetype bad token")); - val_t_print_token(stdout, NULL, " %-9s ", kt, &tp->value[i]); + val_t_print_token(stdout, prefix, " %-9s ", kt, &tp->value[i]); } - g_printf("}\n"); + g_printf("%s}\n", prefix); } for(dp = dumplist; dp != NULL; dp = dp->next) { diff --git a/common-src/debug.c b/common-src/debug.c index 7adbc00..a6de415 100644 --- a/common-src/debug.c +++ b/common-src/debug.c @@ -155,7 +155,7 @@ debug_logging_handler(const gchar *log_domain G_GNUC_UNUSED, } if (erroutput_type & ERR_INTERACTIVE) { - g_fprintf(stderr, "%s: %s: %s\n", get_pname(), msg_timestamp(), message); + g_fprintf(stderr, "%s: %s\n", get_pname(), message); fflush(stderr); } @@ -230,7 +230,7 @@ debug_setup_1(char *config, char *subdir) dbgdir = vstralloc(AMANDA_DBGDIR, "/", subdir, "/", NULL); else dbgdir = stralloc2(AMANDA_DBGDIR, "/"); - if(mkpdir(dbgdir, 02700, get_client_uid(), get_client_gid()) == -1) { + if(mkpdir(dbgdir, 0700, get_client_uid(), get_client_gid()) == -1) { error(_("create debug directory \"%s\": %s"), dbgdir, strerror(errno)); /*NOTREACHED*/ @@ -648,7 +648,10 @@ printf_arglist_function(void debug_printf, const char *, format) db_file = stderr; } if(db_file != NULL) { - g_fprintf(db_file, "%s: %s: ", msg_timestamp(), get_pname()); + if (db_file != stderr) + g_fprintf(db_file, "%s: %s: ", msg_timestamp(), get_pname()); + else + g_fprintf(db_file, "%s: ", get_pname()); arglist_start(argp, format); g_vfprintf(db_file, format, argp); arglist_end(argp); diff --git a/common-src/file.c b/common-src/file.c index 5446391..6f2a0ac 100644 --- a/common-src/file.c +++ b/common-src/file.c @@ -47,19 +47,19 @@ static int mk1dir( const char *dir, /* directory to create */ mode_t mode, /* mode for new directory */ - uid_t G_GNUC_UNUSED uid, /* uid for new directory */ - gid_t G_GNUC_UNUSED gid) /* gid for new directory */ + uid_t uid, /* uid for new directory */ + gid_t gid) /* gid for new directory */ { int rc; /* return code */ rc = mkdir(dir, mode); - if(rc != 0) { /* maybe someone beat us to it */ + if(rc != 0) { int serrno; serrno = errno; - if(access(dir, F_OK) != 0) - rc = -1; - errno = serrno; /* pass back the real error */ + if(access(dir, F_OK) == 0) + rc = 0; /* someone just beat us to it, so it's OK */ + errno = serrno; } /* mkdir is affected by umask, so set the mode bits manually */ @@ -203,11 +203,11 @@ safe_cd(void) if (client_uid != (uid_t) -1) { #if defined(AMANDA_DBGDIR) d = stralloc2(AMANDA_DBGDIR, "/."); - (void) mkpdir(d, (mode_t)02700, client_uid, client_gid); + (void) mkpdir(d, (mode_t)0700, client_uid, client_gid); amfree(d); #endif d = stralloc2(AMANDA_TMPDIR, "/."); - (void) mkpdir(d, (mode_t)02700, client_uid, client_gid); + (void) mkpdir(d, (mode_t)0700, client_uid, client_gid); amfree(d); } diff --git a/common-src/genversion.h b/common-src/genversion.h index 7904057..b663563 100644 --- a/common-src/genversion.h +++ b/common-src/genversion.h @@ -1,3 +1,3 @@ #define CC "gcc" -#define BUILT_DATE "Mon Mar 31 20:02:23 EDT 2008" +#define BUILT_DATE "Wed May 14 17:05:51 EDT 2008" #define BUILT_MACH "x86_64-unknown-linux-gnu" diff --git a/common-src/security-util.c b/common-src/security-util.c index e326258..7ecb443 100644 --- a/common-src/security-util.c +++ b/common-src/security-util.c @@ -2538,7 +2538,7 @@ show_stat_info( if (getgrgid_r(sbuf.st_gid, &gr, buf, buflen, &grptr) != 0 || grptr == NULL) { group = alloc(NUM_STR_SIZE + 1); - g_snprintf(owner, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid); + g_snprintf(group, NUM_STR_SIZE, "%ld", (long)sbuf.st_gid); } else { group = stralloc(grptr->gr_name); } diff --git a/common-src/svn-info.h b/common-src/svn-info.h index 19f0d7f..415f16f 100644 --- a/common-src/svn-info.h +++ b/common-src/svn-info.h @@ -1,2 +1,2 @@ -#define BUILT_REV "933" +#define BUILT_REV "1023" #define BUILT_BRANCH "amanda-260" diff --git a/common-src/util.c b/common-src/util.c index 774719e..06c4de2 100644 --- a/common-src/util.c +++ b/common-src/util.c @@ -173,6 +173,7 @@ connect_portrange( static in_port_t port_in_use[1024]; static int nb_port_in_use = 0; int i; + int save_errno = EAGAIN; assert(first_port <= last_port); /* Try a port already used */ @@ -184,6 +185,8 @@ connect_portrange( if(s > 0) { return s; } + if (errno != EAGAIN && errno != EBUSY) + save_errno = errno; } } @@ -195,12 +198,14 @@ connect_portrange( port_in_use[nb_port_in_use++] = port; return s; } + if (errno != EAGAIN && errno != EBUSY) + save_errno = errno; } dbprintf(_("connect_portrange: All ports between %d and %d are busy.\n"), first_port, last_port); - errno = EAGAIN; + errno = save_errno; return -1; } @@ -227,6 +232,7 @@ connect_port( if (servPort != NULL && !strstr(servPort->s_name, "amanda")) { dbprintf(_("connect_port: Skip port %d: owned by %s.\n"), port, servPort->s_name); + errno = EBUSY; return -1; } @@ -319,6 +325,7 @@ bind_portrange( socklen_t socklen; struct servent *servPort; const in_port_t num_ports = (in_port_t)(last_port - first_port + 1); + int save_errno = EAGAIN; assert(first_port <= last_port); @@ -346,6 +353,8 @@ bind_portrange( } return 0; } + if (errno != EAGAIN && errno != EBUSY) + save_errno = errno; if (servPort == NULL) { dbprintf(_("bind_portrange2: Try port %d: Available - %s\n"), port, strerror(errno)); @@ -363,7 +372,7 @@ bind_portrange( dbprintf(_("bind_portrange: all ports between %d and %d busy\n"), first_port, last_port); - errno = EAGAIN; + errno = save_errno; return -1; } diff --git a/common-src/versuff.c b/common-src/versuff.c index 886d247..044fe69 100644 --- a/common-src/versuff.c +++ b/common-src/versuff.c @@ -34,13 +34,13 @@ const int VERSION_MAJOR = 2; const int VERSION_MINOR = 6; const int VERSION_PATCH = 0; -const char *const VERSION_COMMENT = ""; +const char *const VERSION_COMMENT = "p1"; const char * versionsuffix(void) { #ifdef USE_VERSION_SUFFIXES - return "-2.6.0"; + return "-2.6.0p1"; #else return ""; #endif @@ -49,5 +49,5 @@ versionsuffix(void) const char * version(void) { - return "2.6.0"; + return "2.6.0p1"; } diff --git a/config/amanda/dumpers.m4 b/config/amanda/dumpers.m4 index 5c3ce07..9c455c6 100644 --- a/config/amanda/dumpers.m4 +++ b/config/amanda/dumpers.m4 @@ -33,23 +33,27 @@ AC_DEFUN([AMANDA_PROG_GNUTAR], ] ) - if test "x$GNUTAR" != "xno"; then - # call ac_path_progs - AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH) - else + if test "x$GNUTAR" = "xno"; then GNUTAR= - fi - - if test ! -z "$GNUTAR"; then - case "`\"$GNUTAR\" --version 2>&1`" in - *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar - ;; - *) - # warning.. - AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.]) - GNUTAR='' - ;; - esac + else + for gnutar_name in gtar gnutar tar; do + AC_PATH_PROGS(GNUTAR, $gnutar_name, , $LOCSYSPATH) + if test -n "$GNUTAR"; then + case "`\"$GNUTAR\" --version 2>&1`" in + *GNU*tar* | *Free*paxutils* ) + # OK, it is GNU tar + break + ;; + *) + # warning.. + AMANDA_MSG_WARN([$GNUTAR is not GNU tar, so it will not be used.]) + # reset the cache for GNUTAR so AC_PATH_PROGS will search again + GNUTAR='' + unset ac_cv_path_GNUTAR + ;; + esac + fi + done fi if test "x$GNUTAR" != "x"; then diff --git a/configure b/configure index 446d623..a48f35d 100755 --- a/configure +++ b/configure @@ -2950,7 +2950,7 @@ fi # Define the identity of the package. PACKAGE=amanda - VERSION="2.6.0" + VERSION="2.6.0p1" cat >>confdefs.h <<_ACEOF @@ -30013,9 +30013,11 @@ echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;} fi - if test "x$GNUTAR" != "xno"; then - # call ac_path_progs - for ac_prog in gtar gnutar tar + if test "x$GNUTAR" = "xno"; then + GNUTAR= + else + for gnutar_name in gtar gnutar tar; do + for ac_prog in $gnutar_name do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -30060,16 +30062,14 @@ fi test -n "$GNUTAR" && break done - else - GNUTAR= - fi - - if test ! -z "$GNUTAR"; then - case "`\"$GNUTAR\" --version 2>&1`" in - *GNU*tar* | *Free*paxutils* ) : # OK, it is GNU tar - ;; - *) - # warning.. + if test -n "$GNUTAR"; then + case "`\"$GNUTAR\" --version 2>&1`" in + *GNU*tar* | *Free*paxutils* ) + # OK, it is GNU tar + break + ;; + *) + # warning.. { echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&5 echo "$as_me: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&2;} @@ -30080,9 +30080,13 @@ $GNUTAR is not GNU tar, so it will not be used. AAW_EOF - GNUTAR='' - ;; - esac + # reset the cache for GNUTAR so AC_PATH_PROGS will search again + GNUTAR='' + unset ac_cv_path_GNUTAR + ;; + esac + fi + done fi if test "x$GNUTAR" != "x"; then @@ -32924,7 +32928,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 32927 "configure"' > conftest.$ac_ext + echo '#line 32931 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -35211,11 +35215,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:35214: $lt_compile\"" >&5) + (eval echo "\"\$as_me:35218: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:35218: \$? = $ac_status" >&5 + echo "$as_me:35222: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -35473,11 +35477,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:35476: $lt_compile\"" >&5) + (eval echo "\"\$as_me:35480: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:35480: \$? = $ac_status" >&5 + echo "$as_me:35484: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -35535,11 +35539,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:35538: $lt_compile\"" >&5) + (eval echo "\"\$as_me:35542: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:35542: \$? = $ac_status" >&5 + echo "$as_me:35546: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -37764,7 +37768,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:40168: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:40168: \$? = $ac_status" >&5 + echo "$as_me:40172: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -40223,11 +40227,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:40226: $lt_compile\"" >&5) + (eval echo "\"\$as_me:40230: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:40230: \$? = $ac_status" >&5 + echo "$as_me:40234: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -41575,7 +41579,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:42565: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:42565: \$? = $ac_status" >&5 + echo "$as_me:42569: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -42620,11 +42624,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:42623: $lt_compile\"" >&5) + (eval echo "\"\$as_me:42627: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:42627: \$? = $ac_status" >&5 + echo "$as_me:42631: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -44767,11 +44771,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:44770: $lt_compile\"" >&5) + (eval echo "\"\$as_me:44774: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:44774: \$? = $ac_status" >&5 + echo "$as_me:44778: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -45029,11 +45033,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:45032: $lt_compile\"" >&5) + (eval echo "\"\$as_me:45036: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:45036: \$? = $ac_status" >&5 + echo "$as_me:45040: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -45091,11 +45095,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:45094: $lt_compile\"" >&5) + (eval echo "\"\$as_me:45098: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:45098: \$? = $ac_status" >&5 + echo "$as_me:45102: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -47320,7 +47324,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <fixed_block_size = g_value_get_int(val); device_clear_volume_details(d_self); return TRUE; + } else if (id == PROPERTY_READ_BUFFER_SIZE) { + if (d_self->access_mode != ACCESS_NULL) + return FALSE; + self->read_block_size = g_value_get_uint(val); + device_clear_volume_details(d_self); + return TRUE; } else if (id == PROPERTY_FSF) { return try_set_feature(d_self->access_mode, feature_request_flags, diff --git a/man/amaddclient.8 b/man/amaddclient.8 index d38c61e..c83ddcc 100644 --- a/man/amaddclient.8 +++ b/man/amaddclient.8 @@ -1,11 +1,11 @@ .\" Title: amaddclient .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMADDCLIENT" "8" "03/31/2008" "" "" +.TH "AMADDCLIENT" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -209,4 +209,4 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c \fBssh-keygen\fR(1) \fBssh-add\fR(1) \fBscp\fR(1) -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amadmin.8 b/man/amadmin.8 index a4082f1..cb38aec 100644 --- a/man/amadmin.8 +++ b/man/amadmin.8 @@ -1,11 +1,11 @@ .\" Title: amadmin .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMADMIN" "8" "03/31/2008" "" "" +.TH "AMADMIN" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -422,4 +422,4 @@ Stefan G\. Weichinger, \fBamdump\fR(8), \fBamrestore\fR(8), \fBamfetchdump\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amaespipe.8 b/man/amaespipe.8 index a90c65c..13dd165 100644 --- a/man/amaespipe.8 +++ b/man/amaespipe.8 @@ -1,11 +1,11 @@ .\" Title: amaespipe .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMAESPIPE" "8" "03/31/2008" "" "" +.TH "AMAESPIPE" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -53,4 +53,4 @@ autodects encryption type and hash function from the encrypted image\. \fBaespipe\fR(1), \fBamcrypt\fR(8), \fBgpg\fR(1), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amanda-client.conf.5 b/man/amanda-client.conf.5 index f7ae213..83d9978 100644 --- a/man/amanda-client.conf.5 +++ b/man/amanda-client.conf.5 @@ -1,11 +1,11 @@ .\" Title: amanda-client.conf .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMANDA\-CLIENT\.CONF" "5" "03/31/2008" "" "" +.TH "AMANDA\-CLIENT\.CONF" "5" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -298,4 +298,4 @@ Stefan G\. Weichinger, \fBamanda.conf\fR(5), \fBamcrypt\fR(8), \fBaespipe\fR(1), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amanda.8 b/man/amanda.8 index 2bb579f..15dbba4 100644 --- a/man/amanda.8 +++ b/man/amanda.8 @@ -1,11 +1,11 @@ .\" Title: amanda .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMANDA" "8" "03/31/2008" "" "" +.TH "AMANDA" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -1187,5 +1187,5 @@ Stefan G\. Weichinger, \fBamtoc\fR(8), \fBamcheckdump\fR(8), \fBamserverconfig\fR(8), -\fBamaddclient\fR(8) -\fBhttp://wiki.zmanda.com\fR() +\fBamaddclient\fR(8), +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amanda.conf.5 b/man/amanda.conf.5 index 0c1bfcc..3e5ea96 100644 --- a/man/amanda.conf.5 +++ b/man/amanda.conf.5 @@ -1,11 +1,11 @@ .\" Title: amanda.conf .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMANDA\.CONF" "5" "03/31/2008" "" "" +.TH "AMANDA\.CONF" "5" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -1482,9 +1482,7 @@ Only do incremental dumps\. \fBamadmin force\fR should be used to tell \fIAmanda\fR -that a full dump has been performed off\-line, so that it resets to level 1\. It is similar to skip\-full, but with incronly full dumps may be scheduled manually\. Unfortunately, it appears that -\fIAmanda\fR -will perform full backups with this configuration, which is probably a bug\. +that a full dump has been performed off\-line, so that it resets to level 1\. .RE .RE .PP @@ -1768,6 +1766,6 @@ Stefan G\. Weichinger, \fBamanda-client.conf\fR(5), \fBamcrypt\fR(8), \fBaespipe\fR(1), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR .PP An updated version of this man page may be available at http://wiki\.zmanda\.com/index\.php/Amanda\.conf\. diff --git a/man/amcheck.8 b/man/amcheck.8 index 44bd6cf..e7fab67 100644 --- a/man/amcheck.8 +++ b/man/amcheck.8 @@ -1,11 +1,11 @@ .\" Title: amcheck .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMCHECK" "8" "03/31/2008" "" "" +.TH "AMCHECK" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -692,4 +692,4 @@ Stefan G\. Weichinger, .PP \fBamanda\fR(8), \fBamdump\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amcheckdb.8 b/man/amcheckdb.8 index ffeeff5..4d273e0 100644 --- a/man/amcheckdb.8 +++ b/man/amcheckdb.8 @@ -1,11 +1,11 @@ .\" Title: amcheckdb .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMCHECKDB" "8" "03/31/2008" "" "" +.TH "AMCHECKDB" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -64,4 +64,4 @@ Stefan G\. Weichinger, \fBamadmin\fR(8), \fBamrmtape\fR(8), \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amcheckdump.8 b/man/amcheckdump.8 index 8d1c7da..e9340ad 100644 --- a/man/amcheckdump.8 +++ b/man/amcheckdump.8 @@ -1,11 +1,11 @@ .\" Title: amcheckdump .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMCHECKDUMP" "8" "03/31/2008" "" "" +.TH "AMCHECKDUMP" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -35,6 +35,10 @@ See the "\fBCONFIGURATION OVERRIDE\fR" section in for information on the \-o option\. +.SH "SEE ALSO" +.PP +\fBamanda\fR(8), +\fI\%http://wiki.zmanda.com\fR .SH "EXAMPLE" .PP .RS 4 diff --git a/man/amcleanup.8 b/man/amcleanup.8 index 429ba70..666d26a 100644 --- a/man/amcleanup.8 +++ b/man/amcleanup.8 @@ -1,11 +1,11 @@ .\" Title: amcleanup .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMCLEANUP" "8" "03/31/2008" "" "" +.TH "AMCLEANUP" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -89,4 +89,4 @@ Stefan G\. Weichinger, .PP \fBamanda\fR(8), \fBamdump\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amcrypt-ossl-asym.8 b/man/amcrypt-ossl-asym.8 index fa95247..d01a04c 100644 --- a/man/amcrypt-ossl-asym.8 +++ b/man/amcrypt-ossl-asym.8 @@ -1,11 +1,11 @@ .\" Title: amcrypt-ossl-asym .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMCRYPT\-OSSL\-ASYM" "8" "03/31/2008" "" "" +.TH "AMCRYPT\-OSSL\-ASYM" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -97,7 +97,7 @@ user\. \fBamanda.conf\fR(5), \fBopenssl\fR(1), \fBamcrypt-ossl\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR .SH "NOTES" .IP " 1." 4 www.openssl.org diff --git a/man/amcrypt-ossl.8 b/man/amcrypt-ossl.8 index 0e54689..cfa338f 100644 --- a/man/amcrypt-ossl.8 +++ b/man/amcrypt-ossl.8 @@ -1,11 +1,11 @@ .\" Title: amcrypt-ossl .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMCRYPT\-OSSL" "8" "03/31/2008" "" "" +.TH "AMCRYPT\-OSSL" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -54,7 +54,7 @@ user\. \fBamanda.conf\fR(5), \fBopenssl\fR(1), \fBamcrypt-ossl-asym\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR .SH "NOTES" .IP " 1." 4 www.openssl.org diff --git a/man/amcrypt.8 b/man/amcrypt.8 index 41b3512..36dae74 100644 --- a/man/amcrypt.8 +++ b/man/amcrypt.8 @@ -1,11 +1,11 @@ .\" Title: amcrypt .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMCRYPT" "8" "03/31/2008" "" "" +.TH "AMCRYPT" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -71,4 +71,4 @@ be recovered with the correct key and passphrase\. \fBaespipe\fR(1), \fBamaespipe\fR(8), \fBgpg\fR(1), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amcryptsimple.8 b/man/amcryptsimple.8 index 492af4f..2ca624e 100644 --- a/man/amcryptsimple.8 +++ b/man/amcryptsimple.8 @@ -1,11 +1,11 @@ .\" Title: amcryptsimple .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMCRYPTSIMPLE" "8" "03/31/2008" "" "" +.TH "AMCRYPTSIMPLE" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -63,4 +63,4 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c \fBamgpgcrypt\fR(8), \fBamrestore\fR(8), \fBgpg\fR(1), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amdd.8 b/man/amdd.8 index 14f25fd..545a2cd 100644 --- a/man/amdd.8 +++ b/man/amdd.8 @@ -1,11 +1,11 @@ .\" Title: amdd .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMDD" "8" "03/31/2008" "" "" +.TH "AMDD" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -118,4 +118,4 @@ Stefan G\. Weichinger, .PP \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amdevcheck.8 b/man/amdevcheck.8 index 8e35f57..a0602e2 100644 --- a/man/amdevcheck.8 +++ b/man/amdevcheck.8 @@ -1,11 +1,11 @@ .\" Title: amdevcheck .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMDEVCHECK" "8" "03/31/2008" "" "" +.TH "AMDEVCHECK" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -66,4 +66,4 @@ and others\. Authorship of this tool and its documentation was funded by Zmanda, \fBamanda\fR(8), \fBammt\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amdump.8 b/man/amdump.8 index 268a722..01fa1ac 100644 --- a/man/amdump.8 +++ b/man/amdump.8 @@ -1,11 +1,11 @@ .\" Title: amdump .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMDUMP" "8" "03/31/2008" "" "" +.TH "AMDUMP" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -111,4 +111,4 @@ Stefan G\. Weichinger, \fBamrestore\fR(8), \fBamflush\fR(8), \fBcron\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amfetchdump.8 b/man/amfetchdump.8 index baa2ce2..a2a3bc0 100644 --- a/man/amfetchdump.8 +++ b/man/amfetchdump.8 @@ -1,11 +1,11 @@ .\" Title: amfetchdump .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMFETCHDUMP" "8" "03/31/2008" "" "" +.TH "AMFETCHDUMP" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -164,4 +164,4 @@ Ian Turner, \fBamrestore\fR(8), \fBtar\fR(1), \fBrestore\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amflush.8 b/man/amflush.8 index 84bd192..e7d665d 100644 --- a/man/amflush.8 +++ b/man/amflush.8 @@ -1,11 +1,11 @@ .\" Title: amflush .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMFLUSH" "8" "03/31/2008" "" "" +.TH "AMFLUSH" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -142,4 +142,4 @@ Stefan G\. Weichinger, \fBamanda\fR(8), \fBamdump\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amgetconf.8 b/man/amgetconf.8 index c1c0121..0c57f4f 100644 --- a/man/amgetconf.8 +++ b/man/amgetconf.8 @@ -1,11 +1,11 @@ .\" Title: amgetconf .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMGETCONF" "8" "03/31/2008" "" "" +.TH "AMGETCONF" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -168,4 +168,4 @@ keyword)\. .PP \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amgpgcrypt.8 b/man/amgpgcrypt.8 index faafc64..bb71017 100644 --- a/man/amgpgcrypt.8 +++ b/man/amgpgcrypt.8 @@ -1,11 +1,11 @@ .\" Title: amgpgcrypt .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMGPGCRYPT" "8" "03/31/2008" "" "" +.TH "AMGPGCRYPT" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -154,4 +154,4 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c \fBamcrypt\fR(8), \fBamrestore\fR(8), \fBgpg\fR(1), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amlabel.8 b/man/amlabel.8 index 576897a..5c738b9 100644 --- a/man/amlabel.8 +++ b/man/amlabel.8 @@ -1,11 +1,11 @@ .\" Title: amlabel .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMLABEL" "8" "03/31/2008" "" "" +.TH "AMLABEL" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -171,4 +171,4 @@ Stefan G\. Weichinger, \fBamanda\fR(8), \fBamdump\fR(8), \fBamflush\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/ammt.8 b/man/ammt.8 index 3b1d56f..a8acd7b 100644 --- a/man/ammt.8 +++ b/man/ammt.8 @@ -1,11 +1,11 @@ .\" Title: ammt .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMMT" "8" "03/31/2008" "" "" +.TH "AMMT" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -180,4 +180,4 @@ Stefan G\. Weichinger, .SH "SEE ALSO" .PP \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amoverview.8 b/man/amoverview.8 index 35000a3..18bd4b6 100644 --- a/man/amoverview.8 +++ b/man/amoverview.8 @@ -1,11 +1,11 @@ .\" Title: amoverview .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMOVERVIEW" "8" "03/31/2008" "" "" +.TH "AMOVERVIEW" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -122,4 +122,4 @@ host2 /var 1 1 0 1 1 1 .PP \fBamadmin\fR(8), \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amplot.8 b/man/amplot.8 index 9cefa75..4b3c379 100644 --- a/man/amplot.8 +++ b/man/amplot.8 @@ -1,11 +1,11 @@ .\" Title: amplot .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMPLOT" "8" "03/31/2008" "" "" +.TH "AMPLOT" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -159,4 +159,4 @@ Reports lines it does not recognize, mainly error cases but some are legitimate \fBsh\fR(1), \fBcompress\fR(1), \fBgzip\fR(1), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amrecover.8 b/man/amrecover.8 index 505aa87..ece641d 100644 --- a/man/amrecover.8 +++ b/man/amrecover.8 @@ -1,11 +1,11 @@ .\" Title: amrecover .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMRECOVER" "8" "03/31/2008" "" "" +.TH "AMRECOVER" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -492,4 +492,4 @@ Stefan G\. Weichinger, \fBamrestore\fR(8), \fBamfetchdump\fR(8), \fBreadline\fR(3), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amreport.8 b/man/amreport.8 index 41acffe..be28b5b 100644 --- a/man/amreport.8 +++ b/man/amreport.8 @@ -1,11 +1,11 @@ .\" Title: amreport .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMREPORT" "8" "03/31/2008" "" "" +.TH "AMREPORT" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -122,4 +122,4 @@ The 3\-ring binder type is the most generic\. It may be used to make a hardcopy .PP \fBamanda\fR(8), \fBamflush\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amrestore.8 b/man/amrestore.8 index f1414f2..df874ba 100644 --- a/man/amrestore.8 +++ b/man/amrestore.8 @@ -1,11 +1,11 @@ .\" Title: amrestore .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMRESTORE" "8" "03/31/2008" "" "" +.TH "AMRESTORE" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -262,4 +262,4 @@ Stefan G\. Weichinger, \fBamflush\fR(8), \fBtar\fR(1), \fBrestore\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amrmtape.8 b/man/amrmtape.8 index b6c5361..44b7b04 100644 --- a/man/amrmtape.8 +++ b/man/amrmtape.8 @@ -1,11 +1,11 @@ .\" Title: amrmtape .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMRMTAPE" "8" "03/31/2008" "" "" +.TH "AMRMTAPE" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -77,4 +77,4 @@ Stefan G\. Weichinger, .PP \fBamadmin\fR(8), \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amserverconfig.8 b/man/amserverconfig.8 index a2285e3..df32401 100644 --- a/man/amserverconfig.8 +++ b/man/amserverconfig.8 @@ -1,11 +1,11 @@ .\" Title: amserverconfig .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMSERVERCONFIG" "8" "03/31/2008" "" "" +.TH "AMSERVERCONFIG" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -178,4 +178,4 @@ The tool and its documentation was written by Zmanda, Inc (http://www\.zmanda\.c \fBamanda\fR(8), \fBamanda.conf\fR(5), \fBamaddclient\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amstatus.8 b/man/amstatus.8 index 9cd0f46..6a146ec 100644 --- a/man/amstatus.8 +++ b/man/amstatus.8 @@ -1,11 +1,11 @@ .\" Title: amstatus .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMSTATUS" "8" "03/31/2008" "" "" +.TH "AMSTATUS" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -116,4 +116,4 @@ Output the date in a locale independent format\. The format is the same executin \fBamdump\fR(8), \fBamrestore\fR(8), \fBamadmin\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amtape.8 b/man/amtape.8 index a2dc2f7..6f3b5be 100644 --- a/man/amtape.8 +++ b/man/amtape.8 @@ -1,11 +1,11 @@ .\" Title: amtape .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMTAPE" "8" "03/31/2008" "" "" +.TH "AMTAPE" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -169,4 +169,4 @@ Stefan G\. Weichinger, .SH "SEE ALSO" .PP \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amtapetype.8 b/man/amtapetype.8 index c6a9ea7..0c76c44 100644 --- a/man/amtapetype.8 +++ b/man/amtapetype.8 @@ -1,11 +1,11 @@ .\" Title: amtapetype .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMTAPETYPE" "8" "03/31/2008" "" "" +.TH "AMTAPETYPE" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -95,4 +95,4 @@ used to sometimes report a negative file mark size if the math happened to end u .SH "SEE ALSO" .PP \fBamanda\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amtoc.8 b/man/amtoc.8 index ac81e4d..e6bc640 100644 --- a/man/amtoc.8 +++ b/man/amtoc.8 @@ -1,11 +1,11 @@ .\" Title: amtoc .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMTOC" "8" "03/31/2008" "" "" +.TH "AMTOC" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -129,7 +129,7 @@ after an \fBamdump\fR(8), \fBamflush\fR(8), \fBamgetconf\fR(8), cron, perl, -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR .SH "AUTHOR" .PP Nicolas Mayencourt diff --git a/man/amverify.8 b/man/amverify.8 index 0d0d049..a4ac08d 100644 --- a/man/amverify.8 +++ b/man/amverify.8 @@ -1,11 +1,11 @@ .\" Title: amverify .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMVERIFY" "8" "03/31/2008" "" "" +.TH "AMVERIFY" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -61,4 +61,4 @@ Stefan G\. Weichinger, \fBamrestore\fR(8), \fBamanda\fR(8), \fBamverifyrun\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/amverifyrun.8 b/man/amverifyrun.8 index b3fc9e6..b80c3f0 100644 --- a/man/amverifyrun.8 +++ b/man/amverifyrun.8 @@ -1,11 +1,11 @@ .\" Title: amverifyrun .\" Author: .\" Generator: DocBook XSL Stylesheets v1.73.2 -.\" Date: 03/31/2008 +.\" Date: 05/14/2008 .\" Manual: .\" Source: .\" -.TH "AMVERIFYRUN" "8" "03/31/2008" "" "" +.TH "AMVERIFYRUN" "8" "05/14/2008" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -27,4 +27,4 @@ with these argument\. .PP \fBamanda\fR(8), \fBamverify\fR(8), -\fBhttp://wiki.zmanda.com\fR() +\fI\%http://wiki.zmanda.com\fR diff --git a/man/xml-source/amaddclient.8.xml b/man/xml-source/amaddclient.8.xml index 03d9ef4..36bb72a 100644 --- a/man/xml-source/amaddclient.8.xml +++ b/man/xml-source/amaddclient.8.xml @@ -279,7 +279,7 @@ On success, zero is returned. On error, 1 is returned. ssh-keygen1 ssh-add1 scp1 -http://wiki.zmanda.com + diff --git a/man/xml-source/amadmin.8.xml b/man/xml-source/amadmin.8.xml index 19002d2..7efd519 100644 --- a/man/xml-source/amadmin.8.xml +++ b/man/xml-source/amadmin.8.xml @@ -440,7 +440,7 @@ TOTAL 241 12412187 7316312 731631 (estimated 8 runs per dumpcycle) amdump8, amrestore8, amfetchdump8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amaespipe.8.xml b/man/xml-source/amaespipe.8.xml index ba1fada..b3c87f0 100755 --- a/man/xml-source/amaespipe.8.xml +++ b/man/xml-source/amaespipe.8.xml @@ -46,7 +46,7 @@ the encrypted image. aespipe1, amcrypt8, gpg1, -http://wiki.zmanda.com + diff --git a/man/xml-source/amanda-client.conf.5.xml b/man/xml-source/amanda-client.conf.5.xml index 5ec5de6..d110291 100644 --- a/man/xml-source/amanda-client.conf.5.xml +++ b/man/xml-source/amanda-client.conf.5.xml @@ -392,7 +392,7 @@ Unreserved tcp port that will be used (bsd, bsdudp) amanda.conf5, amcrypt8, aespipe1, -http://wiki.zmanda.com + diff --git a/man/xml-source/amanda.8.xml b/man/xml-source/amanda.8.xml index 677d3d8..383e35a 100644 --- a/man/xml-source/amanda.8.xml +++ b/man/xml-source/amanda.8.xml @@ -1309,8 +1309,9 @@ amdump -otapedev=/dev/nst1 -otpchanger='' amtoc8, amcheckdump8, amserverconfig8, -amaddclient8 -http://wiki.zmanda.com +amaddclient8, + + diff --git a/man/xml-source/amanda.conf.5.xml b/man/xml-source/amanda.conf.5.xml index f322c1f..15747a3 100644 --- a/man/xml-source/amanda.conf.5.xml +++ b/man/xml-source/amanda.conf.5.xml @@ -1785,10 +1785,7 @@ The value should be hh*100+mm, e.g. 6:30PM (18:30) would be entered as incronly Only do incremental dumps. amadmin force should be used to tell - &A; that a full dump has been performed off-line, so that it resets to level 1. - It is similar to skip-full, but with incronly full dumps may be scheduled manually. - Unfortunately, it appears that &A; will perform full backups with this configuration, - which is probably a bug. + &A; that a full dump has been performed off-line, so that it resets to level 1. @@ -2132,7 +2129,7 @@ At the moment, this is of little use. amanda-client.conf5, amcrypt8, aespipe1, -http://wiki.zmanda.com + diff --git a/man/xml-source/amcheck.8.xml b/man/xml-source/amcheck.8.xml index a34e096..5bc33fd 100644 --- a/man/xml-source/amcheck.8.xml +++ b/man/xml-source/amcheck.8.xml @@ -870,7 +870,7 @@ was reported by the status check on SEE ALSO amanda8, amdump8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amcheckdb.8.xml b/man/xml-source/amcheckdb.8.xml index b22ea3e..7585a8b 100644 --- a/man/xml-source/amcheckdb.8.xml +++ b/man/xml-source/amcheckdb.8.xml @@ -69,7 +69,7 @@ Ready. amadmin8, amrmtape8, amanda8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amcheckdump.8.xml b/man/xml-source/amcheckdump.8.xml index 48f091f..e37da35 100644 --- a/man/xml-source/amcheckdump.8.xml +++ b/man/xml-source/amcheckdump.8.xml @@ -48,6 +48,11 @@ remap='B'>CONFIGURATION OVERRIDE" section in amanda8 for information on the -o option. + SEE ALSO + amanda8, + + + EXAMPLE diff --git a/man/xml-source/amcleanup.8.xml b/man/xml-source/amcleanup.8.xml index 1ef49c0..76c9f1d 100644 --- a/man/xml-source/amcleanup.8.xml +++ b/man/xml-source/amcleanup.8.xml @@ -98,7 +98,7 @@ amcleanup: no unprocessed logfile to clean up. SEE ALSO amanda8, amdump8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amcrypt-ossl-asym.8.xml b/man/xml-source/amcrypt-ossl-asym.8.xml index 673cdb8..3c2a974 100644 --- a/man/xml-source/amcrypt-ossl-asym.8.xml +++ b/man/xml-source/amcrypt-ossl-asym.8.xml @@ -146,7 +146,7 @@ Writing RSA key amcrypt-ossl 8 , -http://wiki.zmanda.com + diff --git a/man/xml-source/amcrypt-ossl.8.xml b/man/xml-source/amcrypt-ossl.8.xml index 9594999..1b6e7a2 100644 --- a/man/xml-source/amcrypt-ossl.8.xml +++ b/man/xml-source/amcrypt-ossl.8.xml @@ -87,7 +87,7 @@ amcrypt-ossl-asym 8 , -http://wiki.zmanda.com + diff --git a/man/xml-source/amcrypt.8.xml b/man/xml-source/amcrypt.8.xml index 26f7456..5d93ea3 100755 --- a/man/xml-source/amcrypt.8.xml +++ b/man/xml-source/amcrypt.8.xml @@ -71,7 +71,7 @@ passphrase. aespipe1, amaespipe8, gpg1, -http://wiki.zmanda.com + diff --git a/man/xml-source/amcryptsimple.8.xml b/man/xml-source/amcryptsimple.8.xml index d45f111..29151e1 100644 --- a/man/xml-source/amcryptsimple.8.xml +++ b/man/xml-source/amcryptsimple.8.xml @@ -65,7 +65,7 @@ encryption uses the public key to encrypt and uses the private key to decrypt.amgpgcrypt8, amrestore8, gpg1, -http://wiki.zmanda.com + diff --git a/man/xml-source/amdd.8.xml b/man/xml-source/amdd.8.xml index eb41546..02a206f 100644 --- a/man/xml-source/amdd.8.xml +++ b/man/xml-source/amdd.8.xml @@ -149,7 +149,7 @@ Default is zero. SEE ALSO amanda8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amdevcheck.8.xml b/man/xml-source/amdevcheck.8.xml index c47ca58..d4ca82d 100644 --- a/man/xml-source/amdevcheck.8.xml +++ b/man/xml-source/amdevcheck.8.xml @@ -95,7 +95,7 @@ amanda8, ammt8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amdump.8.xml b/man/xml-source/amdump.8.xml index 2635c06..f1239d0 100644 --- a/man/xml-source/amdump.8.xml +++ b/man/xml-source/amdump.8.xml @@ -136,7 +136,7 @@ and then rerun amrestore8, amflush8, cron8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amfetchdump.8.xml b/man/xml-source/amfetchdump.8.xml index e971edd..5a7d120 100644 --- a/man/xml-source/amfetchdump.8.xml +++ b/man/xml-source/amfetchdump.8.xml @@ -216,7 +216,7 @@ instead. amrestore8, tar1, restore8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amflush.8.xml b/man/xml-source/amflush.8.xml index e52dc96..086f942 100644 --- a/man/xml-source/amflush.8.xml +++ b/man/xml-source/amflush.8.xml @@ -180,7 +180,7 @@ You'll get mail when amflush is finished. amanda8, amdump8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amgetconf.8.xml b/man/xml-source/amgetconf.8.xml index d0e668b..9dab511 100644 --- a/man/xml-source/amgetconf.8.xml +++ b/man/xml-source/amgetconf.8.xml @@ -209,7 +209,7 @@ keyword). SEE ALSO amanda8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amgpgcrypt.8.xml b/man/xml-source/amgpgcrypt.8.xml index e8ee04b..a2db468 100644 --- a/man/xml-source/amgpgcrypt.8.xml +++ b/man/xml-source/amgpgcrypt.8.xml @@ -165,7 +165,7 @@ mode. &amgpgcrypt; calls gpg with mdc disabled amcrypt8, amrestore8, gpg1, - http://wiki.zmanda.com + diff --git a/man/xml-source/amlabel.8.xml b/man/xml-source/amlabel.8.xml index 9c07fe7..47717a0 100644 --- a/man/xml-source/amlabel.8.xml +++ b/man/xml-source/amlabel.8.xml @@ -187,7 +187,7 @@ instead of a non-rewinding device name for amanda8, amdump8, amflush8, - http://wiki.zmanda.com + diff --git a/man/xml-source/ammt.8.xml b/man/xml-source/ammt.8.xml index bf19fb6..509eef8 100644 --- a/man/xml-source/ammt.8.xml +++ b/man/xml-source/ammt.8.xml @@ -219,7 +219,7 @@ and may include: SEE ALSO amanda8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amoverview.8.xml b/man/xml-source/amoverview.8.xml index adb5a6c..910eded 100644 --- a/man/xml-source/amoverview.8.xml +++ b/man/xml-source/amoverview.8.xml @@ -176,7 +176,7 @@ host2 /var 1 1 0 1 1 1 SEE ALSO amadmin8, amanda8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amplot.8.xml b/man/xml-source/amplot.8.xml index 1ee92fc..eac7c38 100644 --- a/man/xml-source/amplot.8.xml +++ b/man/xml-source/amplot.8.xml @@ -210,7 +210,7 @@ legitimate lines the program needs to be taught about. sh1, compress1, gzip1, - http://wiki.zmanda.com + diff --git a/man/xml-source/amrecover.8.xml b/man/xml-source/amrecover.8.xml index 2ce85ed..38770b3 100644 --- a/man/xml-source/amrecover.8.xml +++ b/man/xml-source/amrecover.8.xml @@ -590,7 +590,7 @@ but will be overridden by the -t switch. amrestore8, amfetchdump8, readline3, - http://wiki.zmanda.com + diff --git a/man/xml-source/amreport.8.xml b/man/xml-source/amreport.8.xml index 2b67d45..e8c6ea8 100644 --- a/man/xml-source/amreport.8.xml +++ b/man/xml-source/amreport.8.xml @@ -182,7 +182,7 @@ It may be used to make a hardcopy log of the tapes. SEE ALSO amanda8, amflush8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amrestore.8.xml b/man/xml-source/amrestore.8.xml index edae0d2..009e7df 100644 --- a/man/xml-source/amrestore.8.xml +++ b/man/xml-source/amrestore.8.xml @@ -343,7 +343,7 @@ College Park: Original text amflush8, tar1, restore8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amrmtape.8.xml b/man/xml-source/amrmtape.8.xml index ff7bb13..acdcb78 100644 --- a/man/xml-source/amrmtape.8.xml +++ b/man/xml-source/amrmtape.8.xml @@ -101,7 +101,7 @@ configuration. SEE ALSO amadmin8, amanda8, - http://wiki.zmanda.com + diff --git a/man/xml-source/amserverconfig.8.xml b/man/xml-source/amserverconfig.8.xml index 239143a..22a4f44 100644 --- a/man/xml-source/amserverconfig.8.xml +++ b/man/xml-source/amserverconfig.8.xml @@ -244,7 +244,7 @@ On success, zero is returned. On error, 1 is returned. amanda8, amanda.conf5, amaddclient8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amstatus.8.xml b/man/xml-source/amstatus.8.xml index ea2e275..6058f4b 100644 --- a/man/xml-source/amstatus.8.xml +++ b/man/xml-source/amstatus.8.xml @@ -158,7 +158,7 @@ Works only during the estimate phase. amdump8, amrestore8, amadmin8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amtape.8.xml b/man/xml-source/amtape.8.xml index c6c2d60..0d65052 100644 --- a/man/xml-source/amtape.8.xml +++ b/man/xml-source/amtape.8.xml @@ -224,7 +224,7 @@ commands to not eject the loaded tape if it is the one being requested. SEE ALSO amanda8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amtapetype.8.xml b/man/xml-source/amtapetype.8.xml index be32b25..06dbae4 100644 --- a/man/xml-source/amtapetype.8.xml +++ b/man/xml-source/amtapetype.8.xml @@ -151,7 +151,7 @@ now we just report it as zero. SEE ALSO amanda8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amtoc.8.xml b/man/xml-source/amtoc.8.xml index b53ec9d..8857a96 100644 --- a/man/xml-source/amtoc.8.xml +++ b/man/xml-source/amtoc.8.xml @@ -160,7 +160,7 @@ after an amgetconf8, cron, perl, -http://wiki.zmanda.com + diff --git a/man/xml-source/amverify.8.xml b/man/xml-source/amverify.8.xml index 723ec48..f68db90 100644 --- a/man/xml-source/amverify.8.xml +++ b/man/xml-source/amverify.8.xml @@ -83,7 +83,7 @@ man page for more details about Amanda. amrestore8, amanda8, amverifyrun8, -http://wiki.zmanda.com + diff --git a/man/xml-source/amverifyrun.8.xml b/man/xml-source/amverifyrun.8.xml index cd87d3e..24043a6 100644 --- a/man/xml-source/amverifyrun.8.xml +++ b/man/xml-source/amverifyrun.8.xml @@ -39,7 +39,7 @@ with these argument. SEE ALSO amanda8, amverify8, -http://wiki.zmanda.com + diff --git a/packaging/deb/amanda-backup-client.dirs b/packaging/deb/amanda-backup-client.dirs index 3c201ad..35eb344 100644 --- a/packaging/deb/amanda-backup-client.dirs +++ b/packaging/deb/amanda-backup-client.dirs @@ -4,6 +4,7 @@ usr/libexec/amanda usr/share/lintian/overrides usr/share/man/man5 usr/share/man/man8 +var/amanda var/lib/amanda var/lib/amanda/gnutar-lists var/lib/amanda/example diff --git a/packaging/deb/amanda-backup-server.dirs b/packaging/deb/amanda-backup-server.dirs index 026cce1..084741f 100644 --- a/packaging/deb/amanda-backup-server.dirs +++ b/packaging/deb/amanda-backup-server.dirs @@ -2,6 +2,7 @@ etc/amanda usr/share/lintian/overrides usr/share/man/man5 usr/share/man/man8 +var/amanda var/lib/amanda var/lib/amanda/gnutar-lists var/lib/amanda/example/label-templates diff --git a/packaging/deb/amanda-backup-server.postinst b/packaging/deb/amanda-backup-server.postinst index 76954d0..260db60 100755 --- a/packaging/deb/amanda-backup-server.postinst +++ b/packaging/deb/amanda-backup-server.postinst @@ -5,6 +5,7 @@ LOGDIR="/var/log/amanda/" SYSCONFDIR="/etc" LOCALSTATEDIR="/var" AMHOMEDIR="${LOCALSTATEDIR}/lib/amanda" +AMTMP="/tmp/amanda" amanda_user=amandabackup amanda_group=disk xinetd_reload="restart" @@ -33,14 +34,20 @@ echo "`date +'%b %e %Y %T'`: Installing '${LOCALSTATEDIR}/amanda/amandates'." if [ ! -f ${LOCALSTATEDIR}/amanda/amandates ] ; then touch ${LOCALSTATEDIR}/amanda/amandates || exit 1 fi -if [ ${ret_val} -eq 0 ]; then - echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${LOCALSTATEDIR}/amanda/amandates'." - chown ${amanda_user}:${amanda_group} ${LOCALSTATEDIR}/amanda/amandates || exit 1 - chmod 0640 ${LOCALSTATEDIR}/amanda/amandates || exit 1 - if [ -x /sbin/restorecon ] ; then - /sbin/restorecon ${LOCALSTATEDIR}/amanda/amandates || exit 1 - fi +echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${LOCALSTATEDIR}/amanda/amandates'." +chown ${amanda_user}:${amanda_group} ${LOCALSTATEDIR}/amanda/amandates || exit 1 +chmod 0640 ${LOCALSTATEDIR}/amanda/amandates || exit 1 +if [ -x /sbin/restorecon ] ; then + /sbin/restorecon ${LOCALSTATEDIR}/amanda/amandates || exit 1 +fi + +# Check for existence of and permissions on ${AMTMP} +if [ ! -d ${AMTMP} ]; then + mkdir ${AMTMP} || exit 1 fi +echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '${AMTMP}'." +chown ${amanda_user}:${amanda_group} ${AMTMP} || exit 1 +chmod 0640 ${AMTMP} || exit 1 # Install .gnupg directory echo "`date +'%b %e %Y %T'`: Installing '${AMHOMEDIR}/.gnupg'." diff --git a/packaging/deb/buildpkg b/packaging/deb/buildpkg index 79d8721..6e41192 100755 --- a/packaging/deb/buildpkg +++ b/packaging/deb/buildpkg @@ -49,7 +49,7 @@ fi if [ -z $AMVER ] then - AMVER=amanda-2.6.0 + AMVER=amanda-2.6.0p1 fi if [ -z $AMTARBALL ] @@ -113,9 +113,8 @@ do_package() { echo "Building package" cd $AMVER - # This assumes that you have loaded zmanda's GPG key into your keyring to - # sign the packages. - dpkg-buildpackage -rfakeroot -k3C5D1C92 -tc + # Create unsigned packages + dpkg-buildpackage -rfakeroot -uc -us } @@ -125,6 +124,5 @@ do_all() { do_package $1 } -do_build do_resources do_package diff --git a/packaging/deb/changelog b/packaging/deb/changelog index f6d8d84..63eabb3 100644 --- a/packaging/deb/changelog +++ b/packaging/deb/changelog @@ -1,6 +1,9 @@ -amanda (2.6.0-1) unstable; urgency=low +amanda (2.6.0p1-1) unstable; urgency=low * Initial debian release: This package is based on Bdale Garbee's work as the official debian maintainer for amanda. + * Found by Daniel_p: Fixed typos in preinst and postrm. Added permission + check for /tmp/amanda. Fixed rules to append default perl site_lib to + .install file so that perl modules are installed. -- Zmanda Mon, 10 Mar 2008 1:00:09 -0600 diff --git a/packaging/deb/preinst b/packaging/deb/preinst index 7b58632..645a662 100755 --- a/packaging/deb/preinst +++ b/packaging/deb/preinst @@ -68,14 +68,14 @@ else echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE} echo "`date +'%b %e %Y %T'`: HOME: /var/lib/amanda" >>${TMPFILE} - echo "`date +'%b %e %Y %T'`: Default group: ${amanda_group} " >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Default group: ${amanda_group}" >>${TMPFILE} echo "`date +'%b %e %Y %T'`: Verifying ${amanda_user} user parameters :" >>${TMPFILE} - if [ "`id -gn ${amanda_user}`" != "${amanda_group} " ] ; then + if [ "`id -gn ${amanda_user}`" != "${amanda_group}" ] ; then echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} - echo "`date +'%b %e %Y %T'`: !!! user '${amanda_user}' is not part of the ${amanda_group} group,Pl !!!" >>${TMPFILE} - echo "`date +'%b %e %Y %T'`: !!! make sure it is corrected before start using amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user '${amanda_user}' is not part of the ${amanda_group} group, !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! please make sure it is corrected before start using amanda !!!" >>${TMPFILE} echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} else echo "`date +'%b %e %Y %T'`: Verified group name of user '${amanda_user}'" >>${TMPFILE} @@ -87,13 +87,13 @@ fi if [ -d /var/lib/amanda ] ; then echo -n "`date +'%b %e %Y %T'`: Checking ownership of '/var/lib/amanda'... " >>${TMPFILE} if [ "`ls -dl /var/lib/amanda | awk '//{split($_,x); print x[3]}'`" = "${amanda_user}" ] && \ - [ "`ls -dl /var/lib/amanda | awk '//{split($_,x); print x[4]}'`" = "${amanda_group} " ] ; then + [ "`ls -dl /var/lib/amanda | awk '//{split($_,x); print x[4]}'`" = "${amanda_group}" ] ; then echo "correct." >>${TMPFILE} VARLIB_OK=0 else echo "incorrect!" >>${TMPFILE} echo "`date +'%b %e %Y %T'`: Please ensure that the directory '/var/lib/amanda' is owned by" >>${TMPFILE} - echo "`date +'%b %e %Y %T'`: the user '${amanda_user}' and group '${amanda_group} '." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: the user '${amanda_user}' and group '${amanda_group}'." >>${TMPFILE} VARLIB_OK=1 fi else diff --git a/packaging/deb/rules b/packaging/deb/rules index 4f78677..511e3f7 100755 --- a/packaging/deb/rules +++ b/packaging/deb/rules @@ -8,7 +8,7 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -AMVER=2.6.0 +AMVER=2.6.0p1 # These are variables that the user can override. They get used in various # places during configure, build, and install. @@ -24,6 +24,10 @@ SYSCONFDIR=/etc LOCALSTATEDIR=/var AMHOMEDIR=$(LOCALSTATEDIR)/lib/amanda LOGDIR=$(LOCALSTATEDIR)/log/amanda +# Extract the perl site_lib directory. This is used to install amanda's perl +# libs. If configure finds a different install or you specify a different path using +# --with-amperldir= make sure you change this variable as well. +PERLSITELIB=$(shell perl -V:installsitelib|sed -e"s:installsitelib='/::;s:'\;::") AMANDAUSER=amandabackup AMANDAGROUP=disk WITHOUT_SERVER="False" @@ -57,8 +61,6 @@ build-stamp: /sbin/dump /usr/bin/smbclient --enable-shared \ --sysconfdir=$(SYSCONFDIR) \ --localstatedir=$(LOCALSTATEDIR)\ - --with-star=/bin/star \ - --with-gnutar=/bin/tar \ --with-gnutar-listdir=$(AMHOMEDIR)/gnutar-lists \ --with-index-server=localhost \ --with-tape-server=localhost \ @@ -119,26 +121,25 @@ binary-arch: build dh_installchangelogs -v >> $(log) 2>&1 echo "---->dh_installdebconf: " >> $(log) dh_installdebconf -v >> $(log) 2>&1 - echo `pwd` >> $(log) - echo "---->dh_install -v: " >> $(log) + # Here's how we get the perl modules installed into sitelib + echo $(PERLSITELIB)/* >> debian/amanda-backup-server.install + echo "---->dh_install -v --fail-missing: " >> $(log) dh_install -v --sourcedir=debian/amanda-common >> $(log) 2>&1 echo "---->dh_strip: " >> $(log) dh_strip >> $(log) 2>&1 echo "---->dh_compress: " >> $(log) dh_compress >> $(log) 2>&1 - echo "---->dh_movefiles: " >> $(log) - dh_movefiles --sourcedir=debian/amanda-common >> $(log) 2>&1 echo "---->dh_fixperms: " >> $(log) dh_fixperms -v >> $(log) 2>&1 # fix perms manually chown -R $(AMANDAUSER):$(AMANDAGROUP) debian/*/var/lib/* #chmod -R u=rwX,g=rwX,o-rwx debian/*/var/lib/* - chown -R $(AMANDAUSER):$(AMANDAGROUP) $(server)/$(LOGDIR) + chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(LOGDIR) $(server)/$(LOGDIR) #chmod -R u=rwX,g=rwX,o-rwx $(server)/$(LOGDIR) - chown -R $(AMANDAUSER):$(AMANDAGROUP) $(server)/$(SYSCONFDIR)/amanda + chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(SYSCONFDIR)/amanda $(server)/$(SYSCONFDIR)/amanda #chmod -R u=rwX,g=rwX,o-rwx $(server)/$(SYSCONFDIR)/amanda - chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(AMHOMEDIR)/gnutar-lists - chmod -R u=rwX,g=rwX,o-rwx $(client)/$(AMHOMEDIR)/gnutar-lists + chown -R $(AMANDAUSER):$(AMANDAGROUP) $(client)/$(AMHOMEDIR)/gnutar-lists $(server)/$(AMHOMEDIR)/gnutar-lists + chmod -R u=rwX,g=rwX,o-rwx $(client)/$(AMHOMEDIR)/gnutar-lists $(server)/$(AMHOMEDIR)/gnutar-lists # .. setuid chown root:disk \ $(client)/$(AMLIBEXECDIR)/killpgrp \ @@ -174,6 +175,7 @@ binary-arch: build $(server)/usr/share/lintian/overrides/amanda-backup-server dh_makeshlibs >> $(log) 2>&1 dh_installdeb >> $(log) 2>&1 + dh_perl >> $(log) 2>&1 dh_shlibdeps -l"debian/$(r)/usr/lib:debian/$(client)/usr/lib:debian/$(server)/usr/lib" >> $(log) 2>&1 # strip out the non-versioned amanda-common references, we need # the versioned ones in the control file and dupes are ugly... diff --git a/packaging/rpm/amanda.spec b/packaging/rpm/amanda.spec index 51b87b8..b71eb0c 100644 --- a/packaging/rpm/amanda.spec +++ b/packaging/rpm/amanda.spec @@ -122,7 +122,7 @@ # --- Definitions --- # Define amanda_version if it is not already defined. -%{!?amanda_version: %define amanda_version 2.6.0} +%{!?amanda_version: %define amanda_version 2.6.0p1} %{!?amanda_release: %define amanda_release 1} %define amanda_version_info "Amanda Community Edition - version %{amanda_version}" %define amanda_user amandabackup @@ -426,7 +426,7 @@ echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TM # Check for the 'amanda' user echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE} if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then - useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} + useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} if [ %{dist} = "SuSE" ]; then PASSWD_EXIT=$? else @@ -791,7 +791,7 @@ echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TM # Check for the 'amanda' user echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE} if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then - useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} + useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} if [ %{dist} = "SuSE" ]; then PASSWD_EXIT=$? else @@ -1177,7 +1177,7 @@ echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TM # Check for the 'amanda' user echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE} if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then - useradd -c "Amanda" -M -g ${amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1 + useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1 if [ %{dist} = "SuSE" ]; then PASSWD_EXIT=$? else @@ -1635,6 +1635,8 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an # --- ChangeLog %changelog +* Fri May 02 2008 Dan Locks +- Changed instances of ${ to %%{ where applicable * Tue Mar 11 2008 Dan Locks - fixed many rpmlint complaints - added --quiet to configure statements diff --git a/packaging/rpm/amanda.spec.orig b/packaging/rpm/amanda.spec.orig new file mode 100644 index 0000000..b71eb0c --- /dev/null +++ b/packaging/rpm/amanda.spec.orig @@ -0,0 +1,1788 @@ +# +# Copyright (C) 2005 Zmanda Incorporated. +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120 +# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com +# + + +%define build_srpm 0 +%{?srpm_only: %define build_srpm 1} + +# Pkg-config sometimes needs its own path set, and we need to allow users to +# override our guess during detection. This macro takes care of that. +# If no --define PKG_CONFIG_PATH was passed and env var $PKG_CONFIG_PATH is +# set then use the env var. +%{!?PKG_CONFIG_PATH: %{expand:%(echo ${PKG_CONFIG_PATH:+"%%define PKG_CONFIG_PATH $PKG_CONFIG_PATH"})}} + +%{?PKG_CONFIG_PATH:%{echo:PKG_CONFIG_PATH = %{PKG_CONFIG_PATH}}} + +# Define which Distribution we are building: +# Try to detect the distribution we are building: +%if %{_vendor} == redhat + # Fedora symlinks /etc/fedora-release to /etc/redhat-release for at least + # fc3-7. So RHEL and Fedora look at the same file. The awk trickery here + # forces the field to be numeric so that the spec comparison works + %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 3 + %define dist fedora + %define disttag fc + %define distver 3 + %endif + %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print$4+0}' /etc/redhat-release) == 4 + %define dist fedora + %define disttag fc + %define distver 4 + %endif + %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 5 + %define dist fedora + %define disttag fc + %define distver 5 + %endif + %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $4+0}' /etc/redhat-release) == 6 + %define dist fedora + %define disttag fc + %define distver 6 + %endif + %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 7 + %define dist fedora + %define disttag fc + %define distver 7 + %endif + %if %(awk '{print $1}' /etc/redhat-release) == "Fedora" && %(awk '{print $3+0}' /etc/redhat-release) == 8 + %define dist fedora + %define disttag fc + %define distver 8 + # TODO: generalize this so that any platform can cross compile + %if %{_host_cpu} == x86_64 && %{_target_cpu} == i686 + # Do nothing if PKG_CONFIG_PATH was set by the user above. + %{!?PKG_CONFIG_PATH: %define PKG_CONFIG_PATH /usr/lib/pkgconfig} + %endif + %endif + %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 3 + %define dist redhat + %define disttag rhel + %define distver 3 + %endif + %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 4 + %define dist redhat + %define disttag rhel + %define distver 4 + %endif + %if %(awk '{print $1}' /etc/redhat-release) == "Red" && %(awk '{print $7+0}' /etc/redhat-release) == 5 + %define dist redhat + %define disttag rhel + %define distver 5 + %endif +%endif +# Detect Suse variants. Suse gives us some nice macros in their rpms +%if %{_vendor} == "suse" + %if %{suse_version} == 910 + %define dist SuSE + %define disttag sles + %define distver 9 + %endif + %if %{suse_version} == 1010 + %define dist SuSE + %define disttag sles + %define distver 10 + %endif + %if %{suse_version} == 1000 + %define dist SuSE + %define disttag suse + %define distver 10 + %endif +%endif + +# Set options per distribution +%if %{dist} == redhat || %{dist} == fedora + %define rpm_group Applications/Archiving + %define xinetd_reload restart +%endif +%if %{dist} == SuSE + %define rpm_group Productivity/Archiving/Backup + %define xinetd_reload restart +%endif + +%define packer %(%{__id_u} -n) + +# --- Definitions --- + +# Define amanda_version if it is not already defined. +%{!?amanda_version: %define amanda_version 2.6.0p1} +%{!?amanda_release: %define amanda_release 1} +%define amanda_version_info "Amanda Community Edition - version %{amanda_version}" +%define amanda_user amandabackup +%define amanda_group disk +%define udpportrange "700,740" +%define tcpportrange "11000,11040" +%define low_tcpportrange "700,710" + +Summary: The Amanda Backup and Archiving System +Name: amanda +Version: %{amanda_version} +%define rpm_release %{amanda_release}.%{disttag}%{distver} +%if %{build_srpm} +%define rpm_release %{amanda_release} +%endif +Release: %{rpm_release} +Source: %{name}-%{version}.tar.gz +License: http://wiki.zmanda.com/index.php/Amanda_Copyright +Vendor: Zmanda, Inc. +Packager: www.zmanda.com +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%{packer}-buildroot +Group: %{rpm_group} +# TODO - Need required versions for these: +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: binutils +BuildRequires: bison +BuildRequires: flex +BuildRequires: gcc +BuildRequires: glibc >= 2.2.0 +BuildRequires: readline +BuildRequires: curl >= 7.10.0 +Requires: /bin/awk +Requires: /bin/date +Requires: /usr/bin/id +Requires: /sbin/ldconfig +Requires: /bin/sh +Requires: /usr/sbin/useradd +Requires: /usr/sbin/usermod +Requires: fileutils +Requires: grep +Requires: gnuplot +Requires: libc.so.6 +Requires: libm.so.6 +Requires: libnsl.so.1 +Requires: curl >= 7.10.0 +Requires: xinetd +Requires: perl >= 5.6.0 +Requires: tar >= 1.15 +%if %{dist} == redhat || %{dist}== fedora +Requires: libtermcap.so.2 +Requires: initscripts +%endif +Provides: amanda-backup_client = %{amanda_version}, amanda-backup_server = %{amanda_version} + +%package backup_client +Summary: The Amanda Backup and Archiving Client +Group: %{rpm_group} +Requires: /bin/awk +Requires: fileutils +Requires: grep +%if %{dist} == redhat || %{dist}== fedora +Requires: libtermcap.so.2 +Requires: initscripts +%endif +Requires: xinetd +Requires: libc.so.6 +Requires: libm.so.6 +Requires: libnsl.so.1 +Requires: perl >= 5.6.0 +Requires: tar >= 1.15 +Provides: amanda-backup_client = %{amanda_version} +Provides: libamclient-%{version}.so = %{amanda_version} +Provides: libamanda-%{version}.so = %{amanda_version} +Conflicts: amanda-backup_server + +%package backup_server +Summary: The Amanda Backup and Archiving Server +Group: %{rpm_group} +Requires: /bin/awk +Requires: fileutils +Requires: grep +Requires: libc.so.6 +Requires: libm.so.6 +Requires: libnsl.so.1 +%if %{dist} == redhat || %{dist}== fedora +Requires: libtermcap.so.2 +Requires: initscripts +%endif +Requires: xinetd +Requires: perl >= 5.6.0 +Requires: tar >= 1.15 +Provides: amanda-backup_server = %{amanda_version} +Provides: libamclient-%{version}.so = %{amanda_version} +Provides: libamanda-%{version}.so = %{amanda_version} +Provides: libamserver-%{version}.so = %{amanda_version} +Provides: librestore-%{version}.so = %{amanda_version} +Provides: libamtape-%{version}.so = %{amanda_version} +Provides: libamdevice-%{version}.so = %{amanda_version} + +# --- Package descriptions --- + +%description +Amanda is the leading Open-Source Backup and Archiving software. + +The amanda-backup_server package should be installed on the Amanda server, i.e. +the machine attached to backup media (such as a tape drive or disk +drives) where backups will be written. The amanda-backup_server package +includes Amanda client. The amanda-backup_client package needs +to be installed on every system that is being backed up. + +Amanda Forums is located at: http://forums.zmanda.com/ +Amanda Documentation is available at: http://wiki.zmanda.com/ + + + +%description backup_server +Amanda is the leading Open-Source Backup and Archiving software. + +This package contains the Amanda server. The amanda-backup_server package +should be installed on the Amanda server, i.e. the machine attached +to backup media (such as a tape drive or disk drives) where backups +will be written. The amanda-backup_server package includes Amanda client. + +Amanda Forums is located at: http://forums.zmanda.com/ +Amanda Documentation is available at: http://wiki.zmanda.com/ + + + +%description backup_client +Amanda is the leading Open-Source Backup and Archiving software. + +This package contains the Amanda client. The amanda-backup_client package +needs to be installed on every system that is being backed up. + +Amanda Forums is located at: http://forums.zmanda.com/ +Amanda Documentation is available at: http://wiki.zmanda.com/ + +# --- Directory setup --- + +# Configure directories: +%define PREFIX /usr +%define EPREFIX %{PREFIX} +%define BINDIR %{EPREFIX}/bin +%define SBINDIR %{EPREFIX}/sbin +%define LIBEXECDIR %{EPREFIX}/libexec +%define AMLIBEXECDIR %{LIBEXECDIR}/amanda +%define DATADIR %{PREFIX}/share +%define SYSCONFDIR /etc +%define LOCALSTATEDIR /var +%define AMANDAHOMEDIR %{LOCALSTATEDIR}/lib/amanda +%ifarch x86_64 +%define LIBDIR %{EPREFIX}/lib64 +%else +%define LIBDIR %{EPREFIX}/lib +%endif +%define AMLIBDIR %{LIBDIR}/amanda +%define INCLUDEDIR %{PREFIX}/include +%define MANDIR %{DATADIR}/man +%define LOGDIR /var/log/amanda +%define PERLSITELIB %(eval "`perl -V:installsitelib`"; echo $installsitelib) + +# Installation directories: +%define ROOT_SBINDIR %{buildroot}/%{SBINDIR} +%define ROOT_LIBEXECDIR %{buildroot}/%{LIBEXECDIR} +%define ROOT_DATADIR %{buildroot}/%{DATADIR} +%define ROOT_LOCALSTATEDIR %{buildroot}/%{LOCALSTATEDIR} +%define ROOT_SYSCONFDIR %{buildroot}/%{SYSCONFDIR} +%define ROOT_AMANDAHOMEDIR %{buildroot}/%{AMANDAHOMEDIR} +%define ROOT_LIBDIR %{buildroot}/%{LIBDIR} +%define ROOT_MANDIR %{buildroot}/%{MANDIR} +%define ROOT_LOGDIR %{buildroot}/%{LOGDIR} + +# --- Unpack --- + +%prep +%setup -q +# --- Configure and compile --- + +%build +%define config_user %{amanda_user} +%define config_group %{amanda_group} + +%if %{disttag} == rhel && %{distver} == 3 +./configure \ + CFLAGS="%{optflags} -g" CXXFLAGS="%{optflags}" \ + --quiet \ + --prefix=%{PREFIX} \ + --sysconfdir=%{SYSCONFDIR} \ + --sharedstatedir=%{LOCALSTATEDIR} \ + --localstatedir=%{LOCALSTATEDIR} \ + --libdir=%{LIBDIR} \ + --includedir=%{INCLUDEDIR} \ + --with-gnuplot=/usr/bin/gnuplot \ + --with-gnutar=/bin/tar \ + --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \ + --with-index-server=localhost \ + --with-tape-server=localhost \ + --with-user=%{config_user} \ + --with-group=%{config_group} \ + --with-owner=%{packer} \ + --with-fqdn \ + --with-bsd-security \ + --with-bsdtcp-security \ + --with-bsdudp-security \ + --with-ssh-security \ + --with-udpportrange=%{udpportrange} \ + --with-tcpportrange=%{tcpportrange} \ + --with-low-tcpportrange=%{low_tcpportrange} \ + --with-debugging=%{LOGDIR} \ + --with-assertions \ + --disable-installperms \ + --without-ipv6 +%else +# This confusing macro results in PKG_CONFIG_PATH=some/path if some/path +# was set on the command line, or by the platform detection bits. +./configure \ + %{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \ + CFLAGS="%{optflags} -g" CXXFLAGS="%{optflags}" \ + --quiet \ + --prefix=%{PREFIX} \ + --sysconfdir=%{SYSCONFDIR} \ + --sharedstatedir=%{LOCALSTATEDIR} \ + --localstatedir=%{LOCALSTATEDIR} \ + --libdir=%{LIBDIR} \ + --includedir=%{INCLUDEDIR} \ + --with-star=/usr/bin/star \ + --with-gnuplot=/usr/bin/gnuplot \ + --with-gnutar=/bin/tar \ + --with-gnutar-listdir=%{AMANDAHOMEDIR}/gnutar-lists \ + --with-index-server=localhost \ + --with-tape-server=localhost \ + --with-user=%{config_user} \ + --with-group=%{config_group} \ + --with-owner=%{packer} \ + --with-fqdn \ + --with-bsd-security \ + --with-bsdtcp-security \ + --with-bsdudp-security \ + --with-ssh-security \ + --with-udpportrange=%{udpportrange} \ + --with-tcpportrange=%{tcpportrange} \ + --with-low-tcpportrange=%{low_tcpportrange} \ + --with-debugging=%{LOGDIR} \ + --with-assertions \ + --disable-installperms +%endif + +make + +# --- Install to buildroot --- + +%install +if [ "%{buildroot}" != "/" ]; then + if [ -d "%{buildroot}" ] ; then + rm -rf %{buildroot} + fi +else + echo "BuildRoot was somehow set to / !" + exit -1 +fi + +make -j1 DESTDIR=%{buildroot} install + +rm -rf %{ROOT_DATADIR}/amanda +rm -f %{ROOT_AMANDAHOMEDIR}/example/inetd.conf.amandaclient +mkdir %{buildroot}/{etc,var/log} +mkdir %{ROOT_LOCALSTATEDIR}/amanda +mkdir %{ROOT_SYSCONFDIR}/amanda +mkdir %{ROOT_AMANDAHOMEDIR}/gnutar-lists +mkdir %{ROOT_LOGDIR} + +echo "%{amanda_version_info}" >%{ROOT_AMANDAHOMEDIR}/amanda-release + +# --- Clean up buildroot --- + +%clean +if [ "%{buildroot}" != "/" ]; then + if [ -d "%{buildroot}" ] ; then + rm -rf %{buildroot} + fi +else + echo "BuildRoot was somehow set to / !" + exit -1 +fi + +# --- Pre/post (un)installation scripts --- + +%pre +TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to mktemp!" 1>&2 + exit 1 +fi +LOGDIR="%{LOGDIR}" +INSTALL_LOG="${LOGDIR}/install.log" +INSTALL_ERR="${LOGDIR}/install.err" + +echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE} + +# Check for the 'amanda' user +echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE} +if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then + useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} + if [ %{dist} = "SuSE" ]; then + PASSWD_EXIT=$? + else + # Lock the amanda account until admin sets password + passwd -l %{amanda_user} >>/dev/null + PASSWD_EXIT=$? + fi + if [ ${PASSWD_EXIT} -eq 0 ] ; then + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The '%{amanda_user}; user account has been successfully created." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Furthermore, the account has been automatically locked for you" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: for security purposes. Once a password for the '%{amanda_user}'" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: account has been set, the user can be unlocked by issuing" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: the following command as root.:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: # passwd -u %{amanda_user}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: If this is not a new installation of Amanda and you have" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: in those configurations. Additionally, you should ensure" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: is properly configured to allow connections for the user" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{amanda_user}'." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + PASSWD_OK=0 + else + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! The '%{amanda_user}' user account for this system has been !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! created, however the user has no password set. For !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! security purposes this account is normally locked !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! after creation. Unfortunately, when locking this !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! account an error occurred. To ensure the security !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! of your system you should set a password for the !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user account '%{amanda_user}' immediately! To set such a !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! password, please issue the following command.: !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! # passwd %{amanda_user} !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + PASSWD_OK=1 + fi +else + # log information about 'amanda' user parameters + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The Amanda backup software is configured to operate as the" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: user '%{amanda_user}'. This user exists on your system and has not" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: been modified. To ensure that Amanda functions properly," >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE} + + if [ "`id -gn %{amanda_user}`" != "disk" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! make sure it is corrected before start using amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE} + fi + + if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE} + fi + + if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' home directory should be set to !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! %{AMANDAHOMEDIR} Pl correct before using Amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified Default home directory for user amandabackup" >>${TMPFILE} + fi + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + PASSWD_OK=0 +fi +if [ -d %{AMANDAHOMEDIR} ] ; then + echo -n "`date +'%b %e %Y %T'`: Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE} + if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \ + [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then + echo "correct." >>${TMPFILE} + VARLIB_OK=0 + else + echo "incorrect!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE} + VARLIB_OK=1 + fi +else + VARLIB_OK=0 +fi +echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} +if [ ! -e ${LOGDIR} ] ; then + # create log directory + mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1 + chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1 +elif [ ! -d ${LOGDIR} ] ; then + mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1 + mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1 + chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1 + mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1 +fi + +if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} + echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2 + echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'." + exit 1 +else + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi + +echo "`date +'%b %e %Y %T'`: === Amanda installation started. ===" >${TMPFILE} + +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} +if [ -f "${TMPFILE}" ]; then + rm -f "${TMPFILE}" +fi + +%post +TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX +if [ $? -ne 0 ]; then + echo "Unable to mktemp!" 1>&2 + exit 1 +fi +LOGDIR="%{LOGDIR}" +INSTALL_LOG="${LOGDIR}/install.log" +INSTALL_ERR="${LOGDIR}/install.err" + +echo -n "`date +'%b %e %Y %T'`: Updating library cache..." >${TMPFILE} +/sbin/ldconfig >>${TMPFILE} 2>&1 +echo "done." >>${TMPFILE} +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then + if [ ! -f /etc/xinetd.d/amandaserver ] ; then + cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver + chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1 + if [ -f /etc/xinetd.d/amandaclient ] ; then + rm /etc/xinetd.d/amandaclient + fi + echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE} + if [ "%{xinetd_reload}" == "reload" ] ; then + /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -ne 0 ] ; then + echo -n "reload failed. Attempting restart..." >>${TMPFILE} + /etc/init.d/xinetd restart >>${TMPFILE} 2>&1 + ret_val=$? + fi + else + /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1 + ret_val=$? + fi + if [ ${ret_val} -eq 0 ] ; then + echo "success." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + else + echo "failed. Please check your system logs." >>${TMPFILE} + cat ${TMPFILE} 1>&2 + cat ${TMPFILE} >>${INSTALL_ERR} + fi + fi +fi + +echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE} +ret_val=0 +if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then + touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE} + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + if [ -x /sbin/restorecon ] ; then + /sbin/restorecon %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +else + echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} +fi + + +# Install .gnupg directory +echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE} +ret_val=0 +if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE} + mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE} + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +else + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} +fi + +# Install .amandahosts +echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE} +if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then + touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +fi +for host in localhost localhost.localdomain ; do + if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then + echo "${host} root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts + fi + if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then + echo "${host} %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts + fi +done +chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# SSH RSA key generation for amdump +KEYDIR="%{AMANDAHOMEDIR}/.ssh" +KEYFILE="id_rsa_amdump" +COMMENT="%{amanda_user}@server" +if [ ! -d ${KEYDIR} ] ; then + if [ -f ${KEYDIR} ] ; then + echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE} + mv ${KEYDIR} ${KEYDIR}.rpmsave + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + fi + echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE} + mkdir ${KEYDIR} >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then + echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE} +chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1 +chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1 +chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# SSH RSA key generation on client for amrecover +KEYDIR="%{AMANDAHOMEDIR}/.ssh" +KEYFILE="id_rsa_amrecover" +COMMENT="root@client" +if [ ! -d ${KEYDIR} ] ; then + if [ -f ${KEYDIR} ] ; then + echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE} + mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + fi + echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE} + mkdir ${KEYDIR} >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then + echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE} + ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}'" >${TMPFILE} +chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1 +chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1 +chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# environment variables (~amandabackup/.profile) +echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE} +if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then + touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +fi +if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then + echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE} +fi +echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >>${TMPFILE} +chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG} +if [ -x /usr/bin/wget ]; then + /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server +fi + +echo "`date +'%b %e %Y %T'`: === Amanda installation complete. ===" >${TMPFILE} + +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} +if [ -f "${TMPFILE}" ]; then + rm -f "${TMPFILE}" +fi + +echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'." +%postun +/sbin/ldconfig +%pre backup_server +TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to mktemp!" 1>&2 + exit 1 +fi + +LOGDIR="%{LOGDIR}" +INSTALL_LOG="${LOGDIR}/install.log" +INSTALL_ERR="${LOGDIR}/install.err" + +echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE} + +# Check for the 'amanda' user +echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE} +if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then + useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} + if [ %{dist} = "SuSE" ]; then + PASSWD_EXIT=$? + else + # Lock the amanda account until admin sets password + passwd -l %{amanda_user} >>/dev/null + PASSWD_EXIT=$? + fi + if [ ${PASSWD_EXIT} -eq 0 ] ; then + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The '%{amanda_user}; user account has been successfully created." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Furthermore, the account has been automatically locked for you" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: for security purposes. Once a password for the '%{amanda_user}'" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: account has been set, the user can be unlocked by issuing" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: the following command as root.:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: # passwd -u %{amanda_user}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: If this is not a new installation of Amanda and you have" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: in those configurations. Additionally, you should ensure" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: is properly configured to allow connections for the user" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{amanda_user}'." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + PASSWD_OK=0 + else + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! The '%{amanda_user}' user account for this system has been !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! created, however the user has no password set. For !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! security purposes this account is normally locked !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! after creation. Unfortunately, when locking this !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! account an error occurred. To ensure the security !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! of your system you should set a password for the !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user account '%{amanda_user}' immediately! To set such a !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! password, please issue the following command.: !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! # passwd %{amanda_user} !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + PASSWD_OK=1 + fi +else + # log information about 'amanda' user parameters + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The Amanda backup software is configured to operate as the" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: user '%{amanda_user}'. This user exists on your system and has not" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: been modified. To ensure that Amanda functions properly," >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE} + + if [ "`id -gn %{amanda_user}`" != "disk" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! make sure it is corrected before start using Amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE} + fi + + if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE} + fi + + if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' home directory should be set to !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! %{AMANDAHOMEDIR} Pl correct before using Amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified Default home directory for user amandabackup" >>${TMPFILE} + fi + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + PASSWD_OK=0 +fi +if [ -d %{AMANDAHOMEDIR} ] ; then + echo -n "`date +'%b %e %Y %T'`: Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE} + if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \ + [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then + echo "correct." >>${TMPFILE} + VARLIB_OK=0 + else + echo "incorrect!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE} + VARLIB_OK=1 + fi +else + VARLIB_OK=0 +fi +echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + +if [ ! -e ${LOGDIR} ] ; then + # create log directory + mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1 + chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1 +elif [ ! -d ${LOGDIR} ] ; then + mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1 + mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1 + chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1 + mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1 +fi +if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} + echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2 + echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'." + exit 1 +else + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi + +echo "`date +'%b %e %Y %T'`: === Amanda backup server installation started. ===" >${TMPFILE} + +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} +if [ -f "${TMPFILE}" ]; then + rm -f "${TMPFILE}" +fi +%post backup_server +TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to mktemp!" 1>&2 + exit 1 +fi +LOGDIR="%{LOGDIR}" +INSTALL_LOG="${LOGDIR}/install.log" +INSTALL_ERR="${LOGDIR}/install.err" + +echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE} +/sbin/ldconfig +echo "done." >>${TMPFILE} +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then + if [ ! -f /etc/xinetd.d/amandaserver ] ; then + cp %{AMANDAHOMEDIR}/example/xinetd.amandaserver /etc/xinetd.d/amandaserver + chmod 0644 /etc/xinetd.d/amandaserver >>${TMPFILE} 2>&1 + if [ -f /etc/xinetd.d/amandaclient ] ; then + rm /etc/xinetd.d/amandaclient + fi + + echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE} + if [ "%{xinetd_reload}" == "reload" ] ; then + /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -ne 0 ] ; then + echo -n "reload failed. Attempting restart..." >>${TMPFILE} + /etc/init.d/xinetd restart >>${TMPFILE} 2>&1 + ret_val=$? + fi + else + /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1 + ret_val=$? + fi + if [ ${ret_val} -eq 0 ] ; then + echo "success." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + else + echo "failed. Please check your system logs." >>${TMPFILE} + cat ${TMPFILE} 1>&2 + cat ${TMPFILE} >>${INSTALL_ERR} + fi + fi +fi + +echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE} +ret_val=0 +if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then + touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE} + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +else + echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} +fi + +# Install .amandahosts to server +echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE} +if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then + touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +fi +for host in localhost localhost.localdomain ; do + if [ -z "`grep \"^${host}[[:blank:]]\+root[[:blank:]]\+amindexd[[:blank:]]\+amidxtaped\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then + echo "${host} root amindexd amidxtaped" >>%{AMANDAHOMEDIR}/.amandahosts + fi + if [ -z "`grep \"^${host}[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\" %{AMANDAHOMEDIR}/.amandahosts`" ] ; then + echo "${host} %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts + fi +done +chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# Install amanda client configuration file +echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE} +if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then + cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1 +fi +chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1 +chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# install am_passphrase file to server +echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE} +if [ ! -f %{AMANDAHOMEDIR}/.am_passphrase ] ; then + echo "`date +'%b %e %Y %T'`: Create '%{AMANDAHOMEDIR}/.am_passphrase' file." >${TMPFILE} + touch %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1 + phrase=`echo "amandabackup" | md5sum | awk '{print $1}'` + echo ${phrase} >>%{AMANDAHOMEDIR}/.am_passphrase + + chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1 + chmod 0700 %{AMANDAHOMEDIR}/.am_passphrase >>${TMPFILE} 2>&1 +fi +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# Install .gnupg directory +echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE} +ret_val=0 +if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE} + mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE} + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +else + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} +fi + +# SSH RSA key generation on server for amdump +KEYDIR="%{AMANDAHOMEDIR}/.ssh" +KEYFILE="id_rsa_amdump" +COMMENT="%{amanda_user}@server" +if [ ! -d ${KEYDIR} ] ; then + if [ -f ${KEYDIR} ] ; then + echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE} + mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + fi + echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE} + mkdir ${KEYDIR} >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then + echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE} + ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE} +chown %{amanda_user}:%{amanda_group} ${KEYDIR} ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1 +chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1 +chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# SSH RSA key generation on client for amrecover +KEYDIR="%{AMANDAHOMEDIR}/.ssh" +KEYFILE="id_rsa_amrecover" +COMMENT="root@client" +if [ ! -d ${KEYDIR} ] ; then + if [ -f ${KEYDIR} ] ; then + echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE} + mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + fi + echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE} + mkdir ${KEYDIR} >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then + echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE} + ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '${KEYDIR}'" >${TMPFILE} +chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1 +chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1 +chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# environment variables (~amandabackup/.profile) +echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE} +if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then + touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +fi +if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then + echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE} +fi +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE} +chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG} +if [ -x /usr/bin/wget ]; then + /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=server +fi + +echo "`date +'%b %e %Y %T'`: === Amanda backup server installation complete. ===" >${TMPFILE} + +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +if [ -f "${TMPFILE}" ]; then + rm -f "${TMPFILE}" >>${TMPFILE} 2>&1 +fi + +echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'." +%postun backup_server +/sbin/ldconfig +%pre backup_client +TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to mktemp!" 1>&2 + exit 1 +fi +LOGDIR="%{LOGDIR}" +INSTALL_LOG="${LOGDIR}/install.log" +INSTALL_ERR="${LOGDIR}/install.err" + +echo "`date +'%b %e %Y %T'`: Preparing to install: %{amanda_version_info}" >${TMPFILE} + +# Check for the 'amanda' user +echo "`date +'%b %e %Y %T'`: Checking for '%{amanda_user}' user..." >>${TMPFILE} +if [ "`id -u %{amanda_user} > /dev/null 2>&1 && echo 0 || echo 1`" != "0" ] ; then + useradd -c "Amanda" -M -g %{amanda_group} -d %{AMANDAHOMEDIR} -s /bin/sh %{amanda_user} >>${TMPFILE} 2>&1 + if [ %{dist} = "SuSE" ]; then + PASSWD_EXIT=$? + else + # Lock the amanda account until admin sets password + passwd -l %{amanda_user} >>/dev/null + PASSWD_EXIT=$? + fi + if [ ${PASSWD_EXIT} -eq 0 ] ; then + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The '%{amanda_user}; user account has been successfully created." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Furthermore, the account has been automatically locked for you" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: for security purposes. Once a password for the '%{amanda_user}'" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: account has been set, the user can be unlocked by issuing" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: the following command as root.:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: # passwd -u %{amanda_user}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: If this is not a new installation of Amanda and you have" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: pre-existing Amanda configurations in %{SYSCONFDIR}/amanda" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: you should ensure that 'dumpuser' is set to '%{amanda_user}'" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: in those configurations. Additionally, you should ensure" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: that %{AMANDAHOMEDIR}/.amandahosts on your client systems" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: is properly configured to allow connections for the user" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: '%{amanda_user}'." >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + PASSWD_OK=0 + else + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! The '%{amanda_user}' user account for this system has been !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! created, however the user has no password set. For !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! security purposes this account is normally locked !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! after creation. Unfortunately, when locking this !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! account an error occurred. To ensure the security !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! of your system you should set a password for the !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user account '%{amanda_user}' immediately! To set such a !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! password, please issue the following command.: !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! # passwd %{amanda_user} !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + PASSWD_OK=1 + fi +else + # log information about 'amanda' user parameters + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: The Amanda backup software is configured to operate as the" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: user '%{amanda_user}'. This user exists on your system and has not" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: been modified. To ensure that Amanda functions properly," >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: please see that the following parameters are set for that" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: user.:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: SHELL: /bin/sh" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: HOME: %{AMANDAHOMEDIR}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Default group: %{amanda_group}" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Verifying %{amanda_user} parameters :" >>${TMPFILE} + + if [ "`id -gn %{amanda_user}`" != "disk" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' is not part of the disk group,Pl !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! make sure it is corrected before start using Amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified group name of user 'amandabackup'" >>${TMPFILE} + fi + + if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f7`" != "/bin/sh" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' default shell should be set to !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! /bin/sh, pl correct before start using Amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified Default shell for user 'amandabackup'" >>${TMPFILE} + fi + + if [ "`grep ^%{amanda_user} /etc/passwd|cut -d: -f6`" != "%{AMANDAHOMEDIR}" ] ; then + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! user 'amandabackup' home directory should be set to !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! %{AMANDAHOMEDIR} Pl correct before using Amanda !!!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: !!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!" >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: Verified Default home directory for user amandabackup" >>${TMPFILE} + fi + echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + PASSWD_OK=0 +fi +if [ -d %{AMANDAHOMEDIR} ] ; then + echo -n "`date +'%b %e %Y %T'`: Checking ownership of '%{AMANDAHOMEDIR}'... " >>${TMPFILE} + if [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[3]}'`" = "%{amanda_user}" ] && \ + [ "`ls -dl %{AMANDAHOMEDIR} | awk '//{split($_,x); print x[4]}'`" = "%{amanda_group}" ] ; then + echo "correct." >>${TMPFILE} + VARLIB_OK=0 + else + echo "incorrect!" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: Please ensure that the directory '%{AMANDAHOMEDIR}' is owned by" >>${TMPFILE} + echo "`date +'%b %e %Y %T'`: the user '%{amanda_user}' and group '%{amanda_group}'." >>${TMPFILE} + VARLIB_OK=1 + fi +else + VARLIB_OK=0 +fi +echo "`date +'%b %e %Y %T'`:" >>${TMPFILE} + +if [ ! -e ${LOGDIR} ] ; then + # create log directory + mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1 + chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1 +elif [ ! -d ${LOGDIR} ] ; then + mv ${LOGDIR} ${LOGDIR}.rpmsave >>${TMPFILE} 2>&1 + mkdir -m 0750 ${LOGDIR} >>${TMPFILE} 2>&1 + chown %{amanda_user}:%{amanda_group} ${LOGDIR} >>${TMPFILE} 2>&1 + mv ${LOGDIR}.rpmsave ${LOGDIR}/ >>${TMPFILE} 2>&1 +fi +if [ ${PASSWD_OK} -eq 1 ] || [ ${VARLIB_OK} -eq 1 ] ; then + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} + echo "Please review '${INSTALL_ERR}' to correct errors which have prevented the Amanda installaton." >&2 + echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'." + exit 1 +else + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi + +echo "`date +'%b %e %Y %T'`: === Amanda backup client installation started. ===" >${TMPFILE} + +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +if [ -f "${TMPFILE}" ]; then + rm -f "${TMPFILE}" +fi + +%post backup_client +TMPFILE=`mktemp /tmp/rpm-amanda.XXXXXXXXXXX` +if [ $? -ne 0 ]; then + echo "Unable to mktemp!" 1>&2 + exit 1 +fi +LOGDIR="%{LOGDIR}" +INSTALL_LOG="${LOGDIR}/install.log" +INSTALL_ERR="${LOGDIR}/install.err" + +echo -n "`date +'%b %e %Y %T'`: Updating system library cache..." >${TMPFILE} +/sbin/ldconfig +echo "done." >>${TMPFILE} +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +if [ -e /etc/xinetd.d ] && [ -d /etc/xinetd.d ] ; then + if [ ! -f /etc/xinetd.d/amandaclient ] ; then + cp %{AMANDAHOMEDIR}/example/xinetd.amandaclient /etc/xinetd.d/amandaclient + + echo -n "`date +'%b %e %Y %T'`: Reloading xinetd configuration..." >${TMPFILE} + if [ "%{xinetd_reload}" == "reload" ] ; then + /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -ne 0 ] ; then + echo -n "reload failed. Attempting restart..." >>${TMPFILE} + /etc/init.d/xinetd restart >>${TMPFILE} 2>&1 + ret_val=$? + fi + else + /etc/init.d/xinetd %{xinetd_reload} >>${TMPFILE} 2>&1 + ret_val=$? + fi + if [ ${ret_val} -eq 0 ] ; then + echo "success." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + else + echo "failed. Please check your system logs." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + fi + fi +fi + +echo "`date +'%b %e %Y %T'`: Installing '%{LOCALSTATEDIR}/amanda/amandates'." >${TMPFILE} +ret_val=0 +if [ ! -f %{LOCALSTATEDIR}/amanda/amandates ] ; then + touch %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: The file '%{LOCALSTATEDIR}/amanda/amandates' has been created." >>${TMPFILE} + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{LOCALSTATEDIR}/amanda/amandates'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 + chmod 0640 %{LOCALSTATEDIR}/amanda/amandates >>${TMPFILE} 2>&1 +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation successful." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +else + echo "`date +'%b %e %Y %T'`: '%{LOCALSTATEDIR}/amanda/amandates' Installation failed." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} +fi + +# Install .amandahosts to client +echo "`date +'%b %e %Y %T'`: Checking '%{AMANDAHOMEDIR}/.amandahosts' file." >${TMPFILE} +if [ ! -f %{AMANDAHOMEDIR}/.amandahosts ] ; then + touch %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +fi +for host in localhost localhost.localdomain ; do + if [ -z "`grep \"^${host}[[:blank:]]\+\" %{AMANDAHOMEDIR}/.amandahosts | grep \"[[:blank:]]\+%{amanda_user}[[:blank:]]\+amdump\"`" ] ; then + echo "${host} %{amanda_user} amdump" >>%{AMANDAHOMEDIR}/.amandahosts + fi +done +chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +chmod 0600 %{AMANDAHOMEDIR}/.amandahosts >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# Install amanda client configuration file +echo "`date +'%b %e %Y %T'`: Checking '%{SYSCONFDIR}/amanda/amanda-client.conf' file." >${TMPFILE} +if [ ! -f %{SYSCONFDIR}/amanda/amanda-client.conf ] ; then + cp %{AMANDAHOMEDIR}/example/amanda-client.conf %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1 +fi +chown %{amanda_user}:%{amanda_group} %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1 +chmod 0600 %{SYSCONFDIR}/amanda/amanda-client.conf >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# Install .gnupg directory +echo "`date +'%b %e %Y %T'`: Installing '%{AMANDAHOMEDIR}/.gnupg'." >${TMPFILE} +ret_val=0 +if [ ! -d %{AMANDAHOMEDIR}/.gnupg ] ; then + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' will be created." >>${TMPFILE} + mkdir %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' created successfully." >>${TMPFILE} + else + echo "`date +'%b %e %Y %T'`: The directory '%{AMANDAHOMEDIR}/.gnupg' creation failed." >>${TMPFILE} + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: Ensuring correct permissions for '%{SYSCONFDIR}/.gnupg'." >>${TMPFILE} + chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + if [ ${ret_val} -eq 0 ]; then + chmod 700 %{AMANDAHOMEDIR}/.gnupg >>${TMPFILE} 2>&1 + ret_val=$? + fi +fi +if [ ${ret_val} -eq 0 ]; then + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation successful." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +else + echo "`date +'%b %e %Y %T'`: '%{AMANDAHOMEDIR}/.gnupg' Installation failed." >>${TMPFILE} + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_ERR} +fi + +# SSH RSA key generation on client for amrecover +KEYDIR="%{AMANDAHOMEDIR}/.ssh" +KEYFILE="id_rsa_amrecover" +COMMENT="root@client" +if [ ! -d ${KEYDIR} ] ; then + if [ -f ${KEYDIR} ] ; then + echo "`date +'%b %e %Y %T'`: Directory '${KEYDIR}' exists as a file. Renaming to '${KEYDIR}.rpmsave'." >${TMPFILE} + mv ${KEYDIR} ${KEYDIR}.rpmsave >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} + fi + echo "`date +'%b %e %Y %T'`: Creating directory '${KEYDIR}'." >${TMPFILE} + mkdir ${KEYDIR} >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +if [ ! -f ${KEYDIR}/${KEYFILE} ] ; then + echo "`date +'%b %e %Y %T'`: Creating ssh RSA key in '${KEYDIR}/${KEYFILE}'" >${TMPFILE} + ssh-keygen -q -C $COMMENT -t rsa -f ${KEYDIR}/${KEYFILE} -N '' >>${TMPFILE} 2>&1 + cat ${TMPFILE} + cat ${TMPFILE} >>${INSTALL_LOG} +fi +echo "`date +'%b %e %Y %T'`: Setting permissions for '${KEYDIR}' and '${KEYDIR}/${KEYFILE}*'" >${TMPFILE} +chown %{amanda_user}:%{amanda_group} ${KEYDIR} >>${TMPFILE} 2>&1 +chmod 0750 ${KEYDIR} >>${TMPFILE} 2>&1 +chmod 0600 ${KEYDIR}/${KEYFILE}* >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +# environment variables (~amandabackup/.profile) +echo "`date +'%b %e %Y %T'`: Checking for '%{AMANDAHOMEDIR}/.profile' and ensuring correct environment." >${TMPFILE} +if [ ! -f %{AMANDAHOMEDIR}/.profile ] ; then + touch %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +fi +if [ -z "`grep PATH %{AMANDAHOMEDIR}/.profile | grep '%{SBINDIR}'`" ] ; then + echo "export PATH=\"\$PATH:%{SBINDIR}\"" >>%{AMANDAHOMEDIR}/.profile 2>>${TMPFILE} +fi +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} +echo "`date +'%b %e %Y %T'`: Setting ownership and permissions for '%{AMANDAHOMEDIR}/.profile'" >${TMPFILE} +chown %{amanda_user}:%{amanda_group} %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +chmod 0640 %{AMANDAHOMEDIR}/.profile >>${TMPFILE} 2>&1 +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +echo "`date +'%b %e %Y %T'`: Sending anonymous distribution and version information to Zmanda" >> ${INSTALL_LOG} +if [ -x /usr/bin/wget ]; then + /usr/bin/wget -q -o /dev/null -O - --timeout=5 http://www.zmanda.com/amanda-tips.php\?version=%{amanda_version}\&os=%{disttag}%{distver}\&type=client +fi + +echo "`date +'%b %e %Y %T'`: === Amanda backup client installation complete. ===" >>${TMPFILE} +cat ${TMPFILE} +cat ${TMPFILE} >>${INSTALL_LOG} + +if [ -f "${TMPFILE}" ]; then + rm -f "${TMPFILE}" +fi + +echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if any) in '${INSTALL_ERR}'." +%postun backup_client +/sbin/ldconfig + +# --- Files to install --- + +%files backup_client +%defattr(0755,%{amanda_user},%{amanda_group}) +%{SYSCONFDIR}/amanda +%{AMANDAHOMEDIR} +%{AMLIBEXECDIR} +%{AMLIBDIR} +%{AMLIBEXECDIR}/amanda-sh-lib.sh +%{LOCALSTATEDIR}/amanda +%defattr(4750,root,disk) +%{AMLIBEXECDIR}/calcsize +%{AMLIBEXECDIR}/killpgrp +%{AMLIBEXECDIR}/rundump +%{AMLIBEXECDIR}/runtar +%defattr(0750,%{amanda_user},%{amanda_group}) +%{LOGDIR} +%{SBINDIR}/amaespipe +%{SBINDIR}/amcryp* +%{SBINDIR}/amgpgcrypt +%{SBINDIR}/amoldrecover +%{SBINDIR}/amrecover +%defattr(0644,%{amanda_user},%{amanda_group}) +%docdir %{MANDIR} +%{MANDIR}/man5/amanda.conf.5.gz +%{MANDIR}/man5/amanda-client.conf.5.gz +%{MANDIR}/man8/amanda.8.gz +%{MANDIR}/man8/amcheckdump.8.gz +%{MANDIR}/man8/amrecover.8.gz +%{AMLIBEXECDIR}/amcat.awk +%{AMANDAHOMEDIR}/amanda-release +%{AMANDAHOMEDIR}/example/xinetd.amandaclient +%{AMANDAHOMEDIR}/example/amanda-client.conf + +%files backup_server +%defattr(0755,%{amanda_user},%{amanda_group}) +%{SYSCONFDIR}/amanda +%{AMLIBEXECDIR} +%{AMLIBDIR} +%{PERLSITELIB}/Amanda +%{PERLSITELIB}/auto/Amanda +%{AMANDAHOMEDIR} +%{LOCALSTATEDIR}/amanda +%{SBINDIR}/amaddclient +%{SBINDIR}/amadmin +%{SBINDIR}/amcheckdb +%{SBINDIR}/amcheckdump +%{SBINDIR}/amcleanup +%{SBINDIR}/amdd +%{SBINDIR}/amdevcheck +%{SBINDIR}/amdump +%{SBINDIR}/amfetchdump +%{SBINDIR}/amflush +%{SBINDIR}/amgetconf +%{SBINDIR}/amlabel +%{SBINDIR}/ammt +%{SBINDIR}/amoverview +%{SBINDIR}/amplot +%{SBINDIR}/amreport +%{SBINDIR}/amrestore +%{SBINDIR}/amrmtape +%{SBINDIR}/amserverconfig +%{SBINDIR}/amstatus +%{SBINDIR}/amtape +%{SBINDIR}/amtapetype +%{SBINDIR}/amtoc +%{SBINDIR}/amverify +%{SBINDIR}/amverifyrun +%{AMLIBEXECDIR}/amanda-sh-lib.sh +%defattr(4750,root,disk) +%{AMLIBEXECDIR}/calcsize +%{AMLIBEXECDIR}/killpgrp +%{AMLIBEXECDIR}/rundump +%{AMLIBEXECDIR}/runtar +%{AMLIBEXECDIR}/dumper +%{AMLIBEXECDIR}/planner +%{SBINDIR}/amcheck +%defattr(0750,%{amanda_user},%{amanda_group}) +%{LOGDIR} +%{SBINDIR}/amaespipe +%{SBINDIR}/amcrypt +%{SBINDIR}/amcrypt-ossl +%{SBINDIR}/amcrypt-ossl-asym +%{SBINDIR}/amcryptsimple +%{SBINDIR}/amgpgcrypt +%{SBINDIR}/amoldrecover +%{SBINDIR}/amrecover +%defattr(0644,%{amanda_user},%{amanda_group}) +%{AMLIBEXECDIR}/amcat.awk +%{AMLIBEXECDIR}/amplot.awk +%{AMLIBEXECDIR}/amplot.g +%{AMLIBEXECDIR}/amplot.gp +%docdir %{MANDIR} +%{MANDIR}/man5/amanda.conf.5.gz +%{MANDIR}/man5/amanda-client.conf.5.gz +%{MANDIR}/man8/amaddclient.8.gz +%{MANDIR}/man8/amadmin.8.gz +%{MANDIR}/man8/amanda.8.gz +%{MANDIR}/man8/amcheck.8.gz +%{MANDIR}/man8/amcheckdb.8.gz +%{MANDIR}/man8/amcheckdump.8.gz +%{MANDIR}/man8/amcleanup.8.gz +%{MANDIR}/man8/amdd.8.gz +%{MANDIR}/man8/amdump.8.gz +%{MANDIR}/man8/amfetchdump.8.gz +%{MANDIR}/man8/amflush.8.gz +%{MANDIR}/man8/amgetconf.8.gz +%{MANDIR}/man8/amlabel.8.gz +%{MANDIR}/man8/ammt.8.gz +%{MANDIR}/man8/amoverview.8.gz +%{MANDIR}/man8/amplot.8.gz +%{MANDIR}/man8/amrecover.8.gz +%{MANDIR}/man8/amreport.8.gz +%{MANDIR}/man8/amrestore.8.gz +%{MANDIR}/man8/amrmtape.8.gz +%{MANDIR}/man8/amserverconfig.8.gz +%{MANDIR}/man8/amstatus.8.gz +%{MANDIR}/man8/amtape.8.gz +%{MANDIR}/man8/amtapetype.8.gz +%{MANDIR}/man8/amtoc.8.gz +%{MANDIR}/man8/amverify.8.gz +%{MANDIR}/man8/amverifyrun.8.gz +%{MANDIR}/man8/amcrypt.8.gz +%{MANDIR}/man8/amcrypt-ossl.8.gz +%{MANDIR}/man8/amcrypt-ossl-asym.8.gz +%{MANDIR}/man8/amcryptsimple.8.gz +%{MANDIR}/man8/amgpgcrypt.8.gz +%{MANDIR}/man8/amaespipe.8.gz +%{MANDIR}/man8/amdevcheck.8.gz +%{AMANDAHOMEDIR}/amanda-release +%{AMANDAHOMEDIR}/example/amanda-client.conf +%{AMANDAHOMEDIR}/example/xinetd.amandaserver + +# --- ChangeLog + +%changelog +* Fri May 02 2008 Dan Locks +- Changed instances of ${ to %%{ where applicable +* Tue Mar 11 2008 Dan Locks +- fixed many rpmlint complaints +- added --quiet to configure statements +- moved PERLSITELIB to definitions section +* Wed Feb 13 2008 Dan Locks +- added an environment check for PKG_CONFIG_PATH +- added PKG_CONFIG_PATH conditional to handle cross comp on FC8 (environment + var is used if provided) +* Fri Feb 01 2008 Dan Locks +- Removed amplot executable and manpages from client installation +- Added amcheckdump.8 manpage +- Fixed %%{LOCALSTATEDIR}/amanda dir creation. +* Wed Jan 23 2008 Dan Locks +- Change %%{SYSCONFDIR}/amanda/amandates to %%{LOCALSTATEDIR}/amanda/amandates, + and added %%{LOCALSTATEDIR}/amanda to the files lists. +* Mon Jan 14 2008 Dan Locks +- Updates for perlified amanda, file location moves, gpg setup. +* Tue Nov 13 2007 Paddy Sreenivasan +- Added SYSCONFDIR to client rpm +- Set xinetd and amanda-client.conf configuration files as part of postinstall +* Thu Nov 8 2007 Dan Locks +- Added Linux distribution detection +* Wed Nov 7 2007 Paddy Sreenivasan +- Added amserverconfig, amaddclient, amgpgcrypt, amcryptsimple and libamdevice. +- Added amanda configuration template files +* Fri Sep 21 2007 Paddy Sreenivasan +- Remove libamserver, libamtape from client rpm +* Wed Sep 19 2007 Paddy Sreenivasan +- Added Fedora 7 +* Tue Jun 26 2007 Kevin Till +- set debug log to /var/log/amanda +* Fri Jan 12 2007 Paddy Sreenivasan +- Added label templates +* Thu Dec 07 2006 Paddy Sreenivasan +- Application API changes +* Fri Jun 16 2006 Kevin Till +- make install will install necessary example files. + No need to "cp" +* Wed Jun 07 2006 Paddy Sreenivasan - +- Added amoldrecover and amanda-client.conf man page. +* Thu Jun 01 2006 Kevin Till - +- Added amcrypt-ossl, amcrypt-ossl-asym by Ben Slusky. +* Thu May 18 2006 Paddy Sreenivasan - +- Added SLES10, RHEL3 build options. +* Tue May 09 2006 Chris Lee - +- Added amanda-release file to amandabackup home directory. +- Installation message logging cleanup. +* Thu Apr 27 2006 Paddy Sreenivasan - +- Removed dependency on tar version. +- Moved log directory creation after backup user creation. +* Wed Apr 19 2006 Chris Lee - +- Added informative message to note the location of pre- and post- +- install script logs files. +* Mon Apr 17 2006 Chris Lee - +- Reworked installation message logging and reporting. +* Fri Apr 14 2006 Chris Lee - +- Changed behavior for creating required localhost entries in the +- amandahosts file to check for these entries even when the file +- already exists. +* Wed Apr 12 2006 Chris Lee - +- Removed pre-install check for "disk" group. This group should exist +- by default on almost all modern distributions. +* Tue Apr 11 2006 Chris Lee - +- Added amandahosts entry for "localhost" without domain. +* Fri Apr 07 2006 Chris Lee - +- Changed default entries in .amandahosts to use "localdomain" instead +- of "localnet". +- Updated amanda_version and release. +* Mon Apr 03 2006 Chris Lee - +- Added example amanda.conf to files. +* Thu Mar 16 2006 Chris Lee - +- Corrected an issue with pre-install scripts wrt bug #218. +- Corrected an issue with post-install scripts and added testing .profile +- in amandabackup's home directory for setting environment variables wrt +- bug #220. +* Mon Mar 13 2006 Chris Lee - +- Corrected a syntactical error with setting ownership of amandates file +- wrt bug #216. +* Wed Mar 08 2006 Chris Lee - +- Added pre-install scripts to verify proper ownership of +- amandabackup home directory. +* Thu Feb 2 2006 Paddy Sreenivasan - +- Require xinetd. Require termcap and initscripts for Fedora and Redhat. +* Mon Jan 09 2006 Chris Lee - +- Pre/post install scripts updated: +- o Resolved an issue where an empty amandates file was installed +- even if the file already existed on the system. +- o If .amandahosts does not exist a default is now created. +- The Amanda user account has been changed to 'amandabackup' for +- additional security. +* Tue Jan 03 2006 Paddy Sreenivasan - +- Removed amandates from files list. +* Thu Dec 29 2005 Chris Lee - +- Corrected dependency for awk to "/bin/awk". +* Thu Dec 29 2005 Kevin Till - +- add man pages for amcrypt and amaespipe +* Thu Dec 29 2005 Chris Lee - +- Updated dependancy info to depend on tar >= 1.15. +- Included dependancies from top-level package in backup_client and +- backup_server packages. +- Reorganized files lists for readability (alphabetically). +- Updated backup_client files list to include some missing files per +- bug #129. +- Updated pre- and post-install to handle potential issue when +- /var/log/amanda exists and is a file rather than a directory. +- Corrected permissions for /var/log/amanda in pre-install scripts +- per bug #78 and 13 December change. +* Thu Dec 22 2005 Paddy Sreenivasan - +- Added amaespipe and amcrypt +- Added sles9 build definitions +* Tue Dec 13 2005 Chris Lee - +- Changed permissions for /var/log/amanda, removing set group id bit. +- Added /etc/amandates to backup_client package. +* Thu Dec 08 2005 Chris Lee - +- Corrected an issue with detection of existing 'amanda' user account. +- Corrected ownership of setuid executables per Bug #66. +- Moved the gnutar and noop files to the backup_client package (where +- they sould be). +- Removed amqde from files list. +- Added logging features to pre- and post-install scripts. +* Wed Dec 07 2005 Chris Lee - +- Changed a number of directory and file permissions from amanda:root +- to amanda:disk in response to Bug #57. +* Fri Dec 02 2005 Chris Lee - +- Corrected SYSCONFDIR path definition. Closes Bug #58. +* Mon Nov 28 2005 Chris Lee - +- Really fixed user creation preinstall scripts. +* Wed Nov 23 2005 Paddy Sreenivasan - +- Updated package description. +- Changed Group for packages. +* Tue Nov 22 2005 Chris Lee - +- Corrected dependancy packaging issue with amanda libraries. +- Fixed creation of amanda user on systems which it does not exist. +- Corrected Group definition for SuSE. +- Updated descriptions to include amanda-libs package. +- Updated release number to 2. +* Tue Nov 08 2005 Chris Lee - +- Permissions changes: now using user=amanda, group=disk +* Sun Oct 30 2005 Chris Lee - +- Parameters to configure options --with-user and --with-group changed +- such that when test_build is set to '1' the username of the user who +- runs rpmbuild is used for both values. If test_build is set to '0' +- then root is used for both values. +- The release field was also changed to automatically reflect the +- distribution and distribution release version for which the RPM was +- built. +* Tue Oct 18 2005 Chris Lee - +- Initial RPM SPEC file created. + diff --git a/packaging/rpm/amanda.spec.rej b/packaging/rpm/amanda.spec.rej index 2b549e5..3bcd640 100644 --- a/packaging/rpm/amanda.spec.rej +++ b/packaging/rpm/amanda.spec.rej @@ -1,16 +1,17 @@ *************** -*** 1514,1519 **** - %{AMLIBEXECDIR} - %{AMLIBEXECDIR}/application - %{AMLIBDIR} - %{LOCALSTATEDIR}/amanda - %defattr(4750,root,disk) - %{AMLIBEXECDIR}/calcsize ---- 1517,1523 ---- - %{AMLIBEXECDIR} - %{AMLIBEXECDIR}/application - %{AMLIBDIR} -+ %{PERLSITELIB} - %{LOCALSTATEDIR}/amanda - %defattr(4750,root,disk) - %{AMLIBEXECDIR}/calcsize +*** 122,128 **** + # --- Definitions --- + + # Define amanda_version if it is not already defined. +- %{!?amanda_version: %define amanda_version 2.6.0} + %{!?amanda_release: %define amanda_release 2} + %define amanda_version_info "Amanda Community Edition - version %{amanda_version}" + %define amanda_user amandabackup +--- 122,128 ---- + # --- Definitions --- + + # Define amanda_version if it is not already defined. ++ %{!?amanda_version: %define amanda_version 2.6.0p1} + %{!?amanda_release: %define amanda_release 2} + %define amanda_version_info "Amanda Community Edition - version %{amanda_version}" + %define amanda_user amandabackup diff --git a/packaging/rpm/buildpkg b/packaging/rpm/buildpkg index e76367c..ec5010d 100755 --- a/packaging/rpm/buildpkg +++ b/packaging/rpm/buildpkg @@ -6,7 +6,7 @@ set -x # Buildbot exports some useful env variables. # Check for $AMVER. I couldn't come up with a good way to detect it. if [ -z $AMVER ]; then - AMVER=amanda-2.6.0 + AMVER=amanda-2.6.0p1 fi # Check for AMTARBALL variable. if [ -z $AMTARBALL ]; then diff --git a/packaging/rpm/buildpkg.orig b/packaging/rpm/buildpkg.orig new file mode 100755 index 0000000..ec5010d --- /dev/null +++ b/packaging/rpm/buildpkg.orig @@ -0,0 +1,50 @@ +#!/bin/bash +# Buildpkg script for producing RPM packages. Does not require root access. + +# This is useful for debugging +set -x +# Buildbot exports some useful env variables. +# Check for $AMVER. I couldn't come up with a good way to detect it. +if [ -z $AMVER ]; then + AMVER=amanda-2.6.0p1 +fi +# Check for AMTARBALL variable. +if [ -z $AMTARBALL ]; then + AMTARBALL=$AMVER.tar.gz +fi + +# Check for AMTARBALL file, if it's not there, create it. +if [ ! -f ${AMTARBALL} ]; then + mkdir ${AMVER} + cp -Rfp * ${AMVER}/ + tar -cf ${AMTARBALL} -z ${AMVER} + rm -rf ${AMVER} +fi + +# Check for the packaging dirs. +if [ -z $AMPKGDIR ]; then + AMPKGDIR=${PWD} +fi +if [ ! -d ${AMPKGDIR} ]; then + mkdir ${AMPKGDIR} +fi +cd ${AMPKGDIR} + +if [ -d rpm ]; then + rm -rf rpm +fi +mkdir rpm +mkdir rpm/SOURCES +mkdir rpm/SRPMS +mkdir rpm/SPECS +mkdir rpm/BUILD +mkdir rpm/RPMS + +# Make a copy of the tarball with the name that rpmbuild expects +cp ${AMTARBALL} rpm/SOURCES/${AMVER}.tar.gz +cp packaging/rpm/amanda.spec rpm/SPECS/amanda.spec +# Rpmbuild requires absolute paths. annoying. If you need to change the +# default value of some rpm.spec variable, just pass extra --define options. +# this is useful for changing %amanda_release or %amanda_version +rpmbuild -ba --define "_topdir ${AMPKGDIR}/rpm" \ + ${AMPKGDIR}/rpm/SPECS/amanda.spec diff --git a/packaging/rpm/buildpkg.rej b/packaging/rpm/buildpkg.rej new file mode 100644 index 0000000..be33dd1 --- /dev/null +++ b/packaging/rpm/buildpkg.rej @@ -0,0 +1,17 @@ +*************** +*** 6,12 **** + # Buildbot exports some useful env variables. + # Check for $AMVER. I couldn't come up with a good way to detect it. + if [ -z $AMVER ]; then +- AMVER=amanda-2.6.0 + fi + # Check for AMTARBALL variable. + if [ -z $AMTARBALL ]; then +--- 6,12 ---- + # Buildbot exports some useful env variables. + # Check for $AMVER. I couldn't come up with a good way to detect it. + if [ -z $AMVER ]; then ++ AMVER=amanda-2.6.0p1 + fi + # Check for AMTARBALL variable. + if [ -z $AMTARBALL ]; then diff --git a/perl/Amanda/Cmdline.c b/perl/Amanda/Cmdline.c index 1badc66..d23c52a 100644 --- a/perl/Amanda/Cmdline.c +++ b/perl/Amanda/Cmdline.c @@ -1423,15 +1423,16 @@ SWIG_Perl_SetModule(swig_module_info *module) { /* -------- TYPES TABLE (BEGIN) -------- */ -#define SWIGTYPE_p_char swig_types[0] -#define SWIGTYPE_p_double swig_types[1] -#define SWIGTYPE_p_dumpspec_t swig_types[2] -#define SWIGTYPE_p_float swig_types[3] -#define SWIGTYPE_p_int swig_types[4] -#define SWIGTYPE_p_p_char swig_types[5] -#define SWIGTYPE_p_unsigned_char swig_types[6] -static swig_type_info *swig_types[8]; -static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0}; +#define SWIGTYPE_p_GSList swig_types[0] +#define SWIGTYPE_p_char swig_types[1] +#define SWIGTYPE_p_double swig_types[2] +#define SWIGTYPE_p_dumpspec_t swig_types[3] +#define SWIGTYPE_p_float swig_types[4] +#define SWIGTYPE_p_int swig_types[5] +#define SWIGTYPE_p_p_char swig_types[6] +#define SWIGTYPE_p_unsigned_char swig_types[7] +static swig_type_info *swig_types[9]; +static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -1473,6 +1474,12 @@ SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); #include "amglue.h" +#include "cmdline.h" + + +typedef GSList amglue_dumpspec_list; + + #include #include "cmdline.h" @@ -2027,7 +2034,7 @@ XS(_wrap_parse_dumpspecs) { int arg1 ; char **arg2 = (char **) 0 ; int arg3 ; - GSList *result = 0 ; + amglue_dumpspec_list *result = 0 ; int argvi = 0; dXSARGS; @@ -2066,7 +2073,7 @@ XS(_wrap_parse_dumpspecs) { g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ } } - result = (GSList *)cmdline_parse_dumpspecs(arg1,arg2,arg3); + result = (amglue_dumpspec_list *)cmdline_parse_dumpspecs(arg1,arg2,arg3); { if (result) { GSList *iter; @@ -2102,6 +2109,7 @@ XS(_wrap_parse_dumpspecs) { /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ +static swig_type_info _swigt__p_GSList = {"_p_GSList", "amglue_dumpspec_list *|GSList *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_dumpspec_t = {"_p_dumpspec_t", "struct dumpspec_t *|dumpspec_t *", 0, 0, (void*)"Amanda::Cmdline::dumpspec_t", 0}; @@ -2111,6 +2119,7 @@ static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { + &_swigt__p_GSList, &_swigt__p_char, &_swigt__p_double, &_swigt__p_dumpspec_t, @@ -2120,6 +2129,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_unsigned_char, }; +static swig_cast_info _swigc__p_GSList[] = { {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_dumpspec_t[] = { {&_swigt__p_dumpspec_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -2129,6 +2139,7 @@ static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0 static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { + _swigc__p_GSList, _swigc__p_char, _swigc__p_double, _swigc__p_dumpspec_t, diff --git a/perl/Amanda/Cmdline.swg b/perl/Amanda/Cmdline.swg index 0f878c1..b6dec02 100644 --- a/perl/Amanda/Cmdline.swg +++ b/perl/Amanda/Cmdline.swg @@ -21,6 +21,7 @@ %module "Amanda::Cmdline" %include "amglue/amglue.swg" %include "exception.i" +%include "amglue/dumpspecs.swg" %{ #include @@ -126,29 +127,6 @@ typedef struct dumpspec_t { %rename(format_dumpspec_components) cmdline_format_dumpspec_components; char *cmdline_format_dumpspec_components(char *host, char *disk, char *datestamp, char *level); -/* Typemap to convert the GSList that cmdline_parse_dumpspecs will - * return into an array of dumpspec_t's. This uses some SWIG trickery - * to manage to convert the GSList itself to an array, while leaving the - * dumpspecs as C objects. - */ -%typemap(out) GSList * { - if ($1) { - GSList *iter; - EXTEND(SP, g_slist_length($1)); /* make room for return values */ - - iter = $1; - while (iter) { - /* Let SWIG take ownership of the object; we'll free the GSList momentarily */ - $result = SWIG_NewPointerObj(iter->data, $descriptor(dumpspec_t*), SWIG_OWNER | SWIG_SHADOW); - argvi++; - iter = iter->next; - } - - /* Now free the GSList, but *not* its contents (which are now "owned" by SWIG) */ - g_slist_free($1); - } -} - /* Typemap to convert a perl list of strings to the strv that * cmdline_parse_dumpspecs expects. */ @@ -183,11 +161,11 @@ amglue_add_constant(CMDLINE_PARSE_LEVEL, cmdline_parse_dumpspecs_flags); amglue_add_constant(CMDLINE_EMPTY_TO_WILDCARD, cmdline_parse_dumpspecs_flags); %rename(parse_dumpspecs) cmdline_parse_dumpspecs; -GSList *cmdline_parse_dumpspecs(int argc, char **argv, int flags); +amglue_dumpspec_list *cmdline_parse_dumpspecs(int argc, char **argv, int flags); /* TODO: * convert AV back to GSList as input, convert resulting GSList into an AV of strings * on output */ -/* GSList * cmdline_match_holding(GSList *dumpspec_list); */ +/* amglue_dumpspec_list * cmdline_match_holding(amglue_dumpspec_list *dumpspec_list); */ diff --git a/perl/Amanda/Logfile.c b/perl/Amanda/Logfile.c index 7f9743a..a022c0f 100644 --- a/perl/Amanda/Logfile.c +++ b/perl/Amanda/Logfile.c @@ -1424,14 +1424,16 @@ SWIG_Perl_SetModule(swig_module_info *module) { /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_FILE swig_types[0] -#define SWIGTYPE_p_char swig_types[1] -#define SWIGTYPE_p_double swig_types[2] -#define SWIGTYPE_p_find_result_t swig_types[3] -#define SWIGTYPE_p_float swig_types[4] -#define SWIGTYPE_p_int swig_types[5] -#define SWIGTYPE_p_unsigned_char swig_types[6] -static swig_type_info *swig_types[8]; -static swig_module_info swig_module = {swig_types, 7, 0, 0, 0, 0}; +#define SWIGTYPE_p_GSList swig_types[1] +#define SWIGTYPE_p_char swig_types[2] +#define SWIGTYPE_p_double swig_types[3] +#define SWIGTYPE_p_dumpspec_t swig_types[4] +#define SWIGTYPE_p_find_result_t swig_types[5] +#define SWIGTYPE_p_float swig_types[6] +#define SWIGTYPE_p_int swig_types[7] +#define SWIGTYPE_p_unsigned_char swig_types[8] +static swig_type_info *swig_types[10]; +static swig_module_info swig_module = {swig_types, 9, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -1473,6 +1475,12 @@ SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *); #include "amglue.h" +#include "cmdline.h" + + +typedef GSList amglue_dumpspec_list; + + #include #include "logfile.h" #include "find.h" @@ -2397,21 +2405,164 @@ XS(_wrap_dumps_match) { } +XS(_wrap_dumps_match_dumpspecs) { + { + find_result_t *arg1 = (find_result_t *) 0 ; + amglue_dumpspec_list *arg2 = (amglue_dumpspec_list *) 0 ; + gboolean arg3 ; + find_result_t *result = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: dumps_match_dumpspecs(output_find,dumpspecs,ok);"); + } + { + AV *av; + I32 len, i; + find_result_t *head = NULL, *tail = NULL; + + if (!SvROK(ST(0)) || SvTYPE(SvRV(ST(0))) != SVt_PVAV) { + SWIG_exception(SWIG_TypeError, "expected an arrayref of find_result_t's"); + } + + av = (AV *)SvRV(ST(0)); + len = av_len(av) + 1; + + for (i = 0; i < len; i++) { + SV **val = av_fetch(av, i, 0); + find_result_t *r; + + if (!val || SWIG_ConvertPtr(*val, (void **)&r, SWIGTYPE_p_find_result_t, 0) == -1) { + SWIG_exception(SWIG_TypeError, "array member is not a find_result_t"); + } + + if (!head) { + head = tail = r; + } else { + tail->next = r; + tail = r; + } + + tail->next = NULL; + } + + /* point to the head of that list */ + arg1 = head; + } + { + AV *av; + int len; + int i; + + if (!SvROK(ST(1)) || SvTYPE(SvRV(ST(1))) != SVt_PVAV) { + SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs"); + } + av = (AV *)SvRV(ST(1)); + + len = av_len(av)+1; + arg2 = NULL; + for (i = 0; i < len; i++) { + dumpspec_t *ds = NULL; + SV **elt = av_fetch(av, i, 0); + if (elt) + SWIG_ConvertPtr(*elt, (void **)&ds, SWIGTYPE_p_dumpspec_t, 0); + if (!ds) + SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs"); + arg2 = g_slist_append(arg2, ds); + } + } + { + if (sizeof(signed int) == 1) { + arg3 = amglue_SvI8(ST(2)); + } else if (sizeof(signed int) == 2) { + arg3 = amglue_SvI16(ST(2)); + } else if (sizeof(signed int) == 4) { + arg3 = amglue_SvI32(ST(2)); + } else if (sizeof(signed int) == 8) { + arg3 = amglue_SvI64(ST(2)); + } else { + g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */ + } + } + result = (find_result_t *)dumps_match_dumpspecs(arg1,arg2,arg3); + { + find_result_t *iter; + int len; + + /* measure the list and make room on the perl stack */ + for (len=0, iter=result; iter; iter=iter->next) len++; + EXTEND(SP, len); + + iter = result; + while (iter) { + find_result_t *next; + /* Let SWIG take ownership of the object */ + ST(argvi) = SWIG_NewPointerObj(iter, SWIGTYPE_p_find_result_t, SWIG_OWNER | SWIG_SHADOW); + argvi++; + + /* null out the 'next' field */ + next = iter->next; + iter->next = NULL; + iter = next; + } + } + { + find_result_t *iter = arg1, *next; + + /* undo all the links we added earlier */ + while (iter) { + next = iter->next; + iter->next = NULL; + iter = next; + } + } + { + /* Free the GSList, but not its contents (which are still owned by SWIG) */ + g_slist_free(arg2); + } + + XSRETURN(argvi); + fail: + { + find_result_t *iter = arg1, *next; + + /* undo all the links we added earlier */ + while (iter) { + next = iter->next; + iter->next = NULL; + iter = next; + } + } + { + /* Free the GSList, but not its contents (which are still owned by SWIG) */ + g_slist_free(arg2); + } + + SWIG_croak_null(); + } +} + + /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *|loghandle *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_GSList = {"_p_GSList", "amglue_dumpspec_list *|GSList *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_dumpspec_t = {"_p_dumpspec_t", "struct dumpspec_t *|dumpspec_t *", 0, 0, (void*)"Amanda::Cmdline::dumpspec_t", 0}; static swig_type_info _swigt__p_find_result_t = {"_p_find_result_t", "find_result_t *", 0, 0, (void*)"Amanda::Logfile::find_result_t", 0}; static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0}; -static swig_type_info _swigt__p_int = {"_p_int", "int *|logtype_t *|program_t *|gboolean *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *|logtype_t *|program_t *|gboolean *|cmdline_parse_dumpspecs_flags *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_FILE, + &_swigt__p_GSList, &_swigt__p_char, &_swigt__p_double, + &_swigt__p_dumpspec_t, &_swigt__p_find_result_t, &_swigt__p_float, &_swigt__p_int, @@ -2419,8 +2570,10 @@ static swig_type_info *swig_type_initial[] = { }; static swig_cast_info _swigc__p_FILE[] = { {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_GSList[] = { {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_dumpspec_t[] = { {&_swigt__p_dumpspec_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_find_result_t[] = { {&_swigt__p_find_result_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; @@ -2428,8 +2581,10 @@ static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, static swig_cast_info *swig_cast_initial[] = { _swigc__p_FILE, + _swigc__p_GSList, _swigc__p_char, _swigc__p_double, + _swigc__p_dumpspec_t, _swigc__p_find_result_t, _swigc__p_float, _swigc__p_int, @@ -2465,6 +2620,7 @@ static swig_command_info swig_commands[] = { {"Amanda::Logfilec::find_log", _wrap_find_log}, {"Amanda::Logfilec::search_logfile", _wrap_search_logfile}, {"Amanda::Logfilec::dumps_match", _wrap_dumps_match}, +{"Amanda::Logfilec::dumps_match_dumpspecs", _wrap_dumps_match_dumpspecs}, {0,0} }; /* ----------------------------------------------------------------------------- diff --git a/perl/Amanda/Logfile.pm b/perl/Amanda/Logfile.pm index 8f03f24..ebea270 100644 --- a/perl/Amanda/Logfile.pm +++ b/perl/Amanda/Logfile.pm @@ -7,6 +7,7 @@ package Amanda::Logfile; require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); +require Amanda::Cmdline; package Amanda::Logfilec; bootstrap Amanda::Logfile; package Amanda::Logfile; @@ -55,6 +56,7 @@ package Amanda::Logfile; *find_log = *Amanda::Logfilec::find_log; *search_logfile = *Amanda::Logfilec::search_logfile; *dumps_match = *Amanda::Logfilec::dumps_match; +*dumps_match_dumpspecs = *Amanda::Logfilec::dumps_match_dumpspecs; ############# Class : Amanda::Logfile::find_result_t ############## diff --git a/perl/Amanda/Logfile.swg b/perl/Amanda/Logfile.swg index ea621e4..be5c145 100644 --- a/perl/Amanda/Logfile.swg +++ b/perl/Amanda/Logfile.swg @@ -21,6 +21,8 @@ %module "Amanda::Logfile" %include "amglue/amglue.swg" %include "exception.i" +%include "amglue/dumpspecs.swg" +%import "Amanda/Cmdline.swg" %{ #include @@ -362,3 +364,7 @@ find_result_t *search_logfile_wrap(char *label, char *datestamp, find_result_t *dumps_match(find_result_t *output_find, char *hostname, char *diskname, char *datestamp, char *level, int ok); + +find_result_t *dumps_match_dumpspecs(find_result_t *output_find, + amglue_dumpspec_list *dumpspecs, + gboolean ok); diff --git a/perl/Makefile.am b/perl/Makefile.am index 701ae47..a4da56c 100644 --- a/perl/Makefile.am +++ b/perl/Makefile.am @@ -66,6 +66,7 @@ PERL_EXT_LDFLAGS += $(PERLEXTLIBS) AMGLUE_SWG = amglue/amglue.swg \ amglue/amglue.swg \ amglue/constants.swg \ + amglue/dumpspecs.swg \ amglue/exports.swg \ amglue/glib.swg \ amglue/integers.swg diff --git a/perl/Makefile.in b/perl/Makefile.in index 8427359..e4ad8bd 100644 --- a/perl/Makefile.in +++ b/perl/Makefile.in @@ -280,8 +280,8 @@ LTLIBRARIES = $(amlib_LTLIBRARIES) $(libCmdline_LTLIBRARIES) \ @WANT_SERVER_TRUE@ $(top_builddir)/server-src/libamserver.la \ @WANT_SERVER_TRUE@ $(top_builddir)/common-src/libamanda.la am__libCmdline_la_SOURCES_DIST = Amanda/Cmdline.c amglue/amglue.swg \ - amglue/constants.swg amglue/exports.swg amglue/glib.swg \ - amglue/integers.swg + amglue/constants.swg amglue/dumpspecs.swg amglue/exports.swg \ + amglue/glib.swg amglue/integers.swg am__objects_1 = @WANT_SERVER_TRUE@am_libCmdline_la_OBJECTS = Cmdline.lo \ @WANT_SERVER_TRUE@ $(am__objects_1) @@ -308,8 +308,8 @@ libDebug_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @WANT_SERVER_TRUE@ $(top_builddir)/device-src/libamdevice.la \ @WANT_SERVER_TRUE@ $(top_builddir)/common-src/libamanda.la am__libDevice_la_SOURCES_DIST = Amanda/Device.c amglue/amglue.swg \ - amglue/constants.swg amglue/exports.swg amglue/glib.swg \ - amglue/integers.swg + amglue/constants.swg amglue/dumpspecs.swg amglue/exports.swg \ + amglue/glib.swg amglue/integers.swg @WANT_SERVER_TRUE@am_libDevice_la_OBJECTS = Device.lo $(am__objects_1) libDevice_la_OBJECTS = $(am_libDevice_la_OBJECTS) libDevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -320,8 +320,8 @@ libDevice_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @WANT_SERVER_TRUE@ $(top_builddir)/server-src/libamserver.la \ @WANT_SERVER_TRUE@ $(top_builddir)/common-src/libamanda.la am__libLogfile_la_SOURCES_DIST = Amanda/Logfile.c amglue/amglue.swg \ - amglue/constants.swg amglue/exports.swg amglue/glib.swg \ - amglue/integers.swg + amglue/constants.swg amglue/dumpspecs.swg amglue/exports.swg \ + amglue/glib.swg amglue/integers.swg @WANT_SERVER_TRUE@am_libLogfile_la_OBJECTS = Logfile.lo \ @WANT_SERVER_TRUE@ $(am__objects_1) libLogfile_la_OBJECTS = $(am_libLogfile_la_OBJECTS) @@ -333,8 +333,8 @@ libLogfile_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ @WANT_SERVER_TRUE@ $(top_builddir)/server-src/libamserver.la \ @WANT_SERVER_TRUE@ $(top_builddir)/common-src/libamanda.la am__libTapefile_la_SOURCES_DIST = Amanda/Tapefile.c amglue/amglue.swg \ - amglue/constants.swg amglue/exports.swg amglue/glib.swg \ - amglue/integers.swg + amglue/constants.swg amglue/dumpspecs.swg amglue/exports.swg \ + amglue/glib.swg amglue/integers.swg @WANT_SERVER_TRUE@am_libTapefile_la_OBJECTS = Tapefile.lo \ @WANT_SERVER_TRUE@ $(am__objects_1) libTapefile_la_OBJECTS = $(am_libTapefile_la_OBJECTS) @@ -844,6 +844,7 @@ PERL_EXT_LDFLAGS = -avoid-version $(PERLEXTLIBS) AMGLUE_SWG = amglue/amglue.swg \ amglue/amglue.swg \ amglue/constants.swg \ + amglue/dumpspecs.swg \ amglue/exports.swg \ amglue/glib.swg \ amglue/integers.swg diff --git a/perl/amglue/dumpspecs.swg b/perl/amglue/dumpspecs.swg new file mode 100644 index 0000000..772a43a --- /dev/null +++ b/perl/amglue/dumpspecs.swg @@ -0,0 +1,91 @@ +/* + * Copyright (c) Zmanda, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * Contact information: Zmanda Inc., 465 S Mathlida Ave, Suite 300 + * Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + */ + +%{ +#include "cmdline.h" +%} + +/* + * Typemaps for lists of dumpspecs + * + * To use: + * %include "amglue/dumpspecs.swg" + * %import "Amanda/Logfile.swg" + * and declare functions as either taking or returning "amglue_dumpspec_list *". + */ + +%inline %{ +typedef GSList amglue_dumpspec_list; +%} + +/* Typemap to convert a GSList of dumpspec_t's into an array of same. This uses + * some SWIG trickery to manage to convert the GSList itself to an array, while + * leaving the dumpspecs as C objects. + */ +%types(dumpspec_t *); +%typemap(out) amglue_dumpspec_list * { + if ($1) { + GSList *iter; + EXTEND(SP, g_slist_length($1)); /* make room for return values */ + + iter = $1; + while (iter) { + /* Let SWIG take ownership of the object; we'll free the GSList momentarily */ + $result = SWIG_NewPointerObj(iter->data, $descriptor(dumpspec_t*), SWIG_OWNER | SWIG_SHADOW); + argvi++; + iter = iter->next; + } + + /* Now free the GSList, but *not* its contents (which are now "owned" by SWIG) */ + g_slist_free($1); + } +} + +/* Typemap to convert an arrayref of dumpspecs into a GSList of same. This assumes + * that the dumpspecs are all C objects. This borrows references to the underlying + * dumpspec objects, which remain owned by SWIG. + */ +%typemap(in) amglue_dumpspec_list * { + AV *av; + int len; + int i; + + if (!SvROK($input) || SvTYPE(SvRV($input)) != SVt_PVAV) { + SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs"); + } + av = (AV *)SvRV($input); + + len = av_len(av)+1; + $1 = NULL; + for (i = 0; i < len; i++) { + dumpspec_t *ds = NULL; + SV **elt = av_fetch(av, i, 0); + if (elt) + SWIG_ConvertPtr(*elt, (void **)&ds, $descriptor(dumpspec_t *), 0); + if (!ds) + SWIG_exception_fail(SWIG_TypeError, "Expected an arrayref of dumpspecs"); + $1 = g_slist_append($1, ds); + } +} + +%typemap(freearg) amglue_dumpspec_list * { + /* Free the GSList, but not its contents (which are still owned by SWIG) */ + g_slist_free($1); +} diff --git a/restore-src/amfetchdump.c b/restore-src/amfetchdump.c index d33d56d..bdeb114 100644 --- a/restore-src/amfetchdump.c +++ b/restore-src/amfetchdump.c @@ -56,7 +56,7 @@ typedef struct needed_tapes_s { /* local functions */ -tapelist_t *list_needed_tapes(GSList *dumpspecs); +tapelist_t *list_needed_tapes(GSList *dumpspecs, int only_one); void usage(void); int main(int argc, char **argv); @@ -98,12 +98,14 @@ usage(void) */ tapelist_t * list_needed_tapes( - GSList * dumpspecs) + GSList * dumpspecs, + int only_one) { needed_tape_t *needed_tapes = NULL, *curtape = NULL; disklist_t diskqp; - dumpspec_t *ds = NULL; find_result_t *alldumps = NULL; + find_result_t *curmatch = NULL; + find_result_t *matches = NULL; tapelist_t *tapes = NULL; int numtapes = 0; char *conf_diskfile, *conf_tapelist; @@ -130,100 +132,104 @@ list_needed_tapes( g_fprintf(stderr, _("No dump records found\n")); exit(1); } - + /* Compare all known dumps to our match list, note what we'll need */ - while (dumpspecs) { - find_result_t *curmatch = NULL; - find_result_t *matches = NULL; - ds = (dumpspec_t *)dumpspecs->data; - - matches = dumps_match(alldumps, ds->host, ds->disk, - ds->datestamp, ds->level, 1); - sort_find_result("Dhklp", &matches); - for(curmatch = matches; curmatch; curmatch = curmatch->next){ - int havetape = 0; - int have_part = 0; - if(strcmp("OK", curmatch->status)){ - g_fprintf(stderr,_("Dump %s %s %s %d had status '%s', skipping\n"), - curmatch->timestamp, curmatch->hostname, - curmatch->diskname, curmatch->level, - curmatch->status); - continue; - } - /* check if we already have that part */ - for(curtape = needed_tapes; curtape; curtape = curtape->next) { - find_result_t *rsttemp = NULL; - for(rsttemp = curtape->files; - rsttemp; - rsttemp=rsttemp->next) { - if (strcmp(rsttemp->partnum, curmatch->partnum) == 0) - have_part = 1; + matches = dumps_match_dumpspecs(alldumps, dumpspecs, 1); + sort_find_result("Dhklp", &matches); + for(curmatch = matches; curmatch; curmatch = curmatch->next) { + int havetape = 0; + int have_part = 0; + + /* keep only first dump if only_one */ + if (only_one && + curmatch != matches && + (strcmp(curmatch->hostname, matches->hostname) || + strcmp(curmatch->diskname, matches->diskname) || + strcmp(curmatch->timestamp, matches->timestamp) || + curmatch->level != matches->level)) { + continue; + } + if(strcmp("OK", curmatch->status)){ + g_fprintf(stderr,_("Dump %s %s %s %d had status '%s', skipping\n"), + curmatch->timestamp, curmatch->hostname, + curmatch->diskname, curmatch->level, + curmatch->status); + continue; + } + /* check if we already have that part */ + for(curtape = needed_tapes; curtape; curtape = curtape->next) { + find_result_t *rsttemp = NULL; + for(rsttemp = curtape->files; + rsttemp; + rsttemp=rsttemp->next) { + if (!strcmp(rsttemp->partnum, curmatch->partnum) && + !strcmp(rsttemp->hostname, curmatch->hostname) && + !strcmp(rsttemp->diskname, curmatch->diskname) && + !strcmp(rsttemp->timestamp, curmatch->timestamp) && + rsttemp->level == curmatch->level) { + have_part = 1; } } - if (have_part) - continue; - for(curtape = needed_tapes; curtape; curtape = curtape->next) { - if(!strcmp(curtape->label, curmatch->label)){ - find_result_t *rsttemp = NULL; - find_result_t *rstfile = alloc(SIZEOF(find_result_t)); - int keep = 1; + } + if (have_part) + continue; - memcpy(rstfile, curmatch, SIZEOF(find_result_t)); + for(curtape = needed_tapes; curtape; curtape = curtape->next) { + if (!strcmp(curtape->label, curmatch->label)) { + find_result_t *rsttemp = NULL; + find_result_t *rstfile; + int keep = 1; - havetape = 1; + havetape = 1; - for(rsttemp = curtape->files; + for(rsttemp = curtape->files; rsttemp; rsttemp=rsttemp->next){ - if(rstfile->filenum == rsttemp->filenum){ - g_fprintf(stderr, _("Seeing multiple entries for tape " + if(curmatch->filenum == rsttemp->filenum){ + g_fprintf(stderr, _("Seeing multiple entries for tape " "%s file %lld, using most recent\n"), curtape->label, - (long long)rstfile->filenum); - keep = 0; - } - } - if(!keep){ - amfree(rstfile); - break; + (long long)curmatch->filenum); + keep = 0; } - rstfile->next = curtape->files; - - if(curmatch->filenum < 1) curtape->isafile = 1; - else curtape->isafile = 0; - curtape->files = rstfile; + } + if(!keep){ break; } - } - if(!havetape){ - find_result_t *rstfile = alloc(SIZEOF(find_result_t)); - needed_tape_t *newtape = - alloc(SIZEOF(needed_tape_t)); + + rstfile = alloc(SIZEOF(find_result_t)); memcpy(rstfile, curmatch, SIZEOF(find_result_t)); - rstfile->next = NULL; - newtape->files = rstfile; - if(curmatch->filenum < 1) newtape->isafile = 1; - else newtape->isafile = 0; - newtape->label = curmatch->label; - if(needed_tapes){ - needed_tapes->prev->next = newtape; - newtape->prev = needed_tapes->prev; - needed_tapes->prev = newtape; - } - else{ - needed_tapes = newtape; - needed_tapes->prev = needed_tapes; - } - newtape->next = NULL; - numtapes++; -#if 0 -// free_find_result(rstfile); -#endif - } /* if(!havetape) */ + rstfile->next = curtape->files; + + if (curmatch->filenum < 1) + curtape->isafile = 1; + else curtape->isafile = 0; + curtape->files = rstfile; + break; + } + } + if (!havetape) { + find_result_t *rstfile = alloc(SIZEOF(find_result_t)); + needed_tape_t *newtape = alloc(SIZEOF(needed_tape_t)); + memcpy(rstfile, curmatch, SIZEOF(find_result_t)); + rstfile->next = NULL; + newtape->files = rstfile; + if(curmatch->filenum < 1) newtape->isafile = 1; + else newtape->isafile = 0; + newtape->label = curmatch->label; + if (needed_tapes){ + needed_tapes->prev->next = newtape; + newtape->prev = needed_tapes->prev; + needed_tapes->prev = newtape; + } else { + needed_tapes = newtape; + needed_tapes->prev = needed_tapes; + } + newtape->next = NULL; + numtapes++; + } /* if(!havetape) */ - } /* for(curmatch = matches ... */ - dumpspecs = dumpspecs->next; - } /* while (dumpspecs) */ + } /* for(curmatch = matches ... */ if(numtapes == 0){ g_fprintf(stderr, _("No matching dumps found\n")); @@ -397,7 +403,8 @@ main( /* Decide what tapes we'll need */ - needed_tapes = list_needed_tapes(dumpspecs); + needed_tapes = list_needed_tapes(dumpspecs, + rst_flags->pipe_to_fd == STDOUT_FILENO); parent_pid = getpid(); atexit(cleanup); diff --git a/restore-src/amrestore.c b/restore-src/amrestore.c index d9f285b..0e1b4b6 100644 --- a/restore-src/amrestore.c +++ b/restore-src/amrestore.c @@ -98,7 +98,11 @@ static void handle_tape_restore(char * device_name, rst_flags_t * flags, Device * device; ReadLabelStatusFlags read_label_status; + dumpfile_t first_restored_file; + device_api_init(); + + fh_init(&first_restored_file); device = device_open(device_name); if (device == NULL) { @@ -128,7 +132,7 @@ static void handle_tape_restore(char * device_name, rst_flags_t * flags, } search_a_tape(device, stderr, flags, NULL, NULL, dumpspecs, - NULL, NULL, 0, NULL); + NULL, &first_restored_file, 0, NULL); } /* @@ -188,19 +192,13 @@ main( } else if(*e == 'm' || *e == 'M') { rst_flags->blocksize *= 1024 * 1024; } else if(*e != '\0') { - error(_("invalid rst_flags->blocksize value \"%s\""), optarg); + error(_("invalid blocksize value \"%s\""), optarg); /*NOTREACHED*/ } if(rst_flags->blocksize < DISK_BLOCK_BYTES) { error(_("minimum block size is %dk"), DISK_BLOCK_BYTES / 1024); /*NOTREACHED*/ } - if(rst_flags->blocksize > MAX_TAPE_BLOCK_KB * 1024) { - g_fprintf(stderr,_("maximum block size is %dk, using it\n"), - MAX_TAPE_BLOCK_KB); - rst_flags->blocksize = MAX_TAPE_BLOCK_KB * 1024; - /*NOTREACHED*/ - } break; case 'c': rst_flags->compress = 1; break; case 'o': diff --git a/restore-src/restore.c b/restore-src/restore.c index a12b5f5..130d08e 100644 --- a/restore-src/restore.c +++ b/restore-src/restore.c @@ -1534,6 +1534,9 @@ try_restore_single_file(Device * device, int file_num, int* next_file, } record_seen_dump(tape_seen, source.header); restore(&source, flags); + if (first_restored_file) { + memcpy(first_restored_file, source.header, sizeof(dumpfile_t)); + } return RESTORE_STATUS_NEXT_FILE; } @@ -1736,6 +1739,7 @@ gboolean restore_holding_disk(FILE * prompt_out, if (last_header != NULL && !flags->amidxtaped && flags->pipe_to_fd == STDOUT_FILENO && + last_header->type != F_UNKNOWN && !headers_equal(last_header, source.header, 1)) { return FALSE; } else if (this_header != NULL) { @@ -1812,6 +1816,9 @@ restore_from_tapelist(FILE * prompt_out, cur_volume, &seentapes, NULL, &first_restored_file, NULL); } + if (flags->pipe_to_fd == fileno(stdout)) { + break; + } } else { Device * device = NULL; if (use_changer) { @@ -1847,7 +1854,7 @@ restore_from_tapelist(FILE * prompt_out, cur_volume, dumpspecs, &seentapes, &first_restored_file, 0, logstream)) { g_object_unref(device); - break;; + break; } g_object_unref(device); } @@ -1876,6 +1883,8 @@ restore_without_tapelist(FILE * prompt_out, int tape_count = 0; dumpfile_t first_restored_file; + fh_init(&first_restored_file); + /* This loop also aborts if we run out of manual tapes, or encounter a changer error. */ for (;;) { diff --git a/server-src/amadmin.c b/server-src/amadmin.c index 40da5b5..10d8dea 100644 --- a/server-src/amadmin.c +++ b/server-src/amadmin.c @@ -345,8 +345,13 @@ force_one( get_pname(), hostname, diskname); } if(put_info(hostname, diskname, &info) == 0) { - g_printf(_("%s: %s:%s is set to a forced level 0 at next run.\n"), - get_pname(), hostname, diskname); + if (dp->strategy == DS_INCRONLY) { + g_printf(_("%s: %s:%s, full dump done offline, next dump will be at level 1.\n"), + get_pname(), hostname, diskname); + } else { + g_printf(_("%s: %s:%s is set to a forced level 0 at next run.\n"), + get_pname(), hostname, diskname); + } } else { g_fprintf(stderr, _("%s: %s:%s could not be forced.\n"), get_pname(), hostname, diskname); diff --git a/server-src/amtrmlog.c b/server-src/amtrmlog.c index 0c38923..460a354 100644 --- a/server-src/amtrmlog.c +++ b/server-src/amtrmlog.c @@ -138,11 +138,11 @@ main( conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR)); olddir = vstralloc(conf_logdir, "/oldlog", NULL); - if (mkpdir(olddir, 02700, (uid_t)-1, (gid_t)-1) != 0) { + if (mkpdir(olddir, 0700, (uid_t)-1, (gid_t)-1) != 0) { error(_("could not create parents of %s: %s"), olddir, strerror(errno)); /*NOTREACHED*/ } - if (mkdir(olddir, 02700) != 0 && errno != EEXIST) { + if (mkdir(olddir, 0700) != 0 && errno != EEXIST) { error(_("could not create %s: %s"), olddir, strerror(errno)); /*NOTREACHED*/ } diff --git a/server-src/driver.c b/server-src/driver.c index 0a5c2c5..ef877f3 100644 --- a/server-src/driver.c +++ b/server-src/driver.c @@ -1382,7 +1382,11 @@ handle_taper_result( if (taper_dumper->result == LAST_TOK) { taper_sendresult = 1; } else { - taper_cmd(taper_dumper->result, NULL, NULL, 0, NULL); + if( taper_dumper->result == DONE) { + taper_cmd(DONE, NULL, NULL, 0, NULL); + } else { + taper_cmd(FAILED, NULL, NULL, 0, NULL); + } } break; diff --git a/server-src/dumper.c b/server-src/dumper.c index 6d20b8a..18384c7 100644 --- a/server-src/dumper.c +++ b/server-src/dumper.c @@ -1047,7 +1047,7 @@ do_dump( indexfile_real = getindexfname(hostname, diskname, dumper_timestamp, level); indexfile_tmp = stralloc2(indexfile_real, ".tmp"); - if (mkpdir(indexfile_tmp, 02755, (uid_t)-1, (gid_t)-1) == -1) { + if (mkpdir(indexfile_tmp, 0755, (uid_t)-1, (gid_t)-1) == -1) { errstr = newvstrallocf(errstr, _("err create %s: %s"), indexfile_tmp, diff --git a/server-src/find.c b/server-src/find.c index e430bf3..3ff744e 100644 --- a/server-src/find.c +++ b/server-src/find.c @@ -35,6 +35,7 @@ #include "logfile.h" #include "holding.h" #include "find.h" +#include "cmdline.h" int find_match(char *host, char *disk); void search_holding_disk(find_result_t **output_find); @@ -947,6 +948,59 @@ dumps_match( return(matches); } +/* + * Return the set of dumps that match one or more of the given dumpspecs, + * If 'ok' is true, only dumps with a SUCCESS status will be matched. + * + * Returns a newly allocated list of results, where all strings are also newly + * allocated. Apparently some part of Amanda leaks under this condition. + */ +find_result_t * +dumps_match_dumpspecs( + find_result_t *output_find, + GSList *dumpspecs, + int ok) +{ + find_result_t *cur_result; + find_result_t *matches = NULL; + GSList *dumpspec; + dumpspec_t *ds; + + for(cur_result=output_find; + cur_result; + cur_result=cur_result->next) { + char level_str[NUM_STR_SIZE]; + g_snprintf(level_str, SIZEOF(level_str), "%d", cur_result->level); + for (dumpspec = dumpspecs; dumpspec; dumpspec = dumpspec->next) { + ds = (dumpspec_t *)dumpspec->data; + if((!ds->host || *ds->host == '\0' || match_host(ds->host, cur_result->hostname)) && + (!ds->disk || *ds->disk == '\0' || match_disk(ds->disk, cur_result->diskname)) && + (!ds->datestamp || *ds->datestamp== '\0' || match_datestamp(ds->datestamp, cur_result->timestamp)) && + (!ds->level || *ds->level== '\0' || match_level(ds->level, level_str)) && + (!ok || !strcmp(cur_result->status, "OK"))){ + + find_result_t *curmatch = alloc(SIZEOF(find_result_t)); + memcpy(curmatch, cur_result, SIZEOF(find_result_t)); + + curmatch->timestamp = stralloc(cur_result->timestamp); + curmatch->hostname = stralloc(cur_result->hostname); + curmatch->diskname = stralloc(cur_result->diskname); + curmatch->level = cur_result->level; + curmatch->label = stralloc(cur_result->label); + curmatch->filenum = cur_result->filenum; + curmatch->status = stralloc(cur_result->status); + curmatch->partnum = stralloc(cur_result->partnum); + + curmatch->next = matches; + matches = curmatch; + break; + } + } + } + + return(matches); +} + find_result_t * dump_exist( find_result_t *output_find, diff --git a/server-src/find.h b/server-src/find.h index 2fd5ed6..bcd8469 100644 --- a/server-src/find.h +++ b/server-src/find.h @@ -40,6 +40,9 @@ find_result_t *dump_exist(find_result_t *output_find, char *hostname, find_result_t *dumps_match(find_result_t *output_find, char *hostname, char *diskname, char *datestamp, char *level, int ok); +find_result_t *dumps_match_dumpspecs(find_result_t *output_find, + GSList *dumpspecs, + int ok); /* This function looks in a particular log.xxx file for dumps. Returns TRUE * if something was found. This function also skips dumps whose disklist diff --git a/server-src/infofile.c b/server-src/infofile.c index 43c6521..b7db7a8 100644 --- a/server-src/infofile.c +++ b/server-src/infofile.c @@ -75,7 +75,7 @@ open_txinfofile( /* create the directory structure if in write mode */ if (writing) { - if (mkpdir(infofile, 02755, (uid_t)-1, (gid_t)-1) == -1) { + if (mkpdir(infofile, 0755, (uid_t)-1, (gid_t)-1) == -1) { amfree(infofile); return NULL; } diff --git a/server-src/planner.c b/server-src/planner.c index a36fc6c..1c612e4 100644 --- a/server-src/planner.c +++ b/server-src/planner.c @@ -766,6 +766,23 @@ setup_estimate( } } + /* warn if last level 1 will be overwritten */ + if (ep->last_level > 1 && strlen(info.inf[1].label) > 0) { + overwrite_runs = when_overwrite(info.inf[1].label); + if(overwrite_runs == 0) { + log_add(L_WARNING, _("Last level 1 dump of %s:%s " + "on tape %s overwritten on this run, resetting to level 1"), + dp->host->hostname, qname, info.inf[1].label); + ep->last_level = 0; + } else if(overwrite_runs <= RUNS_REDZONE) { + log_add(L_WARNING, + plural(_("Last level 1 dump of %s:%s on tape %s overwritten in %d run."), + _("Last level 1 dump of %s:%s on tape %s overwritten in %d runs."), overwrite_runs), + dp->host->hostname, qname, info.inf[1].label, + overwrite_runs); + } + } + if(ep->next_level0 < 0) { g_fprintf(stderr,plural(_("%s:%s overdue %d day for level 0\n"), _("%s:%s overdue %d days for level 0\n"), @@ -905,7 +922,7 @@ setup_estimate( case DS_INCRONLY: if (ISSET(info.command, FORCE_FULL)) - askfor(ep, i++, 0, &info); + ep->last_level = 0; break; } } @@ -2558,7 +2575,7 @@ arglist_function1( } strappend(errstr, "]"); qerrstr = quote_string(errstr); - vstrextend(&bi->errstr, " ", qerrstr); + vstrextend(&bi->errstr, " ", qerrstr, NULL); amfree(errstr); amfree(qerrstr); arglist_end(argp); diff --git a/server-src/server_util.c b/server-src/server_util.c index 7c6c323..dc58d8d 100644 --- a/server-src/server_util.c +++ b/server-src/server_util.c @@ -176,7 +176,7 @@ int check_infofile( } } if (other_dle_match == 0) { - if(mkpdir(infofile, (mode_t)02755, (uid_t)-1, + if(mkpdir(infofile, (mode_t)0755, (uid_t)-1, (gid_t)-1) == -1) { *errmsg = vstralloc("Can't create directory for ", infofile, NULL); diff --git a/tape-src/tapetype.c b/tape-src/tapetype.c index 26077b1..0128401 100644 --- a/tape-src/tapetype.c +++ b/tape-src/tapetype.c @@ -30,6 +30,7 @@ * tests a tape in a given tape unit and prints a tapetype entry for * it. */ #include "amanda.h" +#include "conffile.h" #include "tapeio.h" @@ -387,6 +388,8 @@ main( setlocale(LC_MESSAGES, "C"); textdomain("amanda"); + config_init(0, NULL); + if ((sProgName = strrchr(*argv, '/')) == NULL) { sProgName = *argv; } else { -- 2.30.2