From: Kern Sibbald Date: Thu, 27 Oct 2005 13:32:55 +0000 (+0000) Subject: - Return HARDEOF status from bnet_recv() if bsock NULL rather X-Git-Tag: Release-1.38.0~32 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=feab5e44a11789ea0cc5e350e3d5d00e145c89a0;p=bacula%2Fbacula - Return HARDEOF status from bnet_recv() if bsock NULL rather than aborting. - Don't overwrite pthreadVCE.dll or msvcr71.dll during Win32 install. - Update README.win32 instructions. - Update ReleaseNotes git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2487 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/ChangeLog b/bacula/ChangeLog index a0cdb57d11..1b62336e76 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,3 +1,83 @@ +Changes to 1.37.42: +26Oct05 +- Don't overwrite pthreadVCE.dll or msvcr71.dll during Win32 + install. +- Update README.win32 instructions. +25Oct05 +- Make db_get_job_record() return Name so that the ACL + can be checked. Fixes bug #446 +22Oct05 +- Insure that all the SD tools init the Autochanger + resources. + +Changes to 1.37.41: +22Oct05 +- Print error message if no Changer Command found. +- Apply fix from Martin Simmons to clear structure before + using it in IPADDR -- fixes a bind() bug on AIX. +14Oct05 +- Add NetBSD fstype patch from Geert Hendrickx +- Update num_parts only when writing to DVD. +13Oct05 +- Fix error conditions in bpipe.c DVD routine (terminate buffer). +- Use a bigger buffer 32K as suggested by Arno in bpipe.c. +- Increase dvd mount timeout with patch from Arno. +- Modify DVD code so that it keeps a state flag that indicates + when the freespace variable is valid. freespace_errno, now has + either 0 or an errno. There are no negative errnos. +- Create is_freespace_ok() to test state flag. Also, set_freespace_ok() + and clear_freespace_ok(). Modify code to use them. This + simplifies a bit the logic of the freespace code. +- Edit 64bit debug values correctly in dvd.c +- Fix %e variable to check num_parts rather than part. +- Use static buffer instead of static buffers for FI_to_ascii() + and stream_to_ascii() debug routines in SD. This is to prevent + possible race conditions between two threads (possibly Phil's + unmount problem). +12Oct05 +- Add a .dir command that separates arguments with commas. It + is intended to be used in the tree routines to get a + machine readable output for GUIs like wx-console. +- Make configure set dvd-handler to have execute permission. +- Install dvd-handler as is done for other dvd-xxx scripts. +- In block.c call dvd_write_part() to write last part rather + than dvd_open_next_part(). +- Prefix some DVD subroutines with dvd_ +11Oct05 +- Add extra debug to Update media error for VolFiles decrease + error. +- Do not update dev->file on set_ateof() for non-tape. +10Oct05 +- Mark DVD volume in error if part cannot be written. +- If a DVD is mounted, unmount it before asking operator + to mount an different one. +- Add Arno's dvd-handler script to the scripts directory and + integrate with configure. It replaces both existing scripts. +- Make default schedule start at 23:10 +- Implement gui release in Makefile. It creates two .tar.gz + bacula-web and bimagemgr. +08Oct05 +- Add README plus tar release to gui project. +- Manual documentation +- Tweak bacula.man doc +- Add PRAGMA synchronous = NORMAL; to SQLite3 tables. This + speeds up SQLite3 so it is only about 10% slower than version + 2.xx. Thanks to Russell Howe for this tip. +- Add msvcr71.dll to pebuilder .inf file as it is needed by + Bacula FD. Thanks to Brandon for passing this fix to Scott. +05Oct05 +- Add VolumePurged method to Python JobEvents class. Fixes + bug #428 (I think). +- Add JobId index to File table for MySQL. +- Correct tray-monitor crash of bacula-dir. qstatus_cmd() + code referenced the wrong pointer. Fixes bug #438. +- Add bacualnovss.mak file from Martin. +- Remove Pool from restore string in wbrestorepanel.cpp. Patch + from user for bug #433. +- Correct code in wbrestorpanel.cpp with misplaced parens. Patch + from user for bug #431 +- Correct printing filenames/date/times in wbrestorepanel.cpp due to bad + column alignment. Patch from user for bug #432. Changes to 1.37.40: 01Oct05 @@ -1394,3 +1474,98 @@ Changes to 1.37.2: - Make built-in variables table driven. - First cut of Python Events for Bacula. Director only. StartJob, EndJob, NewVolume events. + + + Technical notes on version 1.37 + Nicolas Boichat + +General: + +Changes to 1.37.*: +26Oct05 + - dvd.c: update VolParts when writing the last part. +19Oct05 + - configure: add check for dd, remove check for df + - block.c:do_dvd_size_checks: Check we are writing to a dvd before doing tests + (reported by David Raine on the list, "[Bacula-users] LTO drive - End Of Volume error"). + - Update bacula-sd.conf.in to use dvd-handler correctly. + - dvd.c:dvd_write_part: Increase timeout when writing the first part (see the code for + more details). +18Oct05 + - Modify .backups command to get a fileset parameter (fix bug #444). +17Oct05 + - Fix bug when recycling DVD devices (append flag was removed). + - Add tests for dvd+rw-format in configure script. + - scripts/dvd-handler: Reformat DVD-RW when needed. This needs dvd+rw-format. + - Add patch for dvd+rw-tools in patches dir (this should probably be elsewhere). +16Oct05 + - Remove scripts/dvd-freespace and scripts/dvd-writepart, as they are now + merged into scripts/dvd-handler. Note: Documentation needs to be updated. + - scripts/dvd-handler: "zero" brand-new DVD+/-RW to fix a problem with some + DVD-writers, thanks to Arno Lehmann for reporting this, and providing the + way to fix it. + - new scripts/dvd-handler. Note: it also needs a patched version of dvd+rw-tools. + - new scripts/dvd-freespace. Note: it needs a patched version of dvd+rw-tools. + - dvd.c:dvd_write_part: Don't write empty part. (Fix 4GB crossing bug reported by Arno Lehmann) +14Oct05 + - dvd.c:dvd_write_part: Use part_size and not max_part_size when setting write timeout. + - dvd.c:do_mount_dev: When checking if the DVD is mounted, do not count ., .. and .keep (needed on Gentoo). +15Aug05 + - Convert dvd-writepart to Python. + - Increase delay from 3 seconds to 5 seconds between SIGTERM and SIGKILL when + killing external programs. +13Aug05 + - Add gettext macros in autoconf/gettext-macros. + - Modify how localedir is set in configure.in. + - Remove setlocale check (useless). +10Aug05 + - Mark translatable strings in all source files. +08Aug05 + - Create French and Italian translation files (fr.po, it.po). + - Add support for translation in configure and Makefiles. + - Update autoconf/aclocal.m4 so it is automatically created with aclocal + (Note: autoconf/gnome-macros is not used anymore, it may be removed). +30Jul05 + - Fix src/lib/bpipe.c:run_program and run_program_full_output to detect if the watchdog + killed the program, and return an error if it is the case. +26Apr05 + - Modify parse_config to get a LEX_ERROR_HANDLER as a parameter + - lex_open_file now returns NULL if the file can't be opened. All calling functions have + been adapted. + - Remove set_exit_on_error function +07Apr05 + - Fix "unknown device type" problem with DVD devices. + - Fix crash when there is no media in the DVD drive. +09Jan05 + - Update the documentation and ReleaseNotes. +05Jan05 + - Add FreeSpaceCommand in Device (SD configuration file) and implement it. + - Some modifications (again) on how guessed volume names are handled (now it should work). + - Part files on the hard disk are removed if they are empty. +04Jan05 + - Major fixes on how guessed volume names are handled. + - Minor fix in src/stored/append.c. + - Replace, when possible, POOLMEM by POOL_MEM in the new code of src/stored/dev.c. + - New script, scripts/dvd-freespace, which gets the free space available on a writable DVD. +03Jan05 + - Add WritePartAfterJob directive in Job resource (Director) + - Add WritePartAfterJob directive in Schedule Resource (Director) + - Implement these new directives +02Jan05 + - New function, open_guess_name_dev in src/stored/dev.c, which tries to guess the volume + name of a mounted device, so the label can be read. + - New script, scripts/dvd-writepart, which write parts to DVD+/-R(W). + - Removed WriteFirstPartCommand directive in Device (SD configuration file). + - Use readdir_r instead of readdir (src/stored/dev.c:open_guess_name_dev). +01Jan05 + - Add RequiresMount, MountPoint, MountCommand, UnmountCommand directives in Device (SD configuration file). + - Implement these directives (volumes can now be restored from a manually written DVD). + - Add WriteFirstPartCommand, WritePartCommand directives in Device (SD configuration file). + - Implement these directives (DVD writing now works). + - New function run_program_full_output in src/lib/bpipe.c. + - Lots of bugfixes and cleanups in the new code. +29Dec04 + - Add VolParts field in Media table + - Add MaximumPartSize directive in Device (SD configuration file) + - File Volumes can now be splitted in multiple files ("parts") + - Fix SQL error in sql_list while doing "llist jobmedia" diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index aa551c3db7..221b44e242 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,33 +1,31 @@ - Release Notes for Bacula 1.37.40 + Release Notes for Bacula 1.38.0 - Bacula code: Total files = 420 Total lines = 138,212 (*.h *.c *.in) + Bacula code: Total files = 420 Total lines = 138,440 (*.h *.c *.in) + 20,440 additional lines of code since version 1.36.3 Major Changes: - Fixed out of order Volumes in restore. - Improved algorithm for reserving drives in multiple drive - autochangers. + autochangers. Autochange users MUST use the new Autochanger + resource in the Storage daemon. - There is a new database format that is not compatible with previous databases. You must upgrade if converting from 1.36.x. No changes from version 1.37.30. - The Director, Storage daemon, and File daemons are - Deamons are not compatible with prior versions. + Deamons are not compatible with prior versions. All FDs must be upgraded at the same time. -- Multiple drive autochanger support. You *must* update - your SD conf file. - Support for ANSI/IBM labels. -- New communications protocol between DIR and SD to reserve - drives. - Faster database inserts due to combining the MD5/SHA1 into the attributes record, eliminating one INSERT/file backed up. - Python Event support has been added. See below for - configuration and details. Unfortunately, it is not yet complete - and the only really useful function is defining a new - Volume name. -- DVD writing support, using parts, and a lot of new directives in + configuration and details. The implementation is somewhat minimal, + so the functionality is not complete. The Python interface + has not been extensively tested, so please consider it BETA. +- DVD writing support, using parts, and some new directives in the Device resource of the Storage configuration file thanks to Nicolas Boichat. Please note that this code is still - experimental and should be carefully tested before using in + BETA and should be carefully tested before using in production. - Seven new options keywords in a FileSet resource: ignorecase, fstype, hfsplussupport, wilddir, wildfile, regexdir, @@ -36,7 +34,7 @@ Major Changes: records have been removed from the catalog. - Restore of a directory (non-recursive, i.e. only one level). - Support for TLS (ssl) between all the daemon connections thanks - to Landon Fuller. This is mostly untested. + to Landon Fuller. - Any Volume in the Pool named Scratch may be reassigned to any other Pool when a new Volume is needed. - You may clone a Job and thus write (almost) the same data @@ -50,11 +48,10 @@ Major Changes: turn on VSS with "Enable VSS = yes" in your FileSet resource. - New manual format with an index (thanks to Karl Cunningham). - New Web site format (thanks to Michael Scherer). -- SQLite3 support, but it seems to run at 1/2 to 1/4 the speed of - SQLite2. +- SQLite3 support. - Web-bacula, previously a separate project by Juan Luis Frances, - is now included in the Bacula GUI release (yet to be fully - created). + is now included in the Bacula GUI release. This is a management + level tool for reporting the state of Bacula jobs. - The code is now Internationalized so that it can be localized in native languages. Thanks to Nicolas Boichat. @@ -76,7 +73,7 @@ New Directives: and differential jobs. The since=... is ignored when level=Full. A cloned job will not start additional clones, so it is not possible to recurse. -- New Options keywords in a FileSet directive: +- New Options keywords in a FileSet directive (backported to 1.36.3): - WildDir xxx Will do a wild card match against directories (files will not be matched). @@ -164,7 +161,7 @@ New configure options: required only if you do not want the default /usr/share. Items to note!!! -- If you use an Autochanger, you *must* update your SD conf file +- If you use an Autochanger, you MUST update your SD conf file to use the new Autochanger resource. Otherwise, certain commands such as "update slots" may not work. - You must add --with-python=[DIR] to the configure command line @@ -185,13 +182,14 @@ Items to note!!! Other Items: - Security fixes for temp files created in mtx-changer, during ./configure, and during making of Rescue disk. -- 2 new scripts, dvd-writepart and dvd-freespace, in the scripts directory, - which are designed to be used as parameters to Write Part Command and +- A new script, dvd-handler, in the scripts directory, + which is designed to be used as parameters to Write Part Command and Free Space Command. They need the dvd+rw-tools to be installed - (http://fy.chalmers.se/~appro/linux/DVD+RW/). + (http://fy.chalmers.se/~appro/linux/DVD+RW/) AND, the growisofs + program must be patched using the + /patches/dvd+rw-tools-5.21.4.10.8.bacula.patch You must have Python installed to run the scripts. - Part files support: File volumes can now be split into multiple files, called "parts". - - For the details of the Python scripting support, please see the new Python Scripting chapter in the manual. diff --git a/bacula/kes-1.37 b/bacula/kes-1.37 index ada17fb19a..6a7697f74c 100644 --- a/bacula/kes-1.37 +++ b/bacula/kes-1.37 @@ -5,6 +5,10 @@ General: Changes to 1.37.42: 26Oct05 +- Return HARDEOF status from bnet_recv() if bsock NULL rather + than aborting. +- Don't overwrite pthreadVCE.dll or msvcr71.dll during Win32 + install. - Update README.win32 instructions. 25Oct05 - Make db_get_job_record() return Name so that the ACL @@ -1402,104 +1406,3 @@ Changes to 1.37.2: - Make built-in variables table driven. - First cut of Python Events for Bacula. Director only. StartJob, EndJob, NewVolume events. - -Version 1.36.1 Released 26Nov04: -24Nov04 -- Take Dan's fix to the fix_postgresql_tables (thanks Dan) -- Increase Maximum Concurrent Jobs to 20 in SD and FD! -- Fix improper handling of autochanger Volumes that are not - marked InChanger. Bug 170. -22Nov04 -- Update authentication failure message to indicate possible - problem with Maximum Concurrent Jobs. Add to doc too. -- Commit PostgreSQL BIGINT fix -- apparently some people didn't - get it. -- Do not use a slot unless it is InChanger in the autochanger - code, otherwise autochanger gets upset not finding the Volume. - Bug 170 (need fix above too). -21Nov04 -- Make authentication timeout compile time configurable. - The value is set in src/baconfig.h -- Fix removing items from watchdog queue, which apparently - screwed up if there was more than one item. -- Rework mediaformat part of manual to separate out old - tape format for easier reading. -- Add a lot of debug code to the authentication code. -- Add seconds to the start/end times printed in the job report. -19Nov04 -- Fix mutex deadlock in dequeue of messages. -- Add debug code to FD authorization. -18Nov04 -- Increase authentication timeouts to 10 minutes. -15Nov04 -- Fix cancel bug in FD on /lib/tls with zero pid in - pthread_kill. -- Add date/time to all messages. -- Make Qmsg use time message was queued rather than time - printed. -- Indent job output two spaces. -13Nov04 -- Fix web page links for new manual. -- Grant postgresql permission to cdimages. -- Correct crash after "list nextvol" "list media" bug 160 -12Nov04 -- Fix scripts/Makefile.in missing ;\ -- thanks Martin -- A bit of work on btape to keep if from going into infinite - loops when things do not work well, and to print a bit - better info. -11Nov04 -- JobDefs Storage resource completely overrode anything - specified in Job resource -- bug 159 -- fixed. -- Fix syntax of renaming postgresql per Dan. -- Add working_directory to be /tmp for wx_console. -10Nov04 -- Allow both a JobId and a filename or list of files to be - specified on a restore command line. -- Save old mtx-changer before installing new one: bug 156 -- Fix errors in CDROM file pointed out by Scott. -09Nov04 -- Fix exepath when Bacula executed without path. -- Move test for socket libraries for Solaris in configure.in - before tcp wrapper tests so that linking works. -- Add "make copy-static-fd" to makefile in CDROM file to - copy existing static fd to CDROM rather than building it. -08Nov04 -- More doc updates -- Fix ps command for OpenBSD -- Rework the creation of indexes for SQL -- fall back - to the old code, but document what can be added. -06Nov04 -- Add new Daemon message handler in default DIR conf. -05Nov04 -- Fix Seg Fault with -D100 in bpipe.c. -- Fix Seg Fault in run specifying a JobId. -- Make mail from daemon with a Messages Resource use - the MailCommand with editing rather than the default - sendmail. -- Replace Jmsg in dispatch_message() with Qmsg. -- Make edit_job_codes handle NULL jcr. -04Nov04 -- Add M_ALERT class and put tape alerts into it. -- Fix Verify count vs found by not double counting files - that are split across files/Volumes. -30Oct04 -- Fix count returned from write_bsr_file() to handle multiple - volumes. This fixes most cases of the Verify VolumeToCatalog. -- Cleanup a bit the make clean for the rescue cdrom and remove - unneeded files from the CVS. -28Oct04 -- Fixed acquiring a tape so that it does not block all acquires - when operator intervention is needed. -- Platform build script updates from Scott -- Doc updates -- Add patch to force Linux LD_ASSUME_KERNEL to avoid using the - new /lib/tls. This is done in the startup scripts. -- Modify mtx-changer so that it checks for ONLINE while - waiting. -- Modify make_postgresql_tables.in so that EndBlock is stored - as a bigint. Prevents job failures when a disk volume is - larger than 2GB. -24Oct04 -- Add grep ONLINE to wait_for_drive() in mtx-changer.in -- More doc. -- Rebuild Scott's new configure diff --git a/bacula/src/lib/alist.c b/bacula/src/lib/alist.c index 53275832b1..bf12f3439b 100644 --- a/bacula/src/lib/alist.c +++ b/bacula/src/lib/alist.c @@ -3,7 +3,7 @@ * * alist is a simple malloc'ed array of pointers. For the moment, * it simply malloc's a bigger array controlled by num_grow. - * Default is to realloc the pointer array for each new member. + * Default is to realloc the pointer array for each new member. * * Kern Sibbald, June MMIII * @@ -11,22 +11,17 @@ * */ /* - Copyright (C) 2000-2004 Kern Sibbald and John Walker + Copyright (C) 2003-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. 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. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ @@ -40,7 +35,7 @@ void alist::grow_list() { if (num_items == 0) { if (num_grow == 0) { - num_grow = 1; /* default if not initialized */ + num_grow = 1; /* default if not initialized */ } items = (void **)malloc(num_grow * sizeof(void *)); max_items = num_grow; @@ -143,10 +138,10 @@ void alist::destroy() { if (items) { if (own_items) { - for (int i=0; ifirst(); (var); (void *(var))=(list)->next(var)); ) + for(((void*)(var))=(list)->first(); (var); ((void*)(var))=(list)->next(var)); ) #endif diff --git a/bacula/src/lib/bnet.c b/bacula/src/lib/bnet.c index 23a9953511..3f850d1d05 100644 --- a/bacula/src/lib/bnet.c +++ b/bacula/src/lib/bnet.c @@ -178,7 +178,9 @@ int32_t bnet_recv(BSOCK * bsock) int32_t nbytes; int32_t pktsiz; - ASSERT(bsock != NULL); + if (!bsock) { + return BNET_HARDEOF; + } bsock->msg[0] = 0; bsock->msglen = 0; if (bsock->errors || bsock->terminated) { diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index acb1f176b3..50fef64521 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -303,9 +303,9 @@ static bool use_storage_cmd(JCR *jcr) * If there are multiple devices, the director sends us * use_device for each device that it wants to use. */ - Dmsg1(100, "msg); jcr->dirstore = New(alist(10, not_owned_by_alist)); do { + Dmsg1(100, "msg); ok = sscanf(dir->msg, use_storage, store_name.c_str(), media_type.c_str(), pool_name.c_str(), pool_type.c_str(), &append, &Copy, &Stripe) == 7; @@ -328,6 +328,7 @@ static bool use_storage_cmd(JCR *jcr) /* Now get all devices */ while (bnet_recv(dir) >= 0) { + Dmsg1(100, "msg); ok = sscanf(dir->msg, use_device, dev_name.c_str()) == 1; if (!ok) { break; diff --git a/bacula/src/win32/winbacula.nsi.in b/bacula/src/win32/winbacula.nsi.in index 75a3063fb5..617e5b3e75 100755 --- a/bacula/src/win32/winbacula.nsi.in +++ b/bacula/src/win32/winbacula.nsi.in @@ -93,7 +93,7 @@ Section "Bacula File Service" SecService ; Shutdown any bacula that could be running ExecWait '"$INSTDIR\bin\bacula-fd.exe" /kill' ; give it some time to shutdown - Sleep 1000 + Sleep 3000 NoUpgrade: ; Set output path to the installation directory. @@ -167,6 +167,7 @@ Section "Bacula File Service" SecService StrCmp $R0 "false" do_win98 MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to start the Bacula Client now?" IDNO SetPerms Exec 'net start bacula' + Sleep 3000 SetPerms: ; set default permissions on config file so it's not world readable Exec 'cmd /C echo Y|cacls "$INSTDIR\bin\bacula-fd.conf" /G SYSTEM:F Administrators:F' @@ -177,14 +178,19 @@ Section "Bacula File Service" SecService MessageBox MB_YESNO|MB_ICONQUESTION "Would you like to start the Bacula Client now?" IDNO NoStart Start: Exec '"$INSTDIR\bin\bacula-fd.exe" -c "$INSTDIR\bin\bacula-fd.conf"' + Sleep 3000 NoStart: SectionEnd Section "Install Console" SecConsole SetOutPath "$INSTDIR\bin" File console\Release\bconsole.exe + IfFileExists "$INSTDIR\bin\pthreadVCE.dll" msvcr711 File ..\..\..\depkgs-win32\pthreads\pthreadVCE.dll + msvcr711: + IfFileExists "$INSTDIR\bin\msvcr71.dll" testconf1 File c:\windows\system32\msvcr71.dll + testconf1: IfFileExists "$INSTDIR\bin\bconsole.conf" newconf File console\bconsole.conf goto do_next @@ -203,8 +209,12 @@ SectionEnd Section "Install wx-Console" SecWxConsole SetOutPath "$INSTDIR\bin" File wx-console\Release\wx-console.exe + IfFileExists "$INSTDIR\bin\pthreadVCE.dll" msvcr712 File ..\..\..\depkgs-win32\pthreads\pthreadVCE.dll + msvcr712: + IfFileExists "$INSTDIR\bin\msvcr71.dll" testconf2 File c:\windows\system32\msvcr71.dll + testconf2: IfFileExists "$INSTDIR\bin\wx-console.conf" newconf File wx-console\wx-console.conf goto do_next