]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix JobId in run listing + reduce Cygwin wait to 10 seconds because no kill
authorKern Sibbald <kern@sibbald.com>
Thu, 19 Jun 2003 10:20:31 +0000 (10:20 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 19 Jun 2003 10:20:31 +0000 (10:20 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@593 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/src/dird/ua_run.c
bacula/src/filed/heartbeat.c
bacula/src/findlib/makepath.c

index 0b93b60f6cec23bd8aea09855eb4b256015f9b29..315151e48829abd812ad0833ef9acea5596a0abc 100644 (file)
@@ -31,6 +31,10 @@ Testing to do: (painful)
 - Figure out how to use ssh or stunnel to protect Bacula communications.
 
 For 1.31 release:
+- On Windows with very long path names, it may be impossible to create 
+  a file (and thus restore it) because the total length is too long.
+  We must cd into the directory then create the file without the
+  full path name.
 - Move JobFiles and JobBytes to SD rather than FD -- more correct.
 - Add client name to cram-md5 challenge so Director can immediately
   verify if it is the correct client.
@@ -984,4 +988,3 @@ Done: (see kernsdone for more)
 - Instrument use_count on DEVICE packets and ensure that the device is
   being close()ed at the appropriate time.
 - Test long path names (>64 chars) in Windows -- crashes FD?
-
index 2da53b44c422b64f482b1b6054c97d2e8a3f8ece..8275e19834ae8c5b487314d560a84eab65d4a9b7 100644 (file)
@@ -429,6 +429,7 @@ Replace:    %s\n\
 FileSet:    %s\n\
 Client:     %s\n\
 Storage:    %s\n\
+JobId:      %s\n\
 When:       %s\n"),
                 job->hdr.name,
                 NPRT(jcr->RestoreBootstrap),
index 2cc907f7abb0923789f01927e8f29a6adeb0a42e..05bd90229bd4dc4d110a6c147d28f9a6e7954a21 100644 (file)
 #include "bacula.h"
 #include "filed.h"
 
+#ifdef HAVE_CYGWIN
+/* pthread_kill() dies on Cygwin, so disable it */
+#define pthread_kill(x, y)
+/* Use shorter wait interval on Cygwin because no kill */
+#define WAIT_INTERVAL 10
+#else  /* Unix systems */
+#define WAIT_INTERVAL 60
+#endif
+
 /* 
  * Listen on the SD socket for heartbeat signals.
  * Send heartbeats to the Director every HB_TIME
@@ -57,7 +67,7 @@ static void *sd_heartbeat_thread(void *arg)
     *  keep him alive.
     */
    for ( ; !is_bnet_stop(sd); ) {
-      n = bnet_wait_data_intr(sd, 60);
+      n = bnet_wait_data_intr(sd, WAIT_INTERVAL);
       if (me->heartbeat_interval) {
         now = time(NULL);
         if (now-last_heartbeat >= me->heartbeat_interval) {
@@ -95,10 +105,8 @@ void stop_heartbeat_monitor(JCR *jcr)
 
    /* Wait for heartbeat thread to stop */
    while (jcr->hb_bsock) {
-#ifndef HAVE_CYGWIN
       /* Naturally, Cygwin 1.3.20 craps out on the following */
       pthread_kill(jcr->heartbeat_id, TIMEOUT_SIGNAL); /* make heartbeat thread go away */
-#endif
       bmicrosleep(0, 500);
    }
 }
index 87e17412267083dff5cf7a8198b9961b011410d3..6404d3a9c18edf0365a3942c2c7f1cce35399dc9 100644 (file)
@@ -253,7 +253,7 @@ make_path(
 #endif
                  ) {
                 /* Note, if we are restoring as NON-root, this may not be fatal */
-                 Jmsg(jcr, M_WARNING, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"),
+                 Jmsg(jcr, M_ERROR, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"),
                      quote(dirpath), strerror(errno));
              }
               Dmsg0(300, "Chown done.\n");
@@ -312,7 +312,7 @@ make_path(
 #endif
              )
            {
-              Jmsg(jcr, M_WARNING, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"),
+              Jmsg(jcr, M_ERROR, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"),
                     quote(dirpath), strerror(errno));
            }
       }
@@ -326,7 +326,7 @@ make_path(
          Dmsg1(300, "Final chmod mode=%o\n", mode);
       }
       if ((mode & ~S_IRWXUGO) && chmod(basename_dir, mode)) {
-          Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"), 
+          Jmsg(jcr, M_ERROR, 0, _("Cannot change permissions of %s: ERR=%s\n"), 
             quote(dirpath), strerror(errno));
       }
 
@@ -341,7 +341,7 @@ make_path(
           *(p->dirname_end) = '\0';
           Dmsg2(300, "Reset parent mode=%o dir=%s\n", parent_mode, dirpath);
          if (chmod(dirpath, parent_mode)) {
-              Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"),
+              Jmsg(jcr, M_ERROR, 0, _("Cannot change permissions of %s: ERR=%s\n"),
                     quote (dirpath), strerror(errno));
          }
       }
@@ -369,11 +369,11 @@ make_path(
              && errno != EPERM
 #endif
              ) {
-              Jmsg(jcr, M_WARNING, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"),
+              Jmsg(jcr, M_ERROR, 0, _("Cannot change owner and/or group of %s: ERR=%s\n"),
                     quote(dirpath), strerror(errno));
            }
          if (chmod(dirpath, mode)) {
-              Jmsg(jcr, M_WARNING, 0, _("Cannot change permissions of %s: ERR=%s\n"),
+              Jmsg(jcr, M_ERROR, 0, _("Cannot change permissions of %s: ERR=%s\n"),
                                 quote(dirpath), strerror(errno));
          }
           Dmsg2(300, "pathexists chmod mode=%o dir=%s\n", mode, dirpath);