]> git.sur5r.net Git - bacula/bacula/commitdiff
08Nov04
authorKern Sibbald <kern@sibbald.com>
Mon, 8 Nov 2004 21:12:12 +0000 (21:12 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 8 Nov 2004 21:12:12 +0000 (21:12 +0000)
- 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.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1675 91ce42f0-d328-0410-95d8-f526ca767f89

12 files changed:
bacula/autoconf/configure.in
bacula/configure
bacula/kernstodo
bacula/scripts/.cvsignore
bacula/src/cats/make_mysql_tables.in
bacula/src/cats/make_postgresql_tables.in
bacula/src/cats/make_sqlite_tables.in
bacula/src/dird/bacula-dir.conf.in
bacula/src/dird/ua_run.c
bacula/src/lib/bpipe.c
bacula/src/lib/message.c
bacula/src/lib/util.c

index d7b4afc0da904d953a82a3f7839463969794955d..7a275e54425d127a9b079374cbebf4bf4b009327 100644 (file)
@@ -1646,7 +1646,7 @@ openbsd)
        lld="qd"
        llu="qu"
        TAPEDRIVE="/dev/nrst0"
-       PSCMD="ps -a -o pid,command"
+       PSCMD="ps -ax -o pid,command"
        PTHREAD_LIB="-pthread"
        CFLAGS="${CFLAGS} -pthread"
        PFILES="${PFILES} \
@@ -1699,7 +1699,7 @@ gentoo)
        PSCMD="ps -e -o pid,command"
        PFILES="${PFILES} \
            platforms/gentoo/Makefile \
-         platforms/gentoo/bacula-init \
+        platforms/gentoo/bacula-init \
            platforms/gentoo/bacula-fd \
            platforms/gentoo/bacula-sd \
            platforms/gentoo/bacula-dir"
@@ -1819,7 +1819,7 @@ AC_OUTPUT([autoconf/Make.common \
           scripts/bacula.desktop.gnome2.xsu \
           scripts/gnome-console.console_apps \
           scripts/mtx-changer \
-        scripts/bacula-tray-monitor.desktop \
+       scripts/bacula-tray-monitor.desktop \
           doc/Makefile \
           src/Makefile \
           src/host.h \
index 29de6b0a08179197463086a3a30466d24087f70e..91c67c525db33f600a861feea18bfa4a5eecc5f2 100755 (executable)
@@ -19038,7 +19038,7 @@ openbsd)
        lld="qd"
        llu="qu"
        TAPEDRIVE="/dev/nrst0"
-       PSCMD="ps -a -o pid,command"
+       PSCMD="ps -ax -o pid,command"
        PTHREAD_LIB="-pthread"
        CFLAGS="${CFLAGS} -pthread"
        PFILES="${PFILES} \
@@ -19091,7 +19091,7 @@ gentoo)
        PSCMD="ps -e -o pid,command"
        PFILES="${PFILES} \
            platforms/gentoo/Makefile \
-         platforms/gentoo/bacula-init \
+        platforms/gentoo/bacula-init \
            platforms/gentoo/bacula-fd \
            platforms/gentoo/bacula-sd \
            platforms/gentoo/bacula-dir"
index 49a3d72ad836144283c6b8906e1285274037d4d4..63abca7d47490d66ca66b042b94ec574e77725ec 100644 (file)
@@ -7,13 +7,15 @@ Project                     Developer
 IPv6_2                      Meno Abels
 Data encryption             Meno Abels (see projects)
 Communication encryption    Meno Abels  
-Version 1.35                Kern (see below)
+Version 1.37                Kern (see below)
 ========================================================
 
-1.37 Items to do for release:
-  
-
 1.37 Items:
+- Make bls list files but with VolID, VolTime, FileIndex
+- Modify Backing up Your Database to include a bootstrap file.
+- Add restore of specific JobId to regression.
+- Add date/time to each Jmsg.
+- Think about making certain database errors fatal.
 - Look at correcting the time jump in the sceduler for daylight
   savings time changes.
 - Add a "real" timer to network connections.
index fb2c8deb419c23f9901bf9ac7a4d2b88ac9fc3b4..b0dbddcbfc66a28630227071733cdef9839a9bf7 100644 (file)
@@ -1,3 +1,4 @@
+bacula-tray-monior.desktop
 .xvpics
 logrotate
 bacula.desktop
index 4f668d94306315ffbf72be553f7233c0d47b8937..3f292ea447f88460950f1f0e0e00552adaf861c0 100644 (file)
@@ -32,12 +32,19 @@ CREATE TABLE File (
    LStat TINYBLOB NOT NULL,
    MD5 TINYBLOB NOT NULL,
    PRIMARY KEY(FileId),
-   INDEX (JobId),
-   INDEX (PathId),
-   INDEX (FilenameId),
-   INDEX (JobId, PathId, FilenameId)
+   INDEX (FilenameId, PathId)
    );
 
+#
+# Possibly add one or more of the following indexes
+#  to the above File table if your Verifies are
+#  too slow.
+#
+#  INDEX (JobId),
+#  INDEX (PathId),
+#  INDEX (FilenameId),
+#  INDEX (JobId, PathId, FilenameId)
+#
 
 CREATE TABLE Job (
    JobId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
index 513556adc60dc7524ae2ea763de5b60183b70e5e..b067f1548bf5dea22a9a682f9776e2152a89aa2c 100644 (file)
@@ -211,9 +211,15 @@ create table file
 );
 
 create index file_jobid_idx on file (jobid);
-create index file_pathid_idx on file(pathid);
-create index file_filenameid_idx on file(filenameid);
-create index file_jpfid_idx on file (jobid, pathid, filenameid);
+create index file_fp_idx on file (filenameid, pathid);
+
+--
+-- Possibly add one or more of the following indexes
+--  if your Verifies are too slow.
+--
+-- create index file_pathid_idx on file(pathid);
+-- create index file_filenameid_idx on file(filenameid);
+-- create index file_jpfid_idx on file (jobid, pathid, filenameid);
 
 create table jobmedia
 (
index 7102e196ae97cb42aab148d0b63b4931d464f2d5..a780f9dc502d93050332de3706702bf0fe44ad0f 100644 (file)
@@ -36,9 +36,14 @@ CREATE TABLE File (
    );
 
 CREATE INDEX inx3 ON File (JobId);
-CREATE INDEX inx4 ON File (PathId);
-CREATE INDEX inx5 ON File (FileNameId);
-CREATE INDEX inx9 ON File (JobId, PathId, FileNameId);
+CREATE INDEX inx4 ON File (FilenameId, PathId);
+--
+-- Possibly add one or more of the following indexes
+--  if your Verifies are too slow.
+--
+-- CREATE INDEX inx4 ON File (PathId);
+-- CREATE INDEX inx5 ON File (FileNameId);
+-- CREATE INDEX inx9 ON File (JobId, PathId, FilenameId);
 
 CREATE TABLE Job (
    JobId INTEGER UNSIGNED NOT NULL,
index 3947a331340721c0e9bd1ee0371fb6e0d998b4b0..83c8ff671134e9f2c647c3ad9378c58e0069fd29 100644 (file)
@@ -20,7 +20,7 @@ Director {                            # define myself
   PidDirectory = "@piddir@"
   Maximum Concurrent Jobs = 1
   Password = "@dir_password@"         # Console password
-  Messages = Standard
+  Messages = Daemon
 }
 
 JobDefs {
@@ -212,6 +212,20 @@ Messages {
 #
   append = "@working_dir@/log" = all, !skipped
 }
+
+
+#
+# Message delivery for daemon messages (no job).
+Messages {
+  Name = Daemon
+  mailcommand = "@sbindir@/bsmtp -h @smtp_host@ -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
+  mail = @job_email@ = all, !skipped            
+  console = all, !skipped, !saved
+  append = "@working_dir@/log" = all, !skipped
+}
+
+
+
     
 # Default pool definition
 Pool {
index 4cdb03f00a09bc02d4eebfb59ccdc07f21b27cdf..52aeff5a5549abf96a1c07fc4465ecbe1555fba3 100644 (file)
@@ -580,7 +580,6 @@ Priority:    %d\n"),
                        "Bootstrap:  %s\n"
                        "Where:      %s\n"
                        "Replace:    %s\n"
-                       "FileSet:    %s\n"
                        "Client:     %s\n"
                        "Storage:    %s\n"
                        "JobId:      %s\n"
index c432f1c6d5057e0aafee629bb6308eaa2f208cf8..93238b26e28e258249d313a06eda2de08b1eb528 100644 (file)
@@ -220,7 +220,7 @@ int close_bpipe(BPIPE *bpipe)
       if (WIFEXITED(chldstatus)) {    /* process exit()ed */
         stat = WEXITSTATUS(chldstatus);
         if (stat != 0) {
-            Dmsg1(100, "Non-zero status %s returned from child.\n", stat);
+            Dmsg1(200, "Non-zero status %d returned from child.\n", stat);
            stat |= b_errno_exit;        /* exit status returned */
         }
          Dmsg1(200, "child status=%d\n", stat & ~b_errno_exit);
index 0165e9f0cc5c224324a5bf68165a41218f7de185..905568b7a2ce41195e08c5bbd554942aa593633e 100755 (executable)
@@ -374,16 +374,11 @@ static void make_unique_mail_filename(JCR *jcr, POOLMEM *&name, DEST *d)
 static BPIPE *open_mail_pipe(JCR *jcr, POOLMEM *&cmd, DEST *d)
 {
    BPIPE *bpipe;
-   int use_bsmtp = (d->mail_cmd && jcr);
        
-   if (use_bsmtp) {
+   if (d->mail_cmd) {
       cmd = edit_job_codes(jcr, cmd, d->mail_cmd, d->where);
    } else {
-#if 1
       Mmsg(cmd, "/usr/lib/sendmail -F Bacula %s", d->where);
-#else
-      Mmsg(cmd, "mail -s \"Bacula Message\" %s", d->where);
-#endif
    }
    fflush(stdout);
 
@@ -393,11 +388,10 @@ static BPIPE *open_mail_pipe(JCR *jcr, POOLMEM *&cmd, DEST *d)
         cmd, be.strerror());
    }
 
-#if 1
-   if (!use_bsmtp) {
+   /* If we had to use sendmail, add subject */
+   if (!d->mail_cmd) {
        fprintf(bpipe->wfd, "Subject: Bacula Message\r\n\r\n");
    }
-#endif
    
    return bpipe;
 }
@@ -655,7 +649,7 @@ void dispatch_message(JCR *jcr, int type, int level, char *msg)
                   if (stat != 0) {
                      berrno be;
                      be.set_errno(stat);
-                      Jmsg2(jcr, M_ERROR, 0, _("Operator mail program terminated in error.\n"
+                      Qmsg2(jcr, M_ERROR, 0, _("Operator mail program terminated in error.\n"
                             "CMD=%s\n"
                             "ERR=%s\n"), mcmd, be.strerror());
                   }
@@ -671,7 +665,7 @@ void dispatch_message(JCR *jcr, int type, int level, char *msg)
                    d->fd = fopen(name, "w+");
                   if (!d->fd) {
                      d->fd = stdout;
-                      Jmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", name, strerror(errno));
+                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", name, strerror(errno));
                      d->fd = NULL;
                      free_pool_memory(name);
                      break;
@@ -690,7 +684,7 @@ void dispatch_message(JCR *jcr, int type, int level, char *msg)
                    d->fd = fopen(d->where, "w+");
                   if (!d->fd) {
                      d->fd = stdout;
-                      Jmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where, strerror(errno));
+                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where, strerror(errno));
                      d->fd = NULL;
                      break;
                   }
@@ -703,7 +697,7 @@ void dispatch_message(JCR *jcr, int type, int level, char *msg)
                    d->fd = fopen(d->where, "a");
                   if (!d->fd) {
                      d->fd = stdout;
-                      Jmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where, strerror(errno));
+                      Qmsg2(jcr, M_ERROR, 0, "fopen %s failed: ERR=%s\n", d->where, strerror(errno));
                      d->fd = NULL;
                      break;
                   }
index 52dbe698ae7429ae37e556b3111179f9972ebb95..32f9d0afabfcec6d95b068c836477e819c469531 100644 (file)
@@ -542,7 +542,11 @@ POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to)
             str = "%";
            break;
          case 'c':
-           str = jcr->client_name;
+           if (jcr) {
+              str = jcr->client_name;
+           } else {
+               str = "*none*";
+           }
            if (!str) {
                str = "";
            }
@@ -551,39 +555,67 @@ POOLMEM *edit_job_codes(JCR *jcr, char *omsg, char *imsg, const char *to)
             str = my_name;            /* Director's name */
            break;
          case 'e':
-           str = job_status_to_str(jcr->JobStatus); 
+           if (jcr) {
+              str = job_status_to_str(jcr->JobStatus); 
+           } else { 
+               str = "*none*";
+           }
            break;
          case 'i':
-            bsnprintf(add, sizeof(add), "%d", jcr->JobId);
-           str = add;
+           if (jcr) {
+               bsnprintf(add, sizeof(add), "%d", jcr->JobId);
+              str = add;
+           } else {
+               str = "*none*";
+           }
            break;
          case 'j':                    /* Job name */
-           str = jcr->Job;
+           if (jcr) {
+              str = jcr->Job;
+           } else {
+               str = "*none*";
+           }
            break;
          case 'l':
-           str = job_level_to_str(jcr->JobLevel);
+           if (jcr) {
+              str = job_level_to_str(jcr->JobLevel);
+           } else {
+               str = "*none*";
+           }
            break;
          case 'n':
-            bstrncpy(name, jcr->Job, sizeof(name));
-            /* There are three periods after the Job name */
-            for (i=0; i<3; i++) {
-                if ((q=strrchr(name, '.')) != NULL) {
-                   *q = 0;
+            if (jcr) {
+               bstrncpy(name, jcr->Job, sizeof(name));
+               /* There are three periods after the Job name */
+               for (i=0; i<3; i++) {
+                   if ((q=strrchr(name, '.')) != NULL) {
+                      *q = 0;
+                  }
                }
+               str = name;
+            } else {
+                str = "*none*";
             }
-            str = name;
             break;
          case 'r':
            str = to;
            break;
          case 't':
-           str = job_type_to_str(jcr->JobType);
+           if (jcr) {
+              str = job_type_to_str(jcr->JobType);
+           } else {
+               str = "*none*";
+           }
            break;
          case 'v':
-           if (jcr->VolumeName && jcr->VolumeName[0]) {
-              str = jcr->VolumeName;
+           if (jcr) {
+              if (jcr->VolumeName && jcr->VolumeName[0]) {
+                 str = jcr->VolumeName;
+              } else {
+                  str = "";
+              }
            } else {
-               str = "";
+               str = "*none*";
            }
            break;
         default: