]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix reporting jobs from state file + misc
authorKern Sibbald <kern@sibbald.com>
Mon, 23 Feb 2004 09:27:17 +0000 (09:27 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 23 Feb 2004 09:27:17 +0000 (09:27 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1073 91ce42f0-d328-0410-95d8-f526ca767f89

12 files changed:
bacula/autoconf/configure.in
bacula/configure
bacula/kernstodo
bacula/src/dird/dird.c
bacula/src/dird/ua_status.c
bacula/src/filed/filed.c
bacula/src/filed/status.c
bacula/src/jcr.h
bacula/src/lib/bnet.c
bacula/src/lib/jcr.c
bacula/src/stored/status.c
bacula/src/version.h

index 667dac318d7a8fdacc208af3f5456671ead6f5bc..f05a777f0c31805fecbdc0b4a65cee8220e75c66 100644 (file)
@@ -1359,6 +1359,8 @@ freebsd)
        largefile_support="yes"
   ;;
 hpux)
+       PSCMD="UNIX95=1 ps -e -o pid,comm"
+       CFLAGS="$(CFLAGS) -D_XOPEN_SOURCE_EXTENDED=1"
        DISTVER=`uname -r`
        TAPEDRIVE="/dev/rmt/0hnb"
   ;;
index 4536fa24b287a4822a020b7c9b2befca61f7e7f9..bdc681a0bba12b8bea8193d399e6d96a6fdd244f 100755 (executable)
@@ -17870,6 +17870,8 @@ freebsd)
        largefile_support="yes"
   ;;
 hpux)
+       PSCMD="UNIX95=1 ps -e -o pid,comm"
+       CFLAGS="$(CFLAGS) -D_XOPEN_SOURCE_EXTENDED=1"
        DISTVER=`uname -r`
        TAPEDRIVE="/dev/rmt/0hnb"
   ;;
@@ -17981,6 +17983,7 @@ suse)
            platforms/suse/bacula-fd \
            platforms/suse/bacula-sd \
            platforms/suse/bacula-dir \
+           platforms/suse/bacula \
            platforms/suse/bacula.spec"
   ;;
 suse5)
index ca5f31fc1be7c3a0cb86819150ac0c9b24823207..b864cc3317712e7b3ed2ac33bae0af4747671d67 100644 (file)
@@ -71,8 +71,8 @@ For 1.33 Testing/Documentation:
      http://howtos.linux.com/guides/nag2/x-087-2-nfs.mountd.shtml
 
 For 1.33
-- Dates are wrong in restore list from Win32 FD.
-- Dates are wrong in catalog from Win32 FD.
+- Allow for optional cancelling of SD and FD in case DIR
+  gets a fatal error. Requested by Jesse Guardiani <jesse@wingnet.net>
 - Remove h_errno from bnet.c by including proper header.
 - Do not err job if could not write bootstrap file.
 - Bizarre message: Error: Could not open WriteBootstrap file:
@@ -1387,3 +1387,6 @@ Block Position: 0
      Differential Backup Pool = zzz
    }
 - Look at ASSERT() at 384 src/lib/bnet.c
+- Dates are wrong in restore list from Win32 FD.
+- Dates are wrong in catalog from Win32 FD.
+
index d6532e6ba79588250823ba07bab19af06001c6bb..b78e35d8667bf2a6d66fdc8a607a6edb8f7b628b 100644 (file)
@@ -250,7 +250,6 @@ static void terminate_dird(int sig)
       exit(1);
    }
    already_here = TRUE;
-   Dmsg0(000, "write_state_file\n");
    write_state_file(director->working_directory, "bacula-dir", director->DIRport);
    delete_pid_file(director->pid_directory, "bacula-dir", director->DIRport);
 // signal(SIGCHLD, SIG_IGN);          /* don't worry about children now */
index 7a8a47d147cf5dec5e8937596fccab37f0b659ec..a33cd179bd97ec4dc35aecc76f04c47281e3cf63 100644 (file)
@@ -202,8 +202,8 @@ static void do_director_status(UAContext *ua, char *cmd)
    bsendmsg(ua, "%s Version: " VERSION " (" BDATE ") %s %s %s\n", my_name,
            HOST_OS, DISTNAME, DISTVER);
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
-   bsendmsg(ua, _("Daemon started %s, %d Job%s run.\n"), dt, last_job.NumJobs,
-        last_job.NumJobs == 1 ? "" : "s");
+   bsendmsg(ua, _("Daemon started %s, %d Job%s run.\n"), dt, last_jobs->size(),
+        last_jobs->size() == 1 ? "" : "s");
    /*
     * List scheduled Jobs
     */
index e13257ec652c5d33b1777c3b7514a978fc2e16e2..bd8fd3570449776cec7b62a8a5531f82d1b37be2 100644 (file)
@@ -242,7 +242,7 @@ Without that I don't know who I am :-(\n"), configfile);
                      &dir_workq, handle_client_request);
    }
 
-   term_msg();
+   terminate_filed(0);
    exit(0);                          /* should never get here */
 }
 
index a13f6bc02a5b6053438ba02bd971ac185b2e3254..68f8219df4a6c900202ce9cda86ec91a4c191d40 100755 (executable)
@@ -60,8 +60,8 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
              HOST_OS, DISTNAME, DISTVER);
    sendit(msg, len, arg);
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
-   len = Mmsg(&msg, _("Daemon started %s, %d Job%s run.\n"), dt, last_job.NumJobs,
-        last_job.NumJobs == 1 ? "" : "s");
+   len = Mmsg(&msg, _("Daemon started %s, %d Job%s run.\n"), dt, last_jobs->size(),
+        last_jobs->size() == 1 ? "" : "s");
    sendit(msg, len, arg);
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
    if (debug_level > 0) {
@@ -83,31 +83,12 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
 
    list_terminated_jobs(sendit, arg);
 
-#ifdef xxx
-      char termstat[30];
-      struct s_last_job *je;
-      lock_last_jobs_list();
-      for (je=NULL; (je=(s_last_job *)last_jobs->next(je)); ) {
-        bstrftime_nc(dt, sizeof(dt), je->end_time);
-         len = Mmsg(&msg, _("Last Job %s finished at %s\n"), je->Job, dt);
-        sendit(msg, len, arg);
-
-        jobstatus_to_ascii(je->JobStatus, termstat, sizeof(termstat));
-         len = Mmsg(&msg, _("  Files=%s Bytes=%s Termination Status=%s\n"), 
-             edit_uint64_with_commas(je->JobFiles, b1),
-             edit_uint64_with_commas(je->JobBytes, b2),
-             termstat);
-        sendit(msg, len, arg);
-      }
-      unlock_last_jobs_list();
-#endif
-
    /*
     * List running jobs  
     */
    Dmsg0(1000, "Begin status jcr loop.\n");
    lock_jcr_chain();
-   for (njcr=NULL; (njcr=get_next_jcr(njcr)); ) {
+   foreach_jcr(njcr) {
       bstrftime_nc(dt, sizeof(dt), njcr->start_time);
       if (njcr->JobId == 0) {
          len = Mmsg(&msg, _("Director connected at: %s\n"), dt);
@@ -170,7 +151,7 @@ static void  list_terminated_jobs(void sendit(const char *msg, int len, void *sa
    struct s_last_job *je;
    const char *msg;
 
-   if (last_job.NumJobs == 0) {
+   if (last_jobs->size() == 0) {
       msg = _("No Terminated Jobs.\n"); 
       sendit(msg, strlen(msg), arg);
       return;
@@ -183,7 +164,7 @@ static void  list_terminated_jobs(void sendit(const char *msg, int len, void *sa
    sendit(msg, strlen(msg), arg);
    msg = _("======================================================================\n"); 
    sendit(msg, strlen(msg), arg);
-   for (je=NULL; (je=(s_last_job *)last_jobs->next(je)); ) {
+   foreach_dlist(je, last_jobs) {
       char JobName[MAX_NAME_LENGTH];
       char *termstat;
       char buf[1000];
@@ -368,7 +349,7 @@ char *bac_status(int stat)
    char *termstat = _("Bacula Idle");
 
    bacstat = 0;
-   if (last_job.NumJobs > 0) {
+   if (last_jobs->size() > 0) {
       switch (last_job.JobStatus) {
       case JS_Canceled:
         bacstat = -1;
index 6d03a634c6cb8ada956635b6b2af0d3f22e6cb3f..8cfeceb364c0ca9cb710f167dc35d89048dae9bd 100644 (file)
@@ -265,7 +265,7 @@ struct JCR {
  */
 struct s_last_job {
    dlink link;
-   int NumJobs;
+   int xNumJobs;                      /* no longer used */
    int JobType;
    int JobStatus;
    int JobLevel;
index eb7fab80d38356a37949c44d332e71fab958a2ae..a95d1e5cb44bfb1157b15c9f8fad5770e7980d59 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "bacula.h"
 #include "jcr.h"
+#include <netdb.h>
 
 extern time_t watchdog_time;
 
@@ -496,9 +497,6 @@ bnet_wait_data_intr(BSOCK *bsock, int sec)
 #define NO_DATA        4       /* Valid name, no data record of requested type. */
 #endif
 
-#ifndef HAVE_WIN32
-extern int h_errno;            /* On error has one of the above */
-#endif
 /*
  * Get human readable error for gethostbyname()
  */
index 20f2fe7a8027958e9a2b81eb878aa6102431ac81..5ef6c4fac00fb52924ba8f1ea2fe9c42b6116430 100755 (executable)
@@ -216,7 +216,6 @@ static void free_common_jcr(JCR *jcr)
    case JT_VERIFY:
    case JT_RESTORE:
    case JT_ADMIN:
-      last_job.NumJobs++;
       last_job.JobType = jcr->JobType;
       last_job.JobId = jcr->JobId;
       last_job.VolSessionId = jcr->VolSessionId;
index c2682b2786789af37860c22cb8008550a34437e6..3452ed4c1e12e842d399590b1b232cc0cdcb55bc 100644 (file)
@@ -64,8 +64,8 @@ int status_cmd(JCR *jcr)
    bnet_fsend(user, "\n%s Version: " VERSION " (" BDATE ") %s %s %s\n", my_name,
              HOST_OS, DISTNAME, DISTVER);
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
-   bnet_fsend(user, _("Daemon started %s, %d Job%s run.\n"), dt, last_job.NumJobs,
-        last_job.NumJobs == 1 ? "" : "s");
+   bnet_fsend(user, _("Daemon started %s, %d Job%s run.\n"), dt, last_jobs->size(),
+        last_jobs->size() == 1 ? "" : "s");
 
    /*
     * List terminated jobs
@@ -126,7 +126,7 @@ int status_cmd(JCR *jcr)
    found = 0;
    lock_jcr_chain();
    /* NOTE, we reuse a calling argument jcr. Be warned! */ 
-   for (jcr=NULL; (jcr=get_next_jcr(jcr)); ) {
+   foreach_jcr(jcr) {
       if (jcr->JobStatus == JS_WaitFD) {
          bnet_fsend(user, _("%s Job %s waiting for Client connection.\n"),
            job_type_to_str(jcr->JobType), jcr->Job);
@@ -248,7 +248,7 @@ static void list_terminated_jobs(void *arg)
    struct s_last_job *je;
    char *msg;
 
-   if (last_job.NumJobs == 0) {
+   if (last_jobs->size() == 0) {
       msg = _("No Terminated Jobs.\n"); 
       sendit(msg, strlen(msg), arg);
       return;
@@ -260,7 +260,7 @@ static void list_terminated_jobs(void *arg)
    sendit(msg, strlen(msg), arg);
    msg = _("======================================================================\n"); 
    sendit(msg, strlen(msg), arg);
-   for (je=NULL; (je=(s_last_job *)last_jobs->next(je)); ) {
+   foreach_dlist(je, last_jobs) {
       char JobName[MAX_NAME_LENGTH];
       char *termstat;
       char buf[1000];
index 55693f240227ce3bc34e78f063f12c51320b68ac..4243be713f01b5018f01e2cc1ae60a1a9b3aec61 100644 (file)
@@ -2,8 +2,8 @@
 #undef  VERSION
 #define VERSION "1.33.4"
 #define VSTRING "1"
-#define BDATE   "22 Feb 2004"
-#define LSMDATE "22Feb04"
+#define BDATE   "23 Feb 2004"
+#define LSMDATE "23Feb04"
 
 /* Debug flags */
 #undef  DEBUG