From a16ef40c820faeb2ab23edacf5f01a9639f60050 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 7 Apr 2006 08:22:17 +0000 Subject: [PATCH] - Remove timed wait for VSS on Win2K3 as it is not yet implemented. - Correct bacula.in script to reference bacula-ctl-xx in the sysconfig directory rather than the bin directory. 26Mar06 - Fix a long standing bug in the bacula start/stop scripts. - Attempt to add the new bacula-ctl-* files to the rpm. - Switch to using typeof() for list traversing to avoid as many FC5 g++ compiler warnings as possible. 25Mar06 - Split the bacula start/start script into four files: bacula -- starts and stops calling other scripts bacula-ctl-dir -- starts/stops the director bacula-ctl-fd -- starts/stops the File daemon bacula-ctl-sd -- starts/stops the Storage daemon git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2884 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 224 +++++++++++++++--- bacula/ReleaseNotes | 52 +++- bacula/kes-1.38 | 15 ++ bacula/kes-1.39 | 15 ++ bacula/patches/1.38.6-script.patch | 63 +++++ bacula/platforms/mandrake/bacula.spec.in | 103 ++++++-- bacula/platforms/redhat/bacula.spec.in | 103 ++++++-- bacula/platforms/suse/bacula.spec.in | 103 ++++++-- bacula/scripts/bacula-ctl-dir.in | 12 +- bacula/scripts/bacula-ctl-fd.in | 12 +- bacula/scripts/bacula-ctl-sd.in | 12 +- bacula/scripts/bacula.in | 23 +- bacula/src/dird/migrate.c | 2 +- .../gnome2-console/test-gnome-console.conf | 2 +- bacula/src/lib/alist.h | 9 +- bacula/src/lib/dlist.h | 11 +- bacula/src/lib/parse_conf.h | 30 +-- bacula/src/lib/protos.h | 17 +- bacula/src/stored/acquire.c | 2 + bacula/src/win32/compat/vss_generic.cpp | 9 +- 20 files changed, 645 insertions(+), 174 deletions(-) create mode 100644 bacula/patches/1.38.6-script.patch diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 5825c672d3..ccb15454ed 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,5 +1,155 @@ -Release 1.38.4 16Jan06 released 17 Jan 06: +Release 1.38.6 (28Mar06) released 29Mar06 +28Mar06 +- Back port from 1.39 fixes to lib/jcr.c to use foreach_jcr() + and new jcr chain locking. +26Mar06 +- Fix a long standing bug in the bacula start/stop scripts. +- Attempt to add the new bacula-ctl-* files to the rpm. +- Switch to using typeof() for list traversing to avoid + as many FC5 g++ compiler warnings as possible. +25Mar06 +- Split the bacula start/start script into four files: + bacula -- starts and stops calling other scripts + bacula-ctl-dir -- starts/stops the director + bacula-ctl-fd -- starts/stops the File daemon + bacula-ctl-sd -- starts/stops the Storage daemon +24Mar06 +- Create datestyle fix for PostgreSQL. Fixes bug #574. +- Correct editing of JobId from int to int64 in fd_cmds.c +- Eliminate FileSet name race with bash_spaces() and multiple + threads by bashing in a local. +- Fix error return from 'use storage' to print a correct error + message rather than nothing. +- Correct false re-read last block error message when two jobs + are simultaneously writing at the end of a tape. +- Simplify exit conditions in the reserve.c code to avoid + possible non-release of reservation_lock(). +- Suffle lock order in reserve to avoid deadlock between + reservation lock and device mutex. +- Add Thorsten's VSS timeout code to 1.38 branch. +21Mar06 +- Initialize jcr mutex before first use. Thanks to Thorsten for + tracking this down for me !!!! as it broke the Win32 build. +20Mar06 +- Integrate addition of line count limitation to bsmtp -l from + Sebastian Stark +17Mar06 +- Implement regex test program in tools directory. +- Attempt to fix time problem with bsmtp with foreign langs. +- Add strip_trailing_newline() submitted by user. + +Release 1.38.6 beta6 +16Mar06 +- Fix bug #537 to allow arbitrary time to mount a volume for + restore, if polling is turned on. +- Disallow multiple storage specifications for a job. Should fix Arno's + problem. +- Add back a missing store of poolid in jr.poolid. +- If dir_user or dir-group is specified in ./configure apply it to + the working-dir. Fixes bug #533. +- If rescheduling a job cancel the previous incarnation with the SD. + Fixes bugs #566 and 557. +- Fix bug #567 do_message() definition type conflict. + +Release 1.38.6 beta5 +14Mar06 +- Add more jcr methods and make mutex and use_count private. +- Create lock/unlock methods for jcr. +- Fix PostgreSQL bug doing sql_data_seeek() by explicitly reading + records to get to seek position. +- Integrate patch from bug #561 to correct conio.c signal definitions. +- Fix Rescheduling failed Jobs. Ensure that SD message thread + terminates correctly by doing pthread_kill(). Do not destroy + SD cond wait variable between executions of the job. Use local + mutex for cond variable to avoid blocking jcr chain. Fix poor + use of jcr use count in jobq.c for restarted jobs. +- Fix obsolete usage of foreach_dlist() to use foreach_jcr() in + lib/jcr.c -- prevents locking the jcr chaing. +- Apply patch from bug #564, which corrects listing volumes with + multiple autochangers. Apply same fix to next volume list. +- Fix bug #562 where restore bootstrap file is not unique. +- Use new routine lock_reservations() to lock the reservations + system, and call it while looking for a volume in askdir.c. + This could possibly fix bug #543. +- Stop SD command loop if job is canceled. + +Beta4 attached to a bug report but not distributed. +04Mar06 +- Fix new sql_use_result() code to properly release the + buffers in all cases. +- Convert to using new Python class definitons with (object). +- Use the keyword ujobid to mean the unique job id; job or jobname + to mean the Job name given on the Name directive, and jobid to + be the numeric (non-unique) job id. +- Allow listing by any of the above. +- Add the user friendly job report code for reporting job elapsed time + and rates with suffexes. +- Add Priority and JobLevel as Python settable items. +- Use TEMPORARY table creation where the table is created by + Bacula. +- Add new code submitted by Eric for waiting on specific jobid. +- Add ACL checking for the dot commands. +- Fix restore of writable FIFOs. +- Fix a bug in bpipe where the string was freed too early. + +26Feb06 +- Fix bug reported by Arno listing blocks with bls +- Update the po files at Eric's request. + +Release 1.38.6-beta2 25Feb06 +25Feb06 +- Add sql_use_result() define. + +Release 1.38.6 beta1 24Feb06 +24Feb06 +- Don't open default catalog if not in ACL. +22Feb06 +- Add virtual disk autochanger code. +- Add user supplied bug fix to make two autochangers work + correctly using StorageId with InChanger checks. +- Correct new/old_jcr confusion in copy_storage(). +- Remove & from Job during scan in msgchan.c -- probably + trashed the stack. +- When getting the next Volume if no Volume in Append mode + exists and we are dealing with an Autochanger, search + for a Scratch Volume. +- Check for missing value in dot commands -- bug fix. +- Fix bug in update barcodes command line scanning. +- Make sure Pool Max Vols is respected. +- Check that user supplied a value before referencing + it in restore -- pointed out by Karl Hakimian. +- Add Karl Hakimian's table insert code. +- Don't ask user to select a specific Volume when + updating all volumes in a Pool. +- Remove reservation if set for read when removing dcr. +- Lock code that requests next appendable volume so that + two jobs to get the same Volume at the same time. +- Add new Device Type = xxx code. Values are file, tape, + dvd, and fifo. +- Preserve certain modes (ST_LABEL|ST_APPEND|ST_READ) across + a re-open to change read/write permission on a device. +- Correct a misplaced double quote in certain autochanger + scripts. +- Make make_catalog_backup.in a bit more portable. +- Implement Karl Hakimian's sql_use_result(), which speeds + up restore tree building and reduces the memory load. +- Correct a number of minor bugs in getting a Volume from + the Scratch Pool. +- Implement additional command line options for update Volume. +- Don't require user to enter a Volume name when updating + all Volumes in a pool. + +Release 1.38.5 released 19Jan06: +19Jan06 +- Apply label barcodes fix supplied by Rudolf Cejka. +18Jan06 +- Modify standard rpm installation to set SD group to disk + so that SD will by default have access to tape drives. +- Allow users to specify user/group and start options + for each daemon in /etc/sysconf/bacula file. + +Release 1.38.4 14Jan06 released 17 Jan 06: 16Jan06 - Add two new queries to query.sql provided by Arno. One list volumes known to the Storage device, and the other @@ -71,7 +221,7 @@ Beta release 23Dec05: volume so that it can handle multiple returns from the wait code. - Modify the wait code to permit multiple returns. -- Return a zero when "autochanger drives" is called and +- Return a zero when 'autochanger drives' is called and it is not an autochanger. - Make rewind_dev() a method taking a DCR as an argument. This permits closing and reopening the drive if the @@ -183,9 +333,9 @@ Beta release 20Dec05: 04Dec05 - Apply days keyword patch from Alexander.Bergolth at wu-wien.ac.at If this patch is applied, the number of days can be specified with - "list nextvol days=xx" + 'list nextvol days=xx' or - "status dir days=xx" + 'status dir days=xx' My use case is to be able to preview the next scheduled job (and the next tape to be used) on fridays if there are no scheduled jobs during the weekend. @@ -237,7 +387,7 @@ Changes to 1.38.1: 15 November 2005 the user. - Add Solaris ACL detection in configure.in as supplied by Attila Fulop. -- Implement "autochanger drives" protocol so that Dir knows +- Implement 'autochanger drives' protocol so that Dir knows how many drives an autochanger has. - Do not request drive number in label, ... if only one drive. - Turn off debug code. @@ -411,7 +561,7 @@ Changes to 1.37.39: - Make new_volume walk through all Vols looking for dev to release. 16Sep05 -- Make "quit" command in console always allowed. +- Make 'quit' command in console always allowed. - Remove the storage list between each console command to keep Dir from remembering a previously selected SD. - Add code to reservation VOLRES subroutines to try to ensure @@ -422,7 +572,7 @@ Changes to 1.37.39: - Apply Nicolas' dvd-freespace.in patch. - Make sure SQL table names are not translated. - Eliminate incorrect message saying barcodes not - found in "label barcodes" -- fixes bug report. + found in 'label barcodes' -- fixes bug report. Changes to 1.37.38: 07Sep05 @@ -447,7 +597,7 @@ Changes to 1.37.37: - Correct ssize_t problem in build of Win32 - Add code to llprint pools and volumes to debug next item. - From bug report, fix resetting Pool defaults in Volume. It - was a typo "Max" was missing in several places. + was a typo 'Max' was missing in several places. - Don't allow translation of database Volume Status values. Changes to 1.37.37 released 26 Aug 05 @@ -484,7 +634,7 @@ Changes to 1.37.36 released 22 Aug 05 other searches. - Fix picking up drive in Dir so that it is not done in the status command. -- Eliminate double check on "loaded" for autochanger. +- Eliminate double check on 'loaded' for autochanger. 17Aug05 - Start coding better reservation algorithm - Always look for slot for label command. @@ -543,7 +693,7 @@ Changes to 1.37.34: search to avoid two threads competing for the same resource. - Correct a return code in find_suitable_device_for_job() - Possibly cause of "busy writing to another volume". + Possibly cause of 'busy writing to another volume'. 03Aug05 - Modify open() for tape so nonblocking really works. - Use fcntl() to reset blocking status rather than close() @@ -672,7 +822,7 @@ Changes to 1.37.31: been adapted. - Remove set_exit_on_error function 07Apr05 - - Fix "unknown device type" problem with DVD devices. + - 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. @@ -705,12 +855,12 @@ Changes to 1.37.31: 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" + - File Volumes can now be splitted in multiple files ('parts') + - Fix SQL error in sql_list while doing 'llist jobmedia' Changes to 1.37.30 released 16 July 2005: 14Jul05 -- Fix "dir" command scanning field misalignment in +- Fix 'dir' command scanning field misalignment in wx-console. - Switch to using the wxWidgets Unicode library. - Include msvcr71.dll in distribution. @@ -790,7 +940,7 @@ Changes to 1.37.28: file sizes for restore and dir of catalog, otherwise GB sizes are truncated -- fixes bug report. - Modify wx-console to know about 10 character widths. -- Allow decending into top level directory if "recurse=no" +- Allow decending into top level directory if 'recurse=no' is set. Fixes a bug report. - Install pthreadVCE.dll when installing console or wx-console on Win32 systems. Fixes bug report. @@ -808,12 +958,12 @@ Changes to 1.37.28: 30Jun05 - Detect device mounted for DVD and suppress be sure to mount message after label. -- Set Cleaning tape status to "Cleaning" and force no +- Set Cleaning tape status to 'Cleaning' and force no MediaType. - Get DVD writing working with new standard Bacula open() code. - Rename get_filename() to make more sense. -- Detect "is already mounted on" on mount command so to avoid +- Detect 'is already mounted on' on mount command so to avoid error if device is already mounted. - Eliminated guess_name() code. It may be necessary to add it back later. @@ -904,7 +1054,7 @@ Changes from Nicolas Boichat: been adapted. - Remove set_exit_on_error function 07Apr05 - - Fix "unknown device type" problem with DVD devices. + - 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. @@ -937,8 +1087,8 @@ Changes from Nicolas Boichat: 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" + - File Volumes can now be splitted in multiple files ('parts') + - Fix SQL error in sql_list while doing 'llist jobmedia' Changes to 1.37.23: - Renamed to make unique version for open_next_part() @@ -1038,7 +1188,7 @@ Changes to 1.37.19: - Make restore.bsr have unique name. - Allow user to define bsr filename on restore command line with bootstrap=xxx.bsr -- Add limit=nnn to "list jobs" command. +- Add limit=nnn to 'list jobs' command. - Remove old restore code that did not use .bsr file. - unlink automatically generated bsr file. - Cleanup heartbeat code so that duped fd is almost sure @@ -1178,7 +1328,7 @@ Changes to 1.37.14: by a user. 26Apr05 - Apply Tru64 patch supplied by Pascal Pederiva -- Apply Unicode fixes for Win32 from "Thorsten Engel" +- Apply Unicode fixes for Win32 from 'Thorsten Engel' - More work on Python read feature in FD. 22Apr05 @@ -1346,21 +1496,21 @@ Changes to 1.37.6: - Fix scanf of PoolId in catreq to handle 64 bit Ids. 10Mar05 - Add new ua_update.c file and move update_cmd there. -- Modify "update slots" to obtain actual number of slots. +- Modify 'update slots' to obtain actual number of slots. - Tweak autochanger code to handle new slots request. - Modify autochanger code to lock/unlock around slots and update slots code. 09Mar05 - Patch the FD so that it does not issue an error message if it attempts to restore the permissions on a Win32 drive. -- Edit "Resource-name" (physical-name) for the device name +- Edit 'Resource-name' (physical-name) for the device name everywhere in the SD. - Remove .linked.tex files in preparation for cutover to using .tex in place of .wml. 08Mar05 - Copy latest config.sub and config.guess from autoconf. - Try new way of identifying drives with: - "resource-name" (physical-name) + 'resource-name' (physical-name) More work need to a complete conversion. 07Mar05 - Rework some of the autochanger data so that the DIR has @@ -1375,7 +1525,7 @@ Changes to 1.37.6: - Force all the Media Type records of all devices in an Autochanger to be the same. 06Mar05 -- Add new "run" command to Job resource in DIR. This permits +- Add new 'run' command to Job resource in DIR. This permits cloning a job as many times as you want. - Pass PoolId to SD on Query request. It is now used in the Find_media catalog request. @@ -1441,7 +1591,7 @@ Changes to 1.37.4: attempt to fix a bug report. 23Feb05 - Corrected SunOs to SunOS in btraceback (user submitted). -- Applied patch from Roger Haa¥kansson +- Applied patch from Roger Haakansson to warn the user of defective AWKs during ./configure. 20Feb05 - Add some changes submitted by a user for HP client build. @@ -1496,7 +1646,7 @@ Changes to 1.37.3: 15Feb05 - Fix Media LabelDate and FirstWritten to be correctly set. - Fix deadlock in multiple simultaneous jobs. -- Fix tape "truncation"/"number of files" after restore bug. +- Fix tape 'truncation'/'number of files' after restore bug. 10Feb05 - Ensure that correct error messages are returned when reading an ANSI label. @@ -1552,7 +1702,7 @@ Changes to 1.37.3: boot correctly. - Implement ANSI labels -- not yet tested. This required changes to DB format. No upgrade script yet. - Note, more work needed to modify "update" command to handle + Note, more work needed to modify 'update' command to handle changing label types, also must restrict volume name lengths to 6 characters. - Add new Device, Storage, and MediaType records to DB. No @@ -1568,7 +1718,7 @@ Changes to 1.37.3: a single alist, and imply sending data to each Storage daemon simultaneously. - Implement Device query command between DIR and SD. -- Allow DIR to "reserve" a Device. It will then be acquired +- Allow DIR to 'reserve' a Device. It will then be acquired when the FD connects to the SD. - Turn all DIR resources into classes, and implement a few class methods -- more to come. @@ -1698,7 +1848,7 @@ Changes to 1.37.2: - Remove duplicate code from chksum.h (mentioned by Preben). 13Dec04 - Integrate Tim Oberfoell patch to ACLs - to handle both the "standard" and "default" ACLs. + to handle both the 'standard' and 'default' ACLs. 12Dec04 - Integrated Preben 'Peppe' Guldberg three cleanup patches (btest, verify, find). @@ -1751,7 +1901,7 @@ Changes to 1.37.2: - Add python 2.3 to config search list (user submitted patch) - Add JobStatus to Python variables. 28Nov04 -- Add "python restart" command in Console. +- Add 'python restart' command in Console. - Make built-in variables table driven. - First cut of Python Events for Bacula. Director only. StartJob, EndJob, NewVolume events. @@ -1768,7 +1918,7 @@ Changes to 1.37.*: 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"). + (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). @@ -1782,7 +1932,7 @@ Changes to 1.37.*: 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 + - 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. @@ -1815,7 +1965,7 @@ Changes to 1.37.*: been adapted. - Remove set_exit_on_error function 07Apr05 - - Fix "unknown device type" problem with DVD devices. + - 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. @@ -1848,5 +1998,5 @@ Changes to 1.37.*: 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" + - 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 f83d2f3946..09a0a9ca77 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,10 +1,16 @@ - Release Notes for Bacula 1.38.6-beta6 + Release Notes for Bacula 1.38.7 Bacula code: Total files = 419 Total lines = 137,078 (*.h *.c *.in) 20,440 additional lines of code since version 1.36.3 !!!! Important !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + In Bacula version 1.38.5 and prior, there was apparently a + compiler bug that caused the Storage daemon to seg fault. + I have applied a workaround in version 1.38.6 and greater that + seems to work. If you experience problems, follow the instructions + below. + If you are compiling for a 64 bit machine, you need to ensure that the code is compiled with the -O0 (- oh zero) option otherwise the SD will crash on most all operations -- apparently due to @@ -36,6 +42,8 @@ New features: be started by the scheduler. If you disable a job and restart Bacula or reload the .conf file, the job will be re-enabled. - Add a new Job resource directive "enable = yes|no". +- There is a new program named regex in the tools directory that + allows you to try regular expressions on your system. Major bug fixes: - Fix race condition in multiple-drive autochangers where @@ -54,6 +62,48 @@ Major bug fixes: Minor bug fixes: - See below: +Release 1.38.6-1 (05Apr06) released +- Remove timed wait for VSS on Win2K3 as it is not yet + implemented. +- Correct bacula.in script to reference bacula-ctl-xx in the + sysconfig directory rather than the bin directory. + +Release 1.38.6 (28Mar06) released 29Mar06 +28Mar06 +- Back port from 1.39 fixes to lib/jcr.c to use foreach_jcr() + and new jcr chain locking. +26Mar06 +- Fix a long standing bug in the bacula start/stop scripts. +- Attempt to add the new bacula-ctl-* files to the rpm. +- Switch to using typeof() for list traversing to avoid + as many FC5 g++ compiler warnings as possible. +25Mar06 +- Split the bacula start/start script into four files: + bacula -- starts and stops calling other scripts + bacula-ctl-dir -- starts/stops the director + bacula-ctl-fd -- starts/stops the File daemon + bacula-ctl-sd -- starts/stops the Storage daemon +- Create datestyle fix for PostgreSQL. Fixes bug #574. +- Correct editing of JobId from int to int64 in fd_cmds.c +- Eliminate FileSet name race with bash_spaces() and multiple + threads by bashing in a local. +- Fix error return from 'use storage' to print a correct error + message rather than nothing. +- Correct false re-read last block error message when two jobs + are simultaneously writing at the end of a tape. +- Simplify exit conditions in the reserve.c code to avoid + possible non-release of reservation_lock(). +- Suffle lock order in reserve to avoid deadlock between + reservation lock and device mutex. +- Add Thorsten's VSS timeout code to 1.38 branch. +- Initialize jcr mutex before first use. Thanks to Thorsten for + tracking this down for me !!!! as it broke the Win32 build. +- Integrate addition of line count limitation to bsmtp -l from + Sebastian Stark +- Implement regex test program in tools directory. +- Attempt to fix time problem with bsmtp with foreign langs. +- Add strip_trailing_newline() submitted by user. + Release 1.38.6 beta6 16Mar06 - Fix bug #537 to allow arbitrary time to mount a volume for restore, if polling is turned on. diff --git a/bacula/kes-1.38 b/bacula/kes-1.38 index aec4edd730..5e38d64a0d 100644 --- a/bacula/kes-1.38 +++ b/bacula/kes-1.38 @@ -2,6 +2,21 @@ Kern Sibbald General: +Release 1.38.7 (06Apr06) released 07Apr06 +- Remove timed wait for VSS on Win2K3 as it is not yet + implemented. +- Correct bacula.in script to reference bacula-ctl-xx in the + sysconfig directory rather than the bin directory. + +Release 1.38.6 (28Mar06) released 29Mar06 +28Mar06 +- Back port from 1.39 fixes to lib/jcr.c to use foreach_jcr() + and new jcr chain locking. +26Mar06 +- Fix a long standing bug in the bacula start/stop scripts. +- Attempt to add the new bacula-ctl-* files to the rpm. +- Switch to using typeof() for list traversing to avoid + as many FC5 g++ compiler warnings as possible. 25Mar06 - Split the bacula start/start script into four files: bacula -- starts and stops calling other scripts diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 index 75959fe56f..f751dd15ee 100644 --- a/bacula/kes-1.39 +++ b/bacula/kes-1.39 @@ -2,6 +2,21 @@ Kern Sibbald General: +- Remove timed wait for VSS on Win2K3 as it is not yet + implemented. +- Correct bacula.in script to reference bacula-ctl-xx in the + sysconfig directory rather than the bin directory. +26Mar06 +- Fix a long standing bug in the bacula start/stop scripts. +- Attempt to add the new bacula-ctl-* files to the rpm. +- Switch to using typeof() for list traversing to avoid + as many FC5 g++ compiler warnings as possible. +25Mar06 +- Split the bacula start/start script into four files: + bacula -- starts and stops calling other scripts + bacula-ctl-dir -- starts/stops the director + bacula-ctl-fd -- starts/stops the File daemon + bacula-ctl-sd -- starts/stops the Storage daemon 24Mar06 - Create datestyle fix for PostgreSQL. Fixes bug #574. - Correct editing of JobId from int to int64 in fd_cmds.c diff --git a/bacula/patches/1.38.6-script.patch b/bacula/patches/1.38.6-script.patch new file mode 100644 index 0000000000..7bce5fdf33 --- /dev/null +++ b/bacula/patches/1.38.6-script.patch @@ -0,0 +1,63 @@ + + This patch fixes a bug in the bacula start/stop script where + the binary directory is used rather than the scripts directory. + Apply the patch to version 1.38.6 with: + + cd + patch -p0 <1.38.6-script.patch + make Makefiles + make install + ... + +Index: scripts/bacula.in +=================================================================== +RCS file: /cvsroot/bacula/bacula/scripts/bacula.in,v +retrieving revision 1.13.2.3 +diff -u -r1.13.2.3 bacula.in +--- scripts/bacula.in 28 Mar 2006 16:42:19 -0000 1.13.2.3 ++++ scripts/bacula.in 29 Mar 2006 16:24:51 -0000 +@@ -13,25 +13,22 @@ + # easier to "steal" this code for the development + # environment where they are different. + # +-BACFDBIN=@sbindir@ + BACFDCFG=@sysconfdir@ +-BACSDBIN=@sbindir@ + BACSDCFG=@sysconfdir@ +-BACDIRBIN=@sbindir@ + BACDIRCFG=@sysconfdir@ + + case "$1" in + start) +- [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd $1 $2 +- [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd $1 $2 +- [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir $1 $2 ++ [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2 ++ [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2 ++ [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2 + ;; + + stop) + # Stop the FD first so that SD will fail jobs and update catalog +- [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd $1 $2 +- [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd $1 $2 +- [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir $1 $2 ++ [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2 ++ [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2 ++ [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2 + echo + sleep 6 + ;; +@@ -42,9 +39,9 @@ + ;; + + status) +- [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd status +- [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd status +- [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir status ++ [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd status ++ [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd status ++ [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir status + ;; + + *) diff --git a/bacula/platforms/mandrake/bacula.spec.in b/bacula/platforms/mandrake/bacula.spec.in index f6a1730653..f0fa1a5dfa 100644 --- a/bacula/platforms/mandrake/bacula.spec.in +++ b/bacula/platforms/mandrake/bacula.spec.in @@ -5,7 +5,7 @@ # basic defines for every build %define depkgs ../depkgs -%define depkgs_version 22Jun05 +%define depkgs_version 28Mar06 %define sqlite_bindir /usr/lib/bacula/sqlite %define working_dir /var/bacula %define director_daemon_user bacula @@ -18,7 +18,8 @@ %define group_file /etc/group %define useradd /usr/sbin/useradd %define groupadd /usr/sbin/groupadd -%define _rescuever 1.8.2 +%define usermod /usr/sbin/usermod +%define _rescuever 1.8.3 # platform defines - set one below or define the build_xxx on the command line # RedHat builds @@ -121,7 +122,7 @@ exit 1 %define _dist %(grep -i SuSE /etc/SuSE-release) %endif %if %{mdk} -%define _dist %(grep Mandrake /etc/mandrake-release) +%define _dist %(grep Mand /etc/mandrake-release) %endif # Should we build gconsole, possible only if gnome >= 2.0 available @@ -130,6 +131,8 @@ exit 1 %else %define gconsole 1 %endif +# specifically disallow gconsole if desired +%{?nobuild_gconsole:%define gconsole 0} Summary: Bacula - The Network Backup Solution Name: bacula @@ -142,6 +145,8 @@ Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.t Source2: Release_Notes-%{version}-%{release}.tar.gz Source3:http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz Source4:http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz +Patch0: bacula-1.38.6-script.patch +Patch1: bacula-1.38.6-makefile.patch BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team @@ -152,19 +157,23 @@ Packager: D. Scott Barninger %define _rescuesrc ../%{name}-rescue-%{_rescuever} BuildRequires: atk-devel, ncurses-devel, pango-devel, perl -BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig +BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel BuildRequires: openssl-devel +%if %{gconsole} +BuildRequires: pkgconfig +%endif %if %{rh7} BuildRequires: libtermcap-devel BuildRequires: glibc-devel >= 2.2 -BuildRequires: ORBit-devel %endif %if %{su9} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su9} && %{gconsole} BuildRequires: libgnome >= 2.0 BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -176,10 +185,12 @@ BuildRequires: freetype2-devel %endif %if %{su10} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su10} && %{gconsole} BuildRequires: libgnome >= 2.12 BuildRequires: gtk2-devel >= 2.8 BuildRequires: libgnomeui-devel >= 2.12 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.10 @@ -194,24 +205,28 @@ BuildRequires: libpng-devel %endif %if %{mdk} BuildRequires: libtermcap-devel +BuildRequires: libstdc++-static-devel +BuildRequires: glibc-static-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{mdk} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui2-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: libORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo2_0-devel BuildRequires: libbonoboui2_0-devel BuildRequires: libbonobo-activation-devel BuildRequires: libGConf2-devel -BuildRequires: libstdc++-static-devel -BuildRequires: glibc-static-devel BuildRequires: freetype2-devel %endif %if %{fc3} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc3} && %{gconsole} BuildRequires: gtk2-devel >= 2.4 BuildRequires: libgnomeui-devel >= 2.8 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -222,9 +237,11 @@ BuildRequires: freetype-devel %endif %if %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.6 BuildRequires: libgnomeui-devel >= 2.10 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -235,9 +252,11 @@ BuildRequires: freetype-devel %endif %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -560,6 +579,9 @@ server packages. %setup -T -D -b 3 %setup -T -D -b 4 +%patch0 +%patch1 -p1 + %build %if %{su9} || %{su10} @@ -613,9 +635,9 @@ export LDFLAGS=-L/usr/lib64/mysql --with-scriptdir=/etc/bacula \ --enable-smartalloc \ --enable-client-only \ - %if %{mdk} - --disable-nls \ - %endif + %if %{mdk} + --disable-nls \ + %endif --enable-static-fd make @@ -715,6 +737,11 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql %endif +# fixme - make installs gconsole script for build without gconsole +%if ! %{gconsole} +rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +%endif + rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd # install the init scripts @@ -863,6 +890,10 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb %attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler @@ -934,7 +965,8 @@ if [ -s /etc/bacula/console.conf ];then cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf fi -# create the daemon user and group +# create the daemon users and groups +# first create the groups if they don't exist HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then %{groupadd} -r %{daemon_group} > /dev/null 2>&1 @@ -947,24 +979,41 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{storage_daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now create the users if they do not exist +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 echo "The user %{storage_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 echo "The user %{director_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary groups, this is ok to call even if the users already exist +# we only do this if the user is NOT root +IS_ROOT=%{director_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{director_daemon_user} -G %{daemon_group} +fi +IS_ROOT=%{storage_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group} +fi +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %if %{mysql} %post mysql @@ -1133,12 +1182,20 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary group, this is ok to call even if the user already exists +# we only do this if the user is NOT root +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %post client # add our link @@ -1239,6 +1296,10 @@ fi %endif %changelog +* Sun Apr 02 2006 D. Scott Barninger +- 1.38.6 release +- fix problem specifying more than one primary group for user bacula +- add build switch to not build gconsole regardless of platform * Sun Jan 29 2006 D. Scott Barninger - add centos3 build tag - fix link error of static-fd on Mandrake with --disable-nls diff --git a/bacula/platforms/redhat/bacula.spec.in b/bacula/platforms/redhat/bacula.spec.in index f6a1730653..f0fa1a5dfa 100644 --- a/bacula/platforms/redhat/bacula.spec.in +++ b/bacula/platforms/redhat/bacula.spec.in @@ -5,7 +5,7 @@ # basic defines for every build %define depkgs ../depkgs -%define depkgs_version 22Jun05 +%define depkgs_version 28Mar06 %define sqlite_bindir /usr/lib/bacula/sqlite %define working_dir /var/bacula %define director_daemon_user bacula @@ -18,7 +18,8 @@ %define group_file /etc/group %define useradd /usr/sbin/useradd %define groupadd /usr/sbin/groupadd -%define _rescuever 1.8.2 +%define usermod /usr/sbin/usermod +%define _rescuever 1.8.3 # platform defines - set one below or define the build_xxx on the command line # RedHat builds @@ -121,7 +122,7 @@ exit 1 %define _dist %(grep -i SuSE /etc/SuSE-release) %endif %if %{mdk} -%define _dist %(grep Mandrake /etc/mandrake-release) +%define _dist %(grep Mand /etc/mandrake-release) %endif # Should we build gconsole, possible only if gnome >= 2.0 available @@ -130,6 +131,8 @@ exit 1 %else %define gconsole 1 %endif +# specifically disallow gconsole if desired +%{?nobuild_gconsole:%define gconsole 0} Summary: Bacula - The Network Backup Solution Name: bacula @@ -142,6 +145,8 @@ Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.t Source2: Release_Notes-%{version}-%{release}.tar.gz Source3:http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz Source4:http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz +Patch0: bacula-1.38.6-script.patch +Patch1: bacula-1.38.6-makefile.patch BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team @@ -152,19 +157,23 @@ Packager: D. Scott Barninger %define _rescuesrc ../%{name}-rescue-%{_rescuever} BuildRequires: atk-devel, ncurses-devel, pango-devel, perl -BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig +BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel BuildRequires: openssl-devel +%if %{gconsole} +BuildRequires: pkgconfig +%endif %if %{rh7} BuildRequires: libtermcap-devel BuildRequires: glibc-devel >= 2.2 -BuildRequires: ORBit-devel %endif %if %{su9} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su9} && %{gconsole} BuildRequires: libgnome >= 2.0 BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -176,10 +185,12 @@ BuildRequires: freetype2-devel %endif %if %{su10} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su10} && %{gconsole} BuildRequires: libgnome >= 2.12 BuildRequires: gtk2-devel >= 2.8 BuildRequires: libgnomeui-devel >= 2.12 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.10 @@ -194,24 +205,28 @@ BuildRequires: libpng-devel %endif %if %{mdk} BuildRequires: libtermcap-devel +BuildRequires: libstdc++-static-devel +BuildRequires: glibc-static-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{mdk} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui2-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: libORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo2_0-devel BuildRequires: libbonoboui2_0-devel BuildRequires: libbonobo-activation-devel BuildRequires: libGConf2-devel -BuildRequires: libstdc++-static-devel -BuildRequires: glibc-static-devel BuildRequires: freetype2-devel %endif %if %{fc3} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc3} && %{gconsole} BuildRequires: gtk2-devel >= 2.4 BuildRequires: libgnomeui-devel >= 2.8 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -222,9 +237,11 @@ BuildRequires: freetype-devel %endif %if %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.6 BuildRequires: libgnomeui-devel >= 2.10 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -235,9 +252,11 @@ BuildRequires: freetype-devel %endif %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -560,6 +579,9 @@ server packages. %setup -T -D -b 3 %setup -T -D -b 4 +%patch0 +%patch1 -p1 + %build %if %{su9} || %{su10} @@ -613,9 +635,9 @@ export LDFLAGS=-L/usr/lib64/mysql --with-scriptdir=/etc/bacula \ --enable-smartalloc \ --enable-client-only \ - %if %{mdk} - --disable-nls \ - %endif + %if %{mdk} + --disable-nls \ + %endif --enable-static-fd make @@ -715,6 +737,11 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql %endif +# fixme - make installs gconsole script for build without gconsole +%if ! %{gconsole} +rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +%endif + rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd # install the init scripts @@ -863,6 +890,10 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb %attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler @@ -934,7 +965,8 @@ if [ -s /etc/bacula/console.conf ];then cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf fi -# create the daemon user and group +# create the daemon users and groups +# first create the groups if they don't exist HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then %{groupadd} -r %{daemon_group} > /dev/null 2>&1 @@ -947,24 +979,41 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{storage_daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now create the users if they do not exist +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 echo "The user %{storage_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 echo "The user %{director_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary groups, this is ok to call even if the users already exist +# we only do this if the user is NOT root +IS_ROOT=%{director_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{director_daemon_user} -G %{daemon_group} +fi +IS_ROOT=%{storage_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group} +fi +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %if %{mysql} %post mysql @@ -1133,12 +1182,20 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary group, this is ok to call even if the user already exists +# we only do this if the user is NOT root +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %post client # add our link @@ -1239,6 +1296,10 @@ fi %endif %changelog +* Sun Apr 02 2006 D. Scott Barninger +- 1.38.6 release +- fix problem specifying more than one primary group for user bacula +- add build switch to not build gconsole regardless of platform * Sun Jan 29 2006 D. Scott Barninger - add centos3 build tag - fix link error of static-fd on Mandrake with --disable-nls diff --git a/bacula/platforms/suse/bacula.spec.in b/bacula/platforms/suse/bacula.spec.in index f6a1730653..f0fa1a5dfa 100644 --- a/bacula/platforms/suse/bacula.spec.in +++ b/bacula/platforms/suse/bacula.spec.in @@ -5,7 +5,7 @@ # basic defines for every build %define depkgs ../depkgs -%define depkgs_version 22Jun05 +%define depkgs_version 28Mar06 %define sqlite_bindir /usr/lib/bacula/sqlite %define working_dir /var/bacula %define director_daemon_user bacula @@ -18,7 +18,8 @@ %define group_file /etc/group %define useradd /usr/sbin/useradd %define groupadd /usr/sbin/groupadd -%define _rescuever 1.8.2 +%define usermod /usr/sbin/usermod +%define _rescuever 1.8.3 # platform defines - set one below or define the build_xxx on the command line # RedHat builds @@ -121,7 +122,7 @@ exit 1 %define _dist %(grep -i SuSE /etc/SuSE-release) %endif %if %{mdk} -%define _dist %(grep Mandrake /etc/mandrake-release) +%define _dist %(grep Mand /etc/mandrake-release) %endif # Should we build gconsole, possible only if gnome >= 2.0 available @@ -130,6 +131,8 @@ exit 1 %else %define gconsole 1 %endif +# specifically disallow gconsole if desired +%{?nobuild_gconsole:%define gconsole 0} Summary: Bacula - The Network Backup Solution Name: bacula @@ -142,6 +145,8 @@ Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.t Source2: Release_Notes-%{version}-%{release}.tar.gz Source3:http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz Source4:http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz +Patch0: bacula-1.38.6-script.patch +Patch1: bacula-1.38.6-makefile.patch BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team @@ -152,19 +157,23 @@ Packager: D. Scott Barninger %define _rescuesrc ../%{name}-rescue-%{_rescuever} BuildRequires: atk-devel, ncurses-devel, pango-devel, perl -BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig +BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel BuildRequires: openssl-devel +%if %{gconsole} +BuildRequires: pkgconfig +%endif %if %{rh7} BuildRequires: libtermcap-devel BuildRequires: glibc-devel >= 2.2 -BuildRequires: ORBit-devel %endif %if %{su9} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su9} && %{gconsole} BuildRequires: libgnome >= 2.0 BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -176,10 +185,12 @@ BuildRequires: freetype2-devel %endif %if %{su10} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su10} && %{gconsole} BuildRequires: libgnome >= 2.12 BuildRequires: gtk2-devel >= 2.8 BuildRequires: libgnomeui-devel >= 2.12 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.10 @@ -194,24 +205,28 @@ BuildRequires: libpng-devel %endif %if %{mdk} BuildRequires: libtermcap-devel +BuildRequires: libstdc++-static-devel +BuildRequires: glibc-static-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{mdk} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui2-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: libORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo2_0-devel BuildRequires: libbonoboui2_0-devel BuildRequires: libbonobo-activation-devel BuildRequires: libGConf2-devel -BuildRequires: libstdc++-static-devel -BuildRequires: glibc-static-devel BuildRequires: freetype2-devel %endif %if %{fc3} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc3} && %{gconsole} BuildRequires: gtk2-devel >= 2.4 BuildRequires: libgnomeui-devel >= 2.8 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -222,9 +237,11 @@ BuildRequires: freetype-devel %endif %if %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.6 BuildRequires: libgnomeui-devel >= 2.10 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -235,9 +252,11 @@ BuildRequires: freetype-devel %endif %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -560,6 +579,9 @@ server packages. %setup -T -D -b 3 %setup -T -D -b 4 +%patch0 +%patch1 -p1 + %build %if %{su9} || %{su10} @@ -613,9 +635,9 @@ export LDFLAGS=-L/usr/lib64/mysql --with-scriptdir=/etc/bacula \ --enable-smartalloc \ --enable-client-only \ - %if %{mdk} - --disable-nls \ - %endif + %if %{mdk} + --disable-nls \ + %endif --enable-static-fd make @@ -715,6 +737,11 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql %endif +# fixme - make installs gconsole script for build without gconsole +%if ! %{gconsole} +rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +%endif + rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd # install the init scripts @@ -863,6 +890,10 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb %attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler @@ -934,7 +965,8 @@ if [ -s /etc/bacula/console.conf ];then cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf fi -# create the daemon user and group +# create the daemon users and groups +# first create the groups if they don't exist HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then %{groupadd} -r %{daemon_group} > /dev/null 2>&1 @@ -947,24 +979,41 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{storage_daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now create the users if they do not exist +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 echo "The user %{storage_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 echo "The user %{director_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary groups, this is ok to call even if the users already exist +# we only do this if the user is NOT root +IS_ROOT=%{director_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{director_daemon_user} -G %{daemon_group} +fi +IS_ROOT=%{storage_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group} +fi +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %if %{mysql} %post mysql @@ -1133,12 +1182,20 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary group, this is ok to call even if the user already exists +# we only do this if the user is NOT root +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %post client # add our link @@ -1239,6 +1296,10 @@ fi %endif %changelog +* Sun Apr 02 2006 D. Scott Barninger +- 1.38.6 release +- fix problem specifying more than one primary group for user bacula +- add build switch to not build gconsole regardless of platform * Sun Jan 29 2006 D. Scott Barninger - add centos3 build tag - fix link error of static-fd on Mandrake with --disable-nls diff --git a/bacula/scripts/bacula-ctl-dir.in b/bacula/scripts/bacula-ctl-dir.in index a418c4ddb7..37d22aff86 100644 --- a/bacula/scripts/bacula-ctl-dir.in +++ b/bacula/scripts/bacula-ctl-dir.in @@ -61,27 +61,27 @@ killproc() { # Kill it. if [ "$pid" != "" ] ; then if [ "$notset" = "1" ] ; then - if ${PS} -p $pid>/dev/null 2>&1; then + if ${PS} -p "$pid">/dev/null 2>&1; then # TERM first, then KILL if not dead kill -TERM $pid 2>/dev/null sleep 1 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then sleep 1 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then sleep 3 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then kill -KILL $pid 2>/dev/null fi fi fi fi - ${PS} -p $pid >/dev/null 2>&1 + ${PS} -p "$pid" >/dev/null 2>&1 RC=$? [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" # RC=$((! $RC)) # use specified level only else - if ${PS} -p $pid >/dev/null 2>&1; then + if ${PS} -p "$pid" >/dev/null 2>&1; then kill $killlevel $pid 2>/dev/null RC=$? [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" diff --git a/bacula/scripts/bacula-ctl-fd.in b/bacula/scripts/bacula-ctl-fd.in index 6f0610074d..f3552c32d1 100644 --- a/bacula/scripts/bacula-ctl-fd.in +++ b/bacula/scripts/bacula-ctl-fd.in @@ -61,27 +61,27 @@ killproc() { # Kill it. if [ "$pid" != "" ] ; then if [ "$notset" = "1" ] ; then - if ${PS} -p $pid>/dev/null 2>&1; then + if ${PS} -p "$pid">/dev/null 2>&1; then # TERM first, then KILL if not dead kill -TERM $pid 2>/dev/null sleep 1 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then sleep 1 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then sleep 3 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then kill -KILL $pid 2>/dev/null fi fi fi fi - ${PS} -p $pid >/dev/null 2>&1 + ${PS} -p "$pid" >/dev/null 2>&1 RC=$? [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" # RC=$((! $RC)) # use specified level only else - if ${PS} -p $pid >/dev/null 2>&1; then + if ${PS} -p "$pid" >/dev/null 2>&1; then kill $killlevel $pid 2>/dev/null RC=$? [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" diff --git a/bacula/scripts/bacula-ctl-sd.in b/bacula/scripts/bacula-ctl-sd.in index d918cbcbe5..9586bfc84c 100644 --- a/bacula/scripts/bacula-ctl-sd.in +++ b/bacula/scripts/bacula-ctl-sd.in @@ -61,27 +61,27 @@ killproc() { # Kill it. if [ "$pid" != "" ] ; then if [ "$notset" = "1" ] ; then - if ${PS} -p $pid>/dev/null 2>&1; then + if ${PS} -p "$pid">/dev/null 2>&1; then # TERM first, then KILL if not dead kill -TERM $pid 2>/dev/null sleep 1 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then sleep 1 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then sleep 3 - if ${PS} -p $pid >/dev/null 2>&1 ; then + if ${PS} -p "$pid" >/dev/null 2>&1 ; then kill -KILL $pid 2>/dev/null fi fi fi fi - ${PS} -p $pid >/dev/null 2>&1 + ${PS} -p "$pid" >/dev/null 2>&1 RC=$? [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" # RC=$((! $RC)) # use specified level only else - if ${PS} -p $pid >/dev/null 2>&1; then + if ${PS} -p "$pid" >/dev/null 2>&1; then kill $killlevel $pid 2>/dev/null RC=$? [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" diff --git a/bacula/scripts/bacula.in b/bacula/scripts/bacula.in index 9b0c2253ab..0382ab8f20 100755 --- a/bacula/scripts/bacula.in +++ b/bacula/scripts/bacula.in @@ -13,38 +13,35 @@ # easier to "steal" this code for the development # environment where they are different. # -BACFDBIN=@sbindir@ BACFDCFG=@sysconfdir@ -BACSDBIN=@sbindir@ BACSDCFG=@sysconfdir@ -BACDIRBIN=@sbindir@ BACDIRCFG=@sysconfdir@ case "$1" in start) - [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd $1 $2 - [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd $1 $2 - [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir $1 $2 + [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2 + [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2 + [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2 ;; stop) # Stop the FD first so that SD will fail jobs and update catalog - [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd $1 $2 - [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd $1 $2 - [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir $1 $2 + [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2 + [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2 + [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2 echo + sleep 6 ;; restart) $0 stop - sleep 5 $0 start ;; status) - [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd status - [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd status - [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir status + [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd status + [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd status + [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir status ;; *) diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index 1efd244164..6194de9025 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -398,7 +398,7 @@ static bool get_job_to_migrate(JCR *jcr) int stat, rc; char *p; dlist *item_chain; - uitem *item; + uitem *item = NULL; char prbuf[500]; regex_t preg; diff --git a/bacula/src/gnome2-console/test-gnome-console.conf b/bacula/src/gnome2-console/test-gnome-console.conf index fa5f9bcd4e..b2725a1f9f 100644 --- a/bacula/src/gnome2-console/test-gnome-console.conf +++ b/bacula/src/gnome2-console/test-gnome-console.conf @@ -5,6 +5,6 @@ Director { Name = rufus-dir DIRport = 8101 - address = localhost + address = rufus Password = UA_password } diff --git a/bacula/src/lib/alist.h b/bacula/src/lib/alist.h index 1682575703..e1c6e39ae7 100644 --- a/bacula/src/lib/alist.h +++ b/bacula/src/lib/alist.h @@ -26,17 +26,18 @@ * * Loop var through each member of list */ +#ifdef HAVE_GCC +#define foreach_alist(var, list) \ + for((var)=(typeof(var))(list)->first(); (var); (var)=(typeof(var))(list)->next() ) +#else #define foreach_alist(var, list) \ for((*((void **)&(var))=(void*)((list)->first())); \ (var); \ (*((void **)&(var))=(void*)((list)->next()))) - -#ifdef the_easy_way -#define foreach_alist(var, list) \ - for(((void*)(var))=(list)->first(); (var); ((void*)(var))=(list)->next()); ) #endif + /* Second arg of init */ enum { owned_by_alist = true, diff --git a/bacula/src/lib/dlist.h b/bacula/src/lib/dlist.h index 40c54f0133..32933ad608 100644 --- a/bacula/src/lib/dlist.h +++ b/bacula/src/lib/dlist.h @@ -2,7 +2,7 @@ * Version $Id$ */ /* - Copyright (C) 2004-2006 Kern Sibbald + Copyright (C) 2004-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 @@ -36,15 +36,16 @@ * * Loop var through each member of list */ +#ifdef HAVE_GCC #define foreach_dlist(var, list) \ - for((var)=NULL; (*((void **)&(var))=(void*)((list)->next(var))); ) - -#ifdef the_old_way + for((var)=NULL; ((var)=(typeof(var))(list)->next(var)); ) +#else #define foreach_dlist(var, list) \ - for((var)=NULL; (((void *)(var))=(list)->next(var)); ) + for((var)=NULL; (*((void **)&(var))=(void*)((list)->next(var))); ) #endif + struct dlink { void *next; void *prev; diff --git a/bacula/src/lib/parse_conf.h b/bacula/src/lib/parse_conf.h index 754a009cc7..4943f6abe6 100644 --- a/bacula/src/lib/parse_conf.h +++ b/bacula/src/lib/parse_conf.h @@ -2,22 +2,17 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 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. */ @@ -32,14 +27,14 @@ typedef void (MSG_RES_HANDLER)(LEX *lc, RES_ITEM *item, int index, int pass); struct RES_ITEM { const char *name; /* Resource name i.e. Director, ... */ MSG_RES_HANDLER *handler; /* Routine storing the resource item */ - void **value; /* Where to store the item */ + char **value; /* Where to store the item */ int code; /* item code/additional info */ int flags; /* flags: default, required, ... */ int default_value; /* default value */ }; /* For storing name_addr items in res_items table */ -#define ITEM(x) ((void **)&res_all.x) +#define ITEM(x) ((char **)&res_all.x) #define MAX_RES_ITEMS 70 /* maximum resource items per RES */ @@ -114,15 +109,16 @@ void save_resource(int type, RES_ITEM *item, int pass); const char *res_to_str(int rcode); /* Loop through each resource of type, returning in var */ +#ifdef HAVE_GCC #define foreach_res(var, type) \ - for(var=NULL; (*((void **)&(var))=(void *)GetNextRes((type), (RES *)var));) - -#ifdef the_old_way + for((var)=NULL; ((var)=(typeof(var))GetNextRes((type), (RES *)var));) +#else #define foreach_res(var, type) \ - for((var)=NULL; (((void *)(var))=GetNextRes((type), (RES *)var));) + for(var=NULL; (*((void **)&(var))=(void *)GetNextRes((type), (RES *)var));) #endif + void store_str(LEX *lc, RES_ITEM *item, int index, int pass); void store_dir(LEX *lc, RES_ITEM *item, int index, int pass); void store_password(LEX *lc, RES_ITEM *item, int index, int pass); diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index e24292a7c3..1361b37541 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -4,22 +4,17 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 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. */ diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 34b2860986..edb5f7002e 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -88,6 +88,7 @@ bool acquire_device_for_read(DCR *dcr) int stat; DCR *dcr_save = jcr->dcr; + lock_reservations(); jcr->dcr = NULL; memset(&rctx, 0, sizeof(RCTX)); rctx.jcr = jcr; @@ -109,6 +110,7 @@ bool acquire_device_for_read(DCR *dcr) */ stat = search_res_for_device(rctx); release_msgs(jcr); /* release queued messages */ + unlock_reservations(); if (stat == 1) { DCR *new_dcr = jcr->read_dcr; dev->unblock(); diff --git a/bacula/src/win32/compat/vss_generic.cpp b/bacula/src/win32/compat/vss_generic.cpp index 11c7b33d9c..94beae42f0 100644 --- a/bacula/src/win32/compat/vss_generic.cpp +++ b/bacula/src/win32/compat/vss_generic.cpp @@ -4,7 +4,7 @@ // Copyright transferred from MATRIX-Computer GmbH to // Kern Sibbald by express permission. // -// Copyright (C) 2005 Kern Sibbald +// Copyright (C) 2005-2006 Kern Sibbald // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -88,7 +88,8 @@ using namespace std; #pragma message("compile VSS for Windows 2003") #define VSSClientGeneric VSSClient2003 // wait x ms for a VSS asynchronous operation (-1 = infinite) - #define VSS_TIMEOUT (DWORD) 300000 + // unfortunately, it doesn't work, so do not set timeout + #define VSS_TIMEOUT #include "vss/inc/Win2003/vss.h" #include "vss/inc/Win2003/vswriter.h" @@ -281,7 +282,9 @@ BOOL VSSClientGeneric::Initialize(DWORD dwContext, BOOL bDuringRestore) void VSSClientGeneric::WaitAndCheckForAsyncOperation(IVssAsync* pAsync) { - // Wait until the async operation finishes + // Wait until the async operation finishes + // unfortunately we can't use a timeout here yet. + // the interface would allow it on W2k3, but it is not implemented yet.... HRESULT hr = pAsync->Wait(VSS_TIMEOUT); // Check the result of the asynchronous operation -- 2.39.5