From: Kern Sibbald Date: Tue, 29 Oct 2002 08:46:54 +0000 (+0000) Subject: Important protocol change -- see kes29Oct02 X-Git-Tag: Release-1.27~43 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c369a18cfaa0cb4fe7c93398f8c55a356f857719;p=bacula%2Fbacula Important protocol change -- see kes29Oct02 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@175 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 48b5ec82f4..cbd2c93229 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,5 +1,38 @@ 2002-mm-dd Version 1.27 (22Oct02) not yet released +General: from kes29Oct02 +- Major change to the bnet communications routines. + +Changes submitted this submission: +- Modified the bacula script to use pid files, so this script should + now work on more platforms. Updated devel_bacula as well. +- Added the full GNU hostname on the configuration print output. +- Added gettimeofday() to configure, and tweaked a few variables for + OpenBSD. +- Added a chapter to the manual on Porting Bacula to other platforms. +- Documented in Tips how to use the WriteBootstrap record. +- Modified bc_types.h to error if 64 bit types are not found. +- Pass replace option for restore to the FD (no code to use it yet). +- Modify the FD to pass back the GNU OS string as well as the DISTNAME + and DISTVER. This needs to be put in the Client record in the catalog. +- Major reworking of the bnet routines to eliminate the zero length which + previously indicated a signal. This risks to create some subtle communications + bugs. The changes now permit blank lines to be sent from the user to the + Director. +- Found and corrected a few more places where the Win32 attributes were not + being recognized. +- Permit spaces in the Where string (restore) by bashing/unbashing them. +- Handle quotes correctly in the Console program (actually Dir ua code). + Previously they were not handled in the middle of a string. +- Corrected two error message (error reading file), which previously stated + it was a network error. +- Reworked the files in the binary Windows release. Removed unused programs + and added a README with the copyright as suggested by John. Also added + console.exe to the release. +- Found and corrected an autoloader mount problem where the wrong tape + was specified. Previously it looped, then gave up. Now it correctly + detects the volume is not correct and zaps the Slot in the catalog. + General: from kes23Oct02 - I have mainly worked on getting all the details of a Restore to work correctly (new tape format, support for Win32 diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 90972359a4..d70945b793 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,6 +1,6 @@ Release Notes for Bacula 1.27 - Bacula code: Total files = 218 Total lines = 59,267 (*.h *.c *.in) + Bacula code: Total files = 220 Total lines = 59,468 (*.h *.c *.in) Major Changes this Release: - Implemented support for Sparse files. @@ -8,6 +8,8 @@ Major Changes this Release: - New Volume format. Will permit faster restores, and correct restores of Volumes written with multiple simultaneous jobs. +- Important change to communications protocol. Eliminated + deprecated 0 signal. Minor Changes this Release: - Mount Anonymous Volumes is now dropped from the Storage @@ -20,7 +22,14 @@ Minor Changes this Release: - Improve handling of the "Where" prefix on Win32 by first stripping any previous drive. This allows restoration to any drive. +- Modified Director-FD logon sequence to pass the OS id strings + to the director. +- Fixed mount loop when the autochanger slot is incorrect in + the catalog. +- Updated the bacula script to work on more systems. Items to note: - The Dir-SD protocol has changed since 1.26, so you must update the Director and Storage daemons. +- The Dir-FD protocol has changed since 1.26 (and earlier versions + of 1.27). diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index a10fc39d97..2a5375e7f0 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -321,6 +321,9 @@ /* Define if you have the getpid function. */ #undef HAVE_GETPID +/* Define if you have the gettimeofday function. */ +#undef HAVE_GETTIMEOFDAY + /* Define if you have the inet_pton function. */ #undef HAVE_INET_PTON diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 6a3f7cdcde..4e8bae92a8 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -938,6 +938,7 @@ AC_CHECK_FUNCS( \ getcwd \ gethostname \ getpid \ + gettimeofday \ setpgid \ setpgrp \ setsid \ @@ -1118,6 +1119,8 @@ netbsd) llu="qu" TAPEDRIVE="/dev/nrst0" PSCMD="ps -a -o pid,command" + PTHREAD_LIB="-pthread" + CFLAGS="${CFLAGS} -pthread" ;; openbsd) DISTVER=`uname -a |awk '{print $3}'` @@ -1125,6 +1128,8 @@ openbsd) llu="qu" TAPEDRIVE="/dev/nrst0" PSCMD="ps -a -o pid,command" + PTHREAD_LIB="-pthread" + CFLAGS="${CFLAGS} -pthread" ;; redhat) DISTVER=`cat /etc/redhat-release | grep release |\ @@ -1218,6 +1223,7 @@ AC_OUTPUT([autoconf/Make.common \ src/stored/Makefile \ src/stored/bacula-sd.conf \ src/filed/Makefile \ + src/filed/host.h \ src/filed/bacula-fd.conf \ src/filed/win32/Makefile \ src/cats/Makefile \ @@ -1271,7 +1277,7 @@ fi echo " Configuration on `date`: - Host: ${DISTNAME} ${DISTVER} + Host: $host -- ${DISTNAME} ${DISTVER} Bacula version: ${VERSION} (${DATE}) Source code location: ${srcdir} Install binaries: ${sbindir} diff --git a/bacula/configure b/bacula/configure index 74e5b4ff39..3fc6806926 100755 --- a/bacula/configure +++ b/bacula/configure @@ -7477,6 +7477,7 @@ for ac_func in \ getcwd \ gethostname \ getpid \ + gettimeofday \ setpgid \ setpgrp \ setsid \ @@ -7488,12 +7489,12 @@ for ac_func in \ do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7492: checking for $ac_func" >&5 +echo "configure:7493: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7546,12 +7547,12 @@ done for ac_func in fchdir do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7550: checking for $ac_func" >&5 +echo "configure:7551: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7605,12 +7606,12 @@ done for ac_func in snprintf vsnprintf gethostid getdomainname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7609: checking for $ac_func" >&5 +echo "configure:7610: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7661,12 +7662,12 @@ done for ac_func in localtime_r readdir_r strerror_r gethostbyname_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:7665: checking for $ac_func" >&5 +echo "configure:7666: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -7716,12 +7717,12 @@ done # If resolver functions are not in libc check for -lnsl or -lresolv. echo $ac_n "checking for gethostbyname_r""... $ac_c" 1>&6 -echo "configure:7720: checking for gethostbyname_r" >&5 +echo "configure:7721: checking for gethostbyname_r" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname_r'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname_r=yes" else @@ -7762,7 +7763,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname_r`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname_r in -lnsl""... $ac_c" 1>&6 -echo "configure:7766: checking for gethostbyname_r in -lnsl" >&5 +echo "configure:7767: checking for gethostbyname_r in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname_r | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7770,7 +7771,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7809,7 +7810,7 @@ else fi echo $ac_n "checking for gethostbyname_r in -lresolv""... $ac_c" 1>&6 -echo "configure:7813: checking for gethostbyname_r in -lresolv" >&5 +echo "configure:7814: checking for gethostbyname_r in -lresolv" >&5 ac_lib_var=`echo resolv'_'gethostbyname_r | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7817,7 +7818,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7861,12 +7862,12 @@ fi # Find where sockets are (especially for Solaris) echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:7865: checking for socket" >&5 +echo "configure:7866: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -7907,7 +7908,7 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lxnet""... $ac_c" 1>&6 -echo "configure:7911: checking for socket in -lxnet" >&5 +echo "configure:7912: checking for socket in -lxnet" >&5 ac_lib_var=`echo xnet'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7915,7 +7916,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7954,7 +7955,7 @@ else fi echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:7958: checking for socket in -lsocket" >&5 +echo "configure:7959: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7962,7 +7963,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8001,7 +8002,7 @@ else fi echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6 -echo "configure:8005: checking for socket in -linet" >&5 +echo "configure:8006: checking for socket in -linet" >&5 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8009,7 +8010,7 @@ else ac_save_LIBS="$LIBS" LIBS="-linet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8053,12 +8054,12 @@ fi for ac_func in inet_pton do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8057: checking for $ac_func" >&5 +echo "configure:8058: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8110,12 +8111,12 @@ done echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:8114: checking for strftime" >&5 +echo "configure:8115: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -8160,7 +8161,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:8164: checking for strftime in -lintl" >&5 +echo "configure:8165: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8168,7 +8169,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8206,12 +8207,12 @@ fi fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:8210: checking for vprintf" >&5 +echo "configure:8211: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -8258,12 +8259,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:8262: checking for _doprnt" >&5 +echo "configure:8263: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -8313,19 +8314,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:8317: checking for working alloca.h" >&5 +echo "configure:8318: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:8329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -8346,12 +8347,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:8350: checking for alloca" >&5 +echo "configure:8351: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -8411,12 +8412,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:8415: checking whether alloca needs Cray hooks" >&5 +echo "configure:8416: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:8445: checking for $ac_func" >&5 +echo "configure:8446: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -8496,7 +8497,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:8500: checking stack direction for C alloca" >&5 +echo "configure:8501: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8504,7 +8505,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -8546,7 +8547,7 @@ fi # getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware. echo $ac_n "checking for getmntent in -lsun""... $ac_c" 1>&6 -echo "configure:8550: checking for getmntent in -lsun" >&5 +echo "configure:8551: checking for getmntent in -lsun" >&5 ac_lib_var=`echo sun'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8554,7 +8555,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8584,7 +8585,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for getmntent in -lseq""... $ac_c" 1>&6 -echo "configure:8588: checking for getmntent in -lseq" >&5 +echo "configure:8589: checking for getmntent in -lseq" >&5 ac_lib_var=`echo seq'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8592,7 +8593,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lseq $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8622,7 +8623,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for getmntent in -lgen""... $ac_c" 1>&6 -echo "configure:8626: checking for getmntent in -lgen" >&5 +echo "configure:8627: checking for getmntent in -lgen" >&5 ac_lib_var=`echo gen'_'getmntent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8630,7 +8631,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8666,12 +8667,12 @@ fi fi echo $ac_n "checking for getmntent""... $ac_c" 1>&6 -echo "configure:8670: checking for getmntent" >&5 +echo "configure:8671: checking for getmntent" >&5 if eval "test \"`echo '$''{'ac_cv_func_getmntent'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getmntent=yes" else @@ -8717,7 +8718,7 @@ else fi echo $ac_n "checking whether closedir returns void""... $ac_c" 1>&6 -echo "configure:8721: checking whether closedir returns void" >&5 +echo "configure:8722: checking whether closedir returns void" >&5 if eval "test \"`echo '$''{'ac_cv_func_closedir_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8725,13 +8726,13 @@ else ac_cv_func_closedir_void=yes else cat > conftest.$ac_ext < #include <$ac_header_dirent> int closedir(); main() { exit(closedir(opendir(".")) != 0); } EOF -if { (eval echo configure:8735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_closedir_void=no else @@ -8754,7 +8755,7 @@ EOF fi echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:8758: checking whether setpgrp takes no argument" >&5 +echo "configure:8759: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8762,7 +8763,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -8805,7 +8806,7 @@ EOF fi echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 -echo "configure:8809: checking for working fnmatch" >&5 +echo "configure:8810: checking for working fnmatch" >&5 if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8816,11 +8817,11 @@ if test "$cross_compiling" = yes; then ac_cv_func_fnmatch_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_fnmatch_works=yes else @@ -8845,7 +8846,7 @@ fi echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 -echo "configure:8849: checking for setlocale in -lxpg4" >&5 +echo "configure:8850: checking for setlocale in -lxpg4" >&5 ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8853,7 +8854,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxpg4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8887,7 +8888,7 @@ fi echo $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>&6 -echo "configure:8891: checking for getpwnam in -lsun" >&5 +echo "configure:8892: checking for getpwnam in -lsun" >&5 ac_lib_var=`echo sun'_'getpwnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8895,7 +8896,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsun $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8938,17 +8939,17 @@ for ac_hdr in zlib.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8942: checking for $ac_hdr" >&5 +echo "configure:8943: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8952: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8953: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8975,7 +8976,7 @@ fi done echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:8979: checking for deflate in -lz" >&5 +echo "configure:8980: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8983,7 +8984,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9025,7 +9026,7 @@ fi PTHREAD_LIB="" echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:9029: checking for pthread_create in -lpthread" >&5 +echo "configure:9030: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9033,7 +9034,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9063,7 +9064,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 -echo "configure:9067: checking for pthread_create in -lpthreads" >&5 +echo "configure:9068: checking for pthread_create in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9071,7 +9072,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9101,7 +9102,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:9105: checking for pthread_create in -lc_r" >&5 +echo "configure:9106: checking for pthread_create in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9109,7 +9110,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9139,12 +9140,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 -echo "configure:9143: checking for pthread_create" >&5 +echo "configure:9144: checking for pthread_create" >&5 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_pthread_create=yes" else @@ -9308,6 +9309,8 @@ netbsd) llu="qu" TAPEDRIVE="/dev/nrst0" PSCMD="ps -a -o pid,command" + PTHREAD_LIB="-pthread" + CFLAGS="${CFLAGS} -pthread" ;; openbsd) DISTVER=`uname -a |awk '{print $3}'` @@ -9315,6 +9318,8 @@ openbsd) llu="qu" TAPEDRIVE="/dev/nrst0" PSCMD="ps -a -o pid,command" + PTHREAD_LIB="-pthread" + CFLAGS="${CFLAGS} -pthread" ;; redhat) DISTVER=`cat /etc/redhat-release | grep release |\ @@ -9514,6 +9519,7 @@ trap 'rm -fr `echo "autoconf/Make.common \ src/stored/Makefile \ src/stored/bacula-sd.conf \ src/filed/Makefile \ + src/filed/host.h \ src/filed/bacula-fd.conf \ src/filed/win32/Makefile \ src/cats/Makefile \ @@ -9771,6 +9777,7 @@ CONFIG_FILES=\${CONFIG_FILES-"autoconf/Make.common \ src/stored/Makefile \ src/stored/bacula-sd.conf \ src/filed/Makefile \ + src/filed/host.h \ src/filed/bacula-fd.conf \ src/filed/win32/Makefile \ src/cats/Makefile \ @@ -10000,7 +10007,7 @@ fi echo " Configuration on `date`: - Host: ${DISTNAME} ${DISTVER} + Host: $host -- ${DISTNAME} ${DISTVER} Bacula version: ${VERSION} (${DATE}) Source code location: ${srcdir} Install binaries: ${sbindir} diff --git a/bacula/kernstodo b/bacula/kernstodo index 93d95f18ab..bc16bde150 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,18 +1,42 @@ Kern's ToDo List - 23 October 2002 + 25 October 2002 To do: - Document that two Verifys at same time on same client do not work. - Document how to recycle a tape in 7 days even if the backup takes a long time. -- Document default config file locations. -- Document better Include (does it cross file systems ?). -- Document specifically how to add new File daemon to config files. - Figure out why my Catalog size keeps growing (Filename and Path tables keep growing) -- fix it. -- Label (asks for slot, return and it stops). +- Add Doc on saving MySQL databases, where to find code for shutting + down and saving other databases. + +For 1.27 release: +- Continue improving the restore process (handling + of tapes, efficiency improvements e.g. use FSF to + position the tape, ...) +- Allow restore with options (e.g. overwrite, overwrite + if newer, no overwrite, permit changing ownership, ...). +- Test recovery of a damaged tape. +- Work more on how to to a Bacula restore beginning with + just a Bacula tape and a boot floppy (bare metal recovery). +- Possibly add a File System Module permitting an external + program do the file reading and writing during save and + restore (i.e. with this you could backup/restore + ANYTHING to and from a Bacula Volume, including horrible + stuff like Windows ACLs). +- Preprocessing command per file. +- Postprocessing command per file (when restoring). +- File system type from File daemon +- Decide what to do with JobTDate in catalog (make real btime_t?) +- File daemon should pass Director the operating system info + to be stored in the Client Record (or verified that it has + not changed). +- Add VOLUME_CAT_INFO to the EOS tape record (as + well as to the EOD record). +- Send Volumes needed during restore to Console (just after + create_volume_list) -- also in restore command? - Document buffer size considerations with Sparse files -- - Document all daemon tools MUST have a config file. - Move block size code from block.c to init_dev(). @@ -23,8 +47,6 @@ To do: - Why does btape error when pointed to a file? - Possibly add email to Watchdog if drive is unmounted too long and a job is waiting on the drive. - -- Add configure for gettimeofday. - Disallow compile if long long not 64 bits. - What to do with btime and JobTDate? - Add FileSet MD5 to bscan. @@ -36,15 +58,10 @@ To do: - Program files (i.e. execute a program to read/write files). Pass read date of last backup, size of file last time. - Try bare metal Windows restore -- Recovery of a bad tape. +- Recovery of a bad tape (bcopy) - EOM records????????????????? - Why don't we get an error message from Win32 FD when bootstrap file cannot be created for restore command? -- At line 51 of ua_input.c, why is = 0 necessary. Previously without - it, if cancel gnome-console during sql command, DIR crashed. However, - with it, blank line input for Where: is not possible. -- Make SD disallow writing on Volume with fewer files than in - the catalog. - Put MaximumVolumeSize in Director. - Document to have patience when SD first starts. - Document running a test version. @@ -57,7 +74,7 @@ To do: in block, done when count is reached, and possibly other optimizations. I.e. add a state word. - +After 1.27 - After unmount, if restore job started, ask to mount. - Fix db_get_fileset in cats/sql_get.c for multiple records. - Fix start/end blocks for File devices @@ -69,7 +86,6 @@ To do: - Make Restore report an error if FD or SD term codes are not OK. - Convert all %x substitution variables, which are hard to remember and read to %(variable-name). Idea from TMDA. -- Report compression % and other compression statistics if turned on. - Add JobLevel in FD status (but make sure it is defined). - Make Pool resource handle Counter resources. - Remove NextId for SQLite. Optimize. @@ -88,8 +104,6 @@ To do: - Fix Win32 config file definition name on /install - No READLINE_SRC if found in alternate directory. - Add Client FS/OS id (Linux, Win95/98, ...). -- Put Windows files in Windows stream? -- Ensure that everyone uses btime routines (mostly done). Projects: @@ -288,13 +302,9 @@ Small projects: - Restore to a particular time -- e.g. before date, after date. - Make all database Ids 64 bit. - Write an applet for Linux. -- Make SD reject writing on tape where Catalog and tape # files - don't agree (possibly OK if tape > catalog). -- Implement new daemon communications protocol. -- Send Volumes needed during restore to Console (just after - create_volume_list) -- also in restore command? - Add estimate to Console commands - Find solution to blank filename (i.e. path only) problem. +- Implement new daemon communications protocol. Dump: mysqldump -f --opt bacula >bacula @@ -304,10 +314,6 @@ To be done: - Remove PoolId from Job table, it exists in Media. - Allow console commands to detach or run in background. - Fix status delay on storage daemon during rewind. -- Add VerNo to each Session label record. -- Add Job to Session records. -- Add VOLUME_CAT_INFO to the EOS tape record (as - well as to the EOD record). - Add SD message variables to control operator wait time - Maximum Operator Wait - Minimum Message Interval @@ -317,57 +323,34 @@ To be done: - Require EOD records - Send Operator message when cannot read tape label. - Think about how to handle I/O error on MTEOM. -- If Storage daemon aborts a job, ensure that this - is printed in the error message. - Verify level=Volume (scan only), level=Data (compare of data to file). Verify level=Catalog, level=InitCatalog -- Dump of Catalog -- Cold start full restore (restore catalog then - user selects what to restore). Write summary file containing only - Job, Media, and Catalog information. Store on another machine. -- Dump/Restore database -- File system type - Events file - Add keyword search to show command in Console. - Fix Win2000 error with no messages during startup. - Events : tape has more than xxx bytes. -- In Storage daemon, status should include job cancelled. - Write general list maintenance subroutines. -- Implement immortal format with EDOs. - Restrict characters permitted in a Resource name. -- Provide definitive identification of type in backup. - Complete code in Bacula Resources -- this will permit reading a new config file at any time. -- Document new Console - Handle ctl-c in Console -- Test restore of Windows backup - Implement LabelTemplate (at least first cut). -- Implement script driven addition of File daemon to - config files. +- Implement script driven addition of File daemon to config files. -- Bug: anonymous Volumes requires mount in some cases. - see setgroup and user for Bacula p4-5 of stunnel.c - Implement new serialize subroutines send(socket, "string", &Vol, "uint32", &i, NULL) -- Add save type to Session label. -- Correct date on Session label. -- On I/O error, write EOF, then try to write again. -- Audit all UA commands to ensure that we always prompt where - possible. -- If ./btape is called without /dev, assume argument is - a Storage resource name. +- On I/O error, write EOF, then try to write again ???? +- Audit all UA commands to ensure that we always prompt where possible. +- If ./btape is called without /dev, assume argument is a Storage resource name. - Put memory utilization in Status output of each daemon if full status requested or if some level of debug on. - Make database type selectable by .conf files i.e. at runtime - gethostbyname failure in bnet_connect() continues generating errors -- should stop. -- Don't create a volume that is already written. I.e. create only once. -- If error at end of tape, implement some way to kill waiting processes. - Add HOST to Volume label. - Set flag for uname -a. Add to Volume label. - Implement throttled work queue. -- Write bscan program that will syncronize the DB Media record with - the contents of the Volume -- for use after a crash. - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc) - Allow multiple Storage specifications (or multiple names on a single Storage specification) in the Job record. Thus a job @@ -388,9 +371,6 @@ To be done: - Restore options (do not overwrite) - Restore -- do nothing but show what would happen - SET LD_RUN_PATH=$HOME/mysql/lib/mysql -- Put Job statistics in End Session Label (files saved, - total bytes, start time, ...). -- Put FileSet name in the SOS label. - Implement Restore FileSet= - Write a scanner for the UA (keyword, scan-routine, result, prompt). - Create a protocol.h and protocol.c where all protocol messages @@ -398,25 +378,19 @@ To be done: - If SD cannot open a drive, make it periodically retry. - Put Bacula version somewhere in Job stream, probably Start Session Labels. -- Remove duplicate fields from jcr (e.g. jcr.level and - jcr.jr.Level, ...). +- Remove duplicate fields from jcr (e.g. jcr.level and jcr.jr.Level, ...). - Timout a job or terminate if link goes down, or reopen link and query. -- Define how we handle times to avoid problem with Unix dates (2049 ?). - Fill all fields in Vol/Job Header -- ensure that everything needed is written to tape. Think about restore to Catalog from tape. Client record needs improving. - Find general solution for sscanf size problems (as well as sprintf. Do at run time? - - Concept of precious tapes (cannot be reused). - Allow FD to run from inetd ??? -- Preprocessing command per file. -- Postprocessing command per file (when restoring). - Restore should get Device and Pool information from job record rather than from config. - Autolabel should be specified by DR instead of SD. -- Ability to recreate the catalog from a tape. - Find out how to get the system tape block limits, e.g.: Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes. Apr 22 21:22:10 polymatou kernel: st0: Block limits 2 - 16777214 bytes. @@ -447,51 +421,13 @@ To be done: - MaxWarnings - MaxErrors (job?) ===== -- Eliminate duplicate File records to shrink database. - FD sends unsaved file list to Director at end of job. - Write a Storage daemon that uses pipes and standard Unix programs to write to the tape. See afbackup. - Need something that monitors the JCR queue and times out jobs by asking the deamons where they are. -- Add daemon JCR JobId=0 to have a daemon context -- Pool resource - - Auto label - - Auto media verify - - Client (list of clients to force client) - - Devices (list of devices to force device) - - enable/disable - - Groups - - Levels - - Type: Backup, ... - - Recycle from other pools: Yes, No - - Recycle to other pools: Yes, no - - FileSets - - MaxBytes? - - Optional MediaType to force media? - - Maintain Catalog - - Label Template - - Retention Period - ============ - - Name - - NumVols - - NaxVols - - CurrentVol -===== - if(connect(sockfd, (struct sockaddr * ) (& addr), sizeof(addr)) .lt. 0){ - close(sockfd); - return(-6); - } - - linger.l_onoff = 1; - linger.l_linger = 60; - i = setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (char *) &linger, - sizeof (linger)); - - fl = fcntl(sockfd, F_GETFL); - fcntl(sockfd, F_SETFL, fl & (~ O_NONBLOCK) & (~ O_NDELAY)); -==== - Enhance Jmsg code to permit buffering and saving to disk. - device driver = "xxxx" for drives. - restart: paranoid: read label fsf to @@ -507,7 +443,6 @@ To be done: at end of save retry and report any errors. - Need report class for messages. Perhaps report resource where report=group of messages -- Verify from Tape - enhance scan_attrib and rename scan_jobtype, and fill in code for "since" option - To buffer messages, we need associated jobid and Director name. @@ -517,8 +452,6 @@ To be done: Don't reschedule a job if previous incarnation is still running. - Figure out how to save the catalog (possibly a special FileSet). - Figure out how to restore the catalog. -- Figure out how to put a Volume into the catalog (from the tape) -- Figure out how to do a restore from a Volume - Some way to automatically backup everything is needed???? - Need a structure for pending actions: - buffered messages @@ -528,15 +461,12 @@ To be done: - Drive management Read, Write, Clean, Delete - Login to Bacula; Bacula users with different permissions: - owner, group, user + owner, group, user, quotas - Tape recycle destination - Job Schedule Status - Automatic - Manual - Running -- File daemon should pass Director the operating system info - to be stored in the Client Record (or verified that it has - not changed). - Store info on each file system type (probably in the job header on tape. This could be the output of df; or perhaps some sort of /etc/mtab record. @@ -580,3 +510,53 @@ Done: (see kernsdone for more) - Look into MinGW - Implement sparse files. - Document sparse files. +- Document better Include (does it cross file systems ?). +- Document default config file locations. +- Document specifically how to add new File daemon to config files. +- Add VerNo to each Session label record. +- Add Job to Session records. +- Cold start full restore (restore catalog then + user selects what to restore). Write summary file containing only + Job, Media, and Catalog information. Store on another machine. +- Dump/Restore database +- Write bscan program that will syncronize the DB Media record with + the contents of the Volume -- for use after a crash. +- Figure out how to put a Volume into the catalog (from the tape) +- Figure out how to do a restore from a Volume +- Report compression % and other compression statistics if turned on. +- Put Windows files in Windows stream? +- Ensure that everyone uses btime routines (mostly done). +- Put Job statistics in End Session Label (files saved, + total bytes, start time, ...). +- Put FileSet name in the SOS label. +- Eliminate duplicate File records to shrink database. +- If Storage daemon aborts a job, ensure that this + is printed in the error message. +- Add save type to Session label. +- Correct date on Session label. +- Test restore of Windows backup +- Ability to recreate the catalog from a tape. +- Bug: anonymous Volumes requires mount in some cases. +- Define how we handle times to avoid problem with Unix dates (2049 ?). +- Add daemon JCR JobId=0 to have a daemon context +- Implement full restoration of all Windows attributes + (such as Hidden, System, creation dates, ...) +- Handle sparse files (i.e. files with holes in them) +- Enhance testing for Bacula compatibility with + tape drives. +- Turn on new BB02 tape format implemented in 1.26 but + not yet turned on. +- More testing of restoring on Unix systems. +- Implement additional tape format enhancements to better + support Windows and other non-Unix systems e.g. + extended attributes. +- Upgrade to latest version of cygwin. (not possible) +- Add configure for gettimeofday. +- At line 51 of ua_input.c, why is = 0 necessary. Previously without + it, if cancel gnome-console during sql command, DIR crashed. However, + with it, blank line input for Where: is not possible. +- Make SD disallow writing on Volume with fewer files than in + the catalog. +- Label (asks for slot, return and it stops). +- Make SD reject writing on tape where Catalog and tape # files + don't agree (possibly OK if tape > catalog). diff --git a/bacula/src/bc_types.h b/bacula/src/bc_types.h index 4de25ce837..efccfb05d9 100644 --- a/bacula/src/bc_types.h +++ b/bacula/src/bc_types.h @@ -82,17 +82,17 @@ typedef uint32_t u_int32_t; # if (SIZEOF_CHAR == 1) typedef unsigned char u_int8_t; # else -# error "8 bit int type not found." +# error "8 bit int type not found. Required!" # endif # if (SIZEOF_SHORT_INT == 2) typedef unsigned short int u_int16_t; # else -# error "16 bit int type not found." +# error "16 bit int type not found. Required!" # endif # if (SIZEOF_INT == 4) typedef unsigned int u_int32_t; # else -# error "32 bit int type not found." +# error "32 bit int type not found. Required!" # endif # endif #endif @@ -114,7 +114,7 @@ typedef long int int64_t; # ifdef HAVE_INT64_T typedef int64_t intmax_t; # else -typedef int32_t intmax_t; +# error "64 bit type not found. Required!" # endif #endif @@ -126,6 +126,8 @@ typedef unsigned long long int u_int64_t; # if (SIZEOF_LONG_INT == 8) typedef unsigned long int u_int64_t; # define HAVE_U_INT64_T 1 +# else +# error "64 bit type not found. Required!" # endif # endif #endif @@ -134,7 +136,7 @@ typedef unsigned long int u_int64_t; # ifdef HAVE_U_INT64_T typedef u_int64_t u_intmax_t; # else -typedef u_int32_t u_intmax_t; +# error "64 bit type not found. Required!" # endif #endif diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 19b002781f..348ede4035 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -276,7 +276,7 @@ int db_create_client_record(B_DB *mdb, CLIENT_DBR *cr) char ed1[30], ed2[30]; db_lock(mdb); - Mmsg(&mdb->cmd, "SELECT ClientId FROM Client WHERE Name='%s'", cr->Name); + Mmsg(&mdb->cmd, "SELECT ClientId,Uname FROM Client WHERE Name='%s'", cr->Name); cr->ClientId = 0; if (QUERY_DB(mdb, mdb->cmd)) { @@ -297,6 +297,12 @@ int db_create_client_record(B_DB *mdb, CLIENT_DBR *cr) return 0; } cr->ClientId = atoi(row[0]); + if (row[1]) { + strncpy(cr->Uname, row[1], sizeof(cr->Uname)-2); + cr->Uname[sizeof(cr->Uname)-1] = 0; + } else { + cr->Uname[0] = 0; /* no name */ + } sql_free_result(mdb); db_unlock(mdb); return 1; diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index 3cae3d5599..c88f21145e 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -120,7 +120,7 @@ static void read_and_process_input(FILE *input, BSOCK *UA_sock) stat = 1; } } - if (stat < 0) { + if (stat < 0) { break; /* error */ } else if (stat == 0) { /* timeout */ bnet_fsend(UA_sock, ".messages"); @@ -133,7 +133,7 @@ static void read_and_process_input(FILE *input, BSOCK *UA_sock) if (strcmp(UA_sock->msg, ".quit") == 0 || strcmp(UA_sock->msg, ".exit") == 0) { break; } - while ((stat = bnet_recv(UA_sock)) > 0) { + while ((stat = bnet_recv(UA_sock)) >= 0) { if (at_prompt) { if (!stop) { fprintf(output, "\n"); @@ -147,9 +147,9 @@ static void read_and_process_input(FILE *input, BSOCK *UA_sock) if (!stop) { fflush(output); } - if (stat < 0) { - break; /* error */ - } else if (stat == 0) { + if (is_bnet_stop(UA_sock)) { + break; /* error or term */ + } else if (stat == BNET_SIGNAL) { if (UA_sock->msglen == BNET_PROMPT) { at_prompt = TRUE; } diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index 094c2b9a50..950e7c96cd 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -272,17 +272,18 @@ static int wait_for_job_termination(JCR *jcr) jcr->JobStatus = JS_WaitFD; /* Wait for Client to terminate */ - while ((n = bget_msg(fd, 0)) > 0 && !job_cancelled(jcr)) { + while ((n = bget_msg(fd, 0)) >= 0 && !job_cancelled(jcr)) { if (sscanf(fd->msg, EndBackup, &jcr->JobStatus, &jcr->JobFiles, &jcr->ReadBytes, &jcr->JobBytes) == 4) { fd_ok = TRUE; + Dmsg1(100, "FDStatus=%c\n", (char)jcr->JobStatus); } } - bnet_sig(fd, BNET_TERMINATE); /* tell Client we are terminating */ - if (n < 0) { + if (is_bnet_error(fd)) { Jmsg(jcr, M_FATAL, 0, _("JobStatus != JS_Terminated) { return jcr->JobStatus; } - if (!fd_ok || n < 0) { + if (!fd_ok || is_bnet_error(fd)) { return JS_ErrorTerminated; } return jcr->SDJobStatus; diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index 1e967cd25e..1065a3f6be 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -295,7 +295,7 @@ void catalog_update(JCR *jcr, BSOCK *bs, char *msg) } else if (Stream == STREAM_MD5_SIGNATURE) { fname = p; if (jcr->FileIndex != FileIndex) { - Jmsg(jcr, M_WARNING, 0, "Got MD5 but not same block as attributes\n"); + Jmsg(jcr, M_WARNING, 0, "Got MD5 but not same File as attributes\n"); } else { /* Update MD5 signature in catalog */ char MD5buf[50]; /* 24 bytes should be enough */ diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 473fdada45..d737a7e08c 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -331,9 +331,9 @@ static struct s_kw RestoreFields[] = { /* Options permitted in Restore replace= */ static struct s_kw ReplaceOptions[] = { - {"always", 'A'}, /* always */ - {"ifnewer", 'W'}, - {"never", 'N'}, + {"always", 'a'}, /* always */ + {"ifnewer", 'w'}, + {"never", 'n'}, {NULL, 0} }; @@ -341,24 +341,26 @@ static struct s_kw ReplaceOptions[] = { /* Define FileSet KeyWord values */ -#define FS_KW_NONE 0 -#define FS_KW_COMPRESSION 1 -#define FS_KW_SIGNATURE 2 -#define FS_KW_ENCRYPTION 3 -#define FS_KW_VERIFY 4 -#define FS_KW_ONEFS 5 -#define FS_KW_RECURSE 6 -#define FS_KW_SPARSE 7 - -/* FileSet keywords */ +#define INC_KW_NONE 0 +#define INC_KW_COMPRESSION 1 +#define INC_KW_SIGNATURE 2 +#define INC_KW_ENCRYPTION 3 +#define INC_KW_VERIFY 4 +#define INC_KW_ONEFS 5 +#define INC_KW_RECURSE 6 +#define INC_KW_SPARSE 7 +#define INC_KW_REPLACE 8 /* restore options */ + +/* Include keywords */ static struct s_kw FS_option_kw[] = { - {"compression", FS_KW_COMPRESSION}, - {"signature", FS_KW_SIGNATURE}, - {"encryption", FS_KW_ENCRYPTION}, - {"verify", FS_KW_VERIFY}, - {"onefs", FS_KW_ONEFS}, - {"recurse", FS_KW_RECURSE}, - {"sparse", FS_KW_SPARSE}, + {"compression", INC_KW_COMPRESSION}, + {"signature", INC_KW_SIGNATURE}, + {"encryption", INC_KW_ENCRYPTION}, + {"verify", INC_KW_VERIFY}, + {"onefs", INC_KW_ONEFS}, + {"recurse", INC_KW_RECURSE}, + {"sparse", INC_KW_SPARSE}, + {"replace", INC_KW_REPLACE}, {NULL, 0} }; @@ -372,25 +374,28 @@ struct s_fs_opt { /* Options permitted for each keyword and resulting value */ static struct s_fs_opt FS_options[] = { - {"md5", FS_KW_SIGNATURE, "M"}, - {"gzip", FS_KW_COMPRESSION, "Z6"}, - {"gzip1", FS_KW_COMPRESSION, "Z1"}, - {"gzip2", FS_KW_COMPRESSION, "Z2"}, - {"gzip3", FS_KW_COMPRESSION, "Z3"}, - {"gzip4", FS_KW_COMPRESSION, "Z4"}, - {"gzip5", FS_KW_COMPRESSION, "Z5"}, - {"gzip6", FS_KW_COMPRESSION, "Z6"}, - {"gzip7", FS_KW_COMPRESSION, "Z7"}, - {"gzip8", FS_KW_COMPRESSION, "Z8"}, - {"gzip9", FS_KW_COMPRESSION, "Z9"}, - {"blowfish", FS_KW_ENCRYPTION, "B"}, /* ***FIXME*** not implemented */ - {"3des", FS_KW_ENCRYPTION, "3"}, /* ***FIXME*** not implemented */ - {"yes", FS_KW_ONEFS, "0"}, - {"no", FS_KW_ONEFS, "f"}, - {"yes", FS_KW_RECURSE, "0"}, - {"no", FS_KW_RECURSE, "h"}, - {"yes", FS_KW_SPARSE, "s"}, - {"no", FS_KW_SPARSE, "0"}, + {"md5", INC_KW_SIGNATURE, "M"}, + {"gzip", INC_KW_COMPRESSION, "Z6"}, + {"gzip1", INC_KW_COMPRESSION, "Z1"}, + {"gzip2", INC_KW_COMPRESSION, "Z2"}, + {"gzip3", INC_KW_COMPRESSION, "Z3"}, + {"gzip4", INC_KW_COMPRESSION, "Z4"}, + {"gzip5", INC_KW_COMPRESSION, "Z5"}, + {"gzip6", INC_KW_COMPRESSION, "Z6"}, + {"gzip7", INC_KW_COMPRESSION, "Z7"}, + {"gzip8", INC_KW_COMPRESSION, "Z8"}, + {"gzip9", INC_KW_COMPRESSION, "Z9"}, + {"blowfish", INC_KW_ENCRYPTION, "B"}, /* ***FIXME*** not implemented */ + {"3des", INC_KW_ENCRYPTION, "3"}, /* ***FIXME*** not implemented */ + {"yes", INC_KW_ONEFS, "0"}, + {"no", INC_KW_ONEFS, "f"}, + {"yes", INC_KW_RECURSE, "0"}, + {"no", INC_KW_RECURSE, "h"}, + {"yes", INC_KW_SPARSE, "s"}, + {"no", INC_KW_SPARSE, "0"}, + {"always", INC_KW_REPLACE, "a"}, + {"ifnewer", INC_KW_REPLACE, "w"}, + {"never", INC_KW_REPLACE, "n"}, {NULL, 0, 0} }; @@ -1189,10 +1194,10 @@ static void store_restore(LEX *lc, struct res_items *item, int index, int pass) /* - * Scan for FileSet options (keyword=option) is converted into one or + * Scan for Include options (keyword=option) is converted into one or * two characters. Verifyopts=xxxx is Vxxxx: */ -static char *scan_fs_options(LEX *lc, int keyword) +static char *scan_include_options(LEX *lc, int keyword) { int token, i; static char opts[100]; @@ -1202,7 +1207,7 @@ static char *scan_fs_options(LEX *lc, int keyword) opts[0] = option[2] = 0; /* terminate options */ for (;;) { token = lex_get_token(lc, T_NAME); /* expect at least one option */ - if (keyword == FS_KW_VERIFY) { /* special case */ + if (keyword == INC_KW_VERIFY) { /* special case */ /* ***FIXME**** ensure these are in permitted set */ strcpy(option, "V"); /* indicate Verify */ strcat(option, lc->str); @@ -1248,21 +1253,21 @@ static void store_inc(LEX *lc, struct res_items *item, int index, int pass) /* Get include options */ strcpy(inc_opts, "0"); /* set no options */ while ((token=lex_get_token(lc, T_ALL)) != T_BOB) { - keyword = FS_KW_NONE; + keyword = INC_KW_NONE; for (i=0; FS_option_kw[i].name; i++) { if (strcasecmp(lc->str, FS_option_kw[i].name) == 0) { keyword = FS_option_kw[i].token; break; } } - if (keyword == FS_KW_NONE) { + if (keyword == INC_KW_NONE) { scan_err1(lc, "Expected a FileSet keyword, got: %s", lc->str); } /* Option keyword should be following by =