From: Kern Sibbald Date: Thu, 19 Jun 2003 10:20:31 +0000 (+0000) Subject: Fix JobId in run listing + reduce Cygwin wait to 10 seconds because no kill X-Git-Tag: Release-1.31~63 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c08b088e39a5816204bd755ec2d3230bd84b1cb;p=bacula%2Fbacula Fix JobId in run listing + reduce Cygwin wait to 10 seconds because no kill git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@593 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 0b93b60f6c..315151e488 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -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? - diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 2da53b44c4..8275e19834 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -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), diff --git a/bacula/src/filed/heartbeat.c b/bacula/src/filed/heartbeat.c index 2cc907f7ab..05bd90229b 100644 --- a/bacula/src/filed/heartbeat.c +++ b/bacula/src/filed/heartbeat.c @@ -31,6 +31,16 @@ #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); } } diff --git a/bacula/src/findlib/makepath.c b/bacula/src/findlib/makepath.c index 87e1741226..6404d3a9c1 100644 --- a/bacula/src/findlib/makepath.c +++ b/bacula/src/findlib/makepath.c @@ -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);