~ubuntu-branches/ubuntu/maverick/bacula/maverick

« back to all changes in this revision

Viewing changes to patches/2.4.1-migration.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2009-01-10 04:57:41 UTC
  • mfrom: (3.1.4 lenny)
  • Revision ID: james.westby@ubuntu.com-20090110045741-s6k86vdrivghtfyd
Tags: 2.4.4-1ubuntu1
* Upload fixes LP #269251, LP: #308903 and LP: #293515
* debian/rules:
  - added bat_icon.png and bat.desktop for bacula-console-qt (LP: #314746)
  - added bacula-tray-monitor.xpm icon, fix Exec path in .desktop
* debian/bacula-traymonitor.install
  - remove bacula-tray-monitor.xpm, add bacula-tray-monitor.desktop
* Merge from debian unstable, remaining changes:
  * Store sd|fd|director passwords in debconf (LP: #222558)
    - added debian/bacula-common.templates
    - modified debian/bacula-common.postinst:
      + generate random passwords and store them in debconf
    - modified debian/bacula-[sd|fd|director-mysql|director-pgsql].postinst
      + read and set passwords from debconf
  * Daemons listen on all interfaces (LP: #286643)
  * Start daemons on installation
  * Build with generic XXX_*_XXX username, password and database name
    and replace it with dbconfig's settings in postinstall scripts
  * Drop mt-st to suggests. So that bacula goes back to main. (LP: #286528)
  * debian/rules: Disable fortify source since it was causing
    bacula-director to segfault.
  * debian/control:
    - Added libdbi-perl and libdb-mysql-perl to depends for
      bacula-director-mysql
      due to new postinst configuration.
    - Cleaned up bacula-director-pgsql dependenices and recommends.
    - Made mysql the default director to install bacula-director-{mysql|pgsql}
      added database handling to postinstall scripts and templates, modifiied
      postinstall script's sed expressions.
    - Removed libwgtk-2.6-dev as a build dependency; as a result
      bacula-console-wx isn't built anymore.
    - Install gawk if not installed. (LP: #207527)
  * debian/make_catalog_backup_awk.[mysql|pgsql|sqlite3|sqlite]:
    - New scripts for catalog backup. (CVE-2007-5626)
  * debian/bacula-console-wx:
    - Dropped since we are not building them anymore.
  * debian/bacula-director-common.bacula-director.init,
    debian/bacula-fd.init, debian/bacula-sd.init
    - Made more LSB specific.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
 This patch should help prevent jobs from being migrated twice if 
3
 
 you happen to run two migration jobs at the same time. This should
4
 
 fix or improve the problem reported in bug #1129.
5
 
 Apply it to version 2.4.1 with:
6
 
 
7
 
 cd <bacula-source>
8
 
 patch -p0 <2.4.1-migration.patch
9
 
 ./configure <your-options>
10
 
 make
11
 
 ...
12
 
 make install
13
 
 
14
 
 
15
 
 
16
 
Index: src/dird/migrate.c
17
 
===================================================================
18
 
--- src/dird/migrate.c  (revision 7433)
19
 
+++ src/dird/migrate.c  (working copy)
20
 
@@ -1,7 +1,7 @@
21
 
 /*
22
 
    Bacula® - The Network Backup Solution
23
 
 
24
 
-   Copyright (C) 2004-2007 Free Software Foundation Europe e.V.
25
 
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
26
 
 
27
 
    The main author of Bacula is Kern Sibbald, with contributions from
28
 
    many others, a complete list can be found in the file AUTHORS.
29
 
@@ -274,6 +274,21 @@
30
 
       return true;
31
 
    }
32
 
 
33
 
+   if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) {
34
 
+      Jmsg(jcr, M_FATAL, 0, _("Could not get job record for JobId %s to migrate. ERR=%s"),
35
 
+           edit_int64(jcr->previous_jr.JobId, ed1),
36
 
+           db_strerror(jcr->db));
37
 
+      set_jcr_job_status(jcr, JS_Terminated);
38
 
+      migration_cleanup(jcr, jcr->JobStatus);
39
 
+      return true;
40
 
+   }
41
 
+   /* Make sure this job was not already migrated */
42
 
+   if (jcr->previous_jr.JobType != JT_BACKUP) {
43
 
+      set_jcr_job_status(jcr, JS_Terminated);
44
 
+      migration_cleanup(jcr, jcr->JobStatus);
45
 
+      return true;
46
 
+   }
47
 
+
48
 
    /* Print Job Start message */
49
 
    Jmsg(jcr, M_INFO, 0, _("Start Migration JobId %s, Job=%s\n"),
50
 
         edit_uint64(jcr->JobId, ed1), jcr->Job);