]> git.sur5r.net Git - bacula/bacula/commitdiff
Make status dir report all runs + close unused fd in bpipe.c
authorKern Sibbald <kern@sibbald.com>
Thu, 23 Oct 2003 10:58:10 +0000 (10:58 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 23 Oct 2003 10:58:10 +0000 (10:58 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@759 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/ChangeLog
bacula/ReleaseNotes
bacula/autoconf/configure.in
bacula/configure
bacula/kernstodo
bacula/src/dird/protos.h
bacula/src/dird/ua_output.c
bacula/src/dird/ua_status.c
bacula/src/lib/bpipe.c
bacula/src/version.h

index 563d42267b9596f5b0539b38d1c41c0745aae25c..7a2b9e1c4cc38a906a4cee072cc218a008fa1b2f 100644 (file)
@@ -1,5 +1,11 @@
 
-2003-10-15 Version 1.32b 20Oct03 Beta
+2003-10-15 Version 1.32c 22Oct03 Beta
+23Oct03
+- Correct a typo in configure.in when configuring GNOME.
+- In doing a "status dir" make it loop over all the run
+  commands in the Schedule rather than doing on the first one.
+- Close all unused file descriptors in bpipe.c otherwise if
+  a daemon is started, it will keep our TCP/IP port open.
 22Oct03
 - Print block read error (checksum, I/O, BB01, ...) once then
   the number found at the end of the reading.
index f9ef8d92fb29710cb1de0fea859150115b9ec0af..af1ed109d5038667a613a0404e4e3c903b241ad4 100644 (file)
@@ -11,6 +11,8 @@ Most Significant Changes since 1.32b
 - Implemented VerifyJob record that tells Verify which
   job to verify (JobId not required).
 - First cut Verify Disk to Catalog
+- Fix "status dir" to examine all run commands in sched.
+- Close unused file descriptors in bpipe.c
 
 Most Significant Changes since 1.32a:
 - Improve forward space file/block during restore, many
index 8ec3a6c17fa28f11999e5d965bc05cdfb5b5667d..8a1050ac29fe4a6e711ca03d92b9cf79a79a49fe 100644 (file)
@@ -172,7 +172,7 @@ if test x$support_gnome = xyes; then
   pkg=$?
   if test $pkg = 0; then
      GNOME_INCLUDEDIR=`pkg-config --cflags-only-I libgnomeui-2.0`
-     GNOMEUI_LIBS=`pkg-config --libs-only-other libgnomeui-2.0`
+     GNOMEUI_LIBS=`pkg-config --libs-only libgnomeui-2.0`
      GNOME_LIBDIR=`pkg-config --libs libgnomeui-2.0`
      GNOME_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
      AC_SUBST(GNOME_INCLUDEDIR)
index ed3d85bb9b4af9ca84ada75c0e7cfdbc4d90d9b5..97e611b3988f8c5548014c003fbe017a232aaddf 100755 (executable)
@@ -4341,7 +4341,7 @@ if test x$support_gnome = xyes; then
   pkg=$?
   if test $pkg = 0; then
      GNOME_INCLUDEDIR=`pkg-config --cflags-only-I libgnomeui-2.0`
-     GNOMEUI_LIBS=`pkg-config --libs-only-other libgnomeui-2.0`
+     GNOMEUI_LIBS=`pkg-config --libs-only libgnomeui-2.0`
      GNOME_LIBDIR=`pkg-config --libs libgnomeui-2.0`
      GNOME_LIBS=`pkg-config --libs-only-l libgnomeui-2.0`
 
index bada35994b5933c4251536036ee66a6d08cfb647..883876f4f1c100b88c2982ea9c185226df0fc705 100644 (file)
@@ -40,12 +40,12 @@ For 1.33 Testing/Documentation:
 - Document verify_disk_to_catalog
                 
 For 1.32c
-- If last Full back is purged and an Incremental or Differential remains,
-  Bacula does not promote the Incremental to a Full.
-- Finish implementation of Verify=DiskToCatalog
 - Add VerifyJob to "run" summary (yes/mod/no) prompt.
 
 For 1.33
+- Finish implementation of Verify=DiskToCatalog
+- Change console to bconsole.
+- Change smtp to bsmtp.
 - Add device name to "Current Volume not acceptable because ..."
 - Make sure that Bacula rechecks the tape after the 20 min wait.
 - Set IO_NOWAIT on Bacula TCP/IP packets.
@@ -1061,4 +1061,6 @@ Done: (see kernsdone for more)
 - Figure out a way to move Volumes from one pool to another.
 - Implement a RunAfterFailedJob
 - Limit the number of block checksum/header BB01, ... errors printed.
+- If last Full back is purged and an Incremental or Differential remains,
+  Bacula does not promote the Incremental to a Full.
 
index 911bab1a10f668a028eee907bdf96a193c56dc6c..30d0dd7ac6f164e33066c86c026113985952310c 100644 (file)
@@ -62,7 +62,7 @@ int variable_expansion(JCR *jcr, char *inp, POOLMEM **exp);
 
 /* fd_cmds.c */
 extern int connect_to_file_daemon(JCR *jcr, int retry_interval,
-                                  int max_retry_time, int verbose);
+                                 int max_retry_time, int verbose);
 extern int send_include_list(JCR *jcr);
 extern int send_exclude_list(JCR *jcr);
 extern int send_bootstrap_file(JCR *jcr);
@@ -70,7 +70,7 @@ extern int send_level_command(JCR *jcr);
 extern int get_attributes_and_put_in_catalog(JCR *jcr);
 extern int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId);
 extern int put_file_into_catalog(JCR *jcr, long file_index, char *fname, 
-                          char *link, char *attr, int stream);
+                         char *link, char *attr, int stream);
 extern void get_level_since_time(JCR *jcr, char *since, int since_len);
 extern int send_run_before_and_after_commands(JCR *jcr);
 
@@ -93,7 +93,7 @@ extern void mount_request(JCR *jcr, BSOCK *bs, char *buf);
 
 /* msgchan.c */
 extern int connect_to_storage_daemon(JCR *jcr, int retry_interval,    
-                              int max_retry_time, int verbose);
+                             int max_retry_time, int verbose);
 extern int start_storage_daemon_job(JCR *jcr);
 extern int start_storage_daemon_message_thread(JCR *jcr);
 extern int bget_dirmsg(BSOCK *bs);
@@ -132,7 +132,7 @@ int is_volume_name_legal(UAContext *ua, char *name);
 /* ua_output.c */
 void prtit(void *ctx, char *msg);
 int complete_jcr_for_job(JCR *jcr, JOB *job, POOL *pool);
-RUN *find_next_run(JOB *job, time_t &runtime);
+RUN *find_next_run(RUN *run, JOB *job, time_t &runtime);
 
 /* ua_server.c */
 void bsendmsg(void *sock, char *fmt, ...);
@@ -140,28 +140,28 @@ UAContext *new_ua_context(JCR *jcr);
 void free_ua_context(UAContext *ua);
 
 /* ua_select.c */
-STORE   *select_storage_resource(UAContext *ua);
-JOB     *select_job_resource(UAContext *ua);
-JOB     *select_restore_job_resource(UAContext *ua);
-CLIENT  *select_client_resource(UAContext *ua);
+STORE  *select_storage_resource(UAContext *ua);
+JOB    *select_job_resource(UAContext *ua);
+JOB    *select_restore_job_resource(UAContext *ua);
+CLIENT *select_client_resource(UAContext *ua);
 FILESET *select_fileset_resource(UAContext *ua);
-int     select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
-int     select_media_dbr(UAContext *ua, MEDIA_DBR *mr);
-int     select_pool_dbr(UAContext *ua, POOL_DBR *pr);
-int     select_client_dbr(UAContext *ua, CLIENT_DBR *cr);
-
-void    start_prompt(UAContext *ua, char *msg);
-void    add_prompt(UAContext *ua, char *prompt);
-int     do_prompt(UAContext *ua, char *automsg, char *msg, char *prompt, int max_prompt);
-CAT    *get_catalog_resource(UAContext *ua);           
+int    select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
+int    select_media_dbr(UAContext *ua, MEDIA_DBR *mr);
+int    select_pool_dbr(UAContext *ua, POOL_DBR *pr);
+int    select_client_dbr(UAContext *ua, CLIENT_DBR *cr);
+
+void   start_prompt(UAContext *ua, char *msg);
+void   add_prompt(UAContext *ua, char *prompt);
+int    do_prompt(UAContext *ua, char *automsg, char *msg, char *prompt, int max_prompt);
+CAT    *get_catalog_resource(UAContext *ua);          
 STORE  *get_storage_resource(UAContext *ua, int use_default);
-int     get_media_type(UAContext *ua, char *MediaType, int max_media);
-int     get_pool_dbr(UAContext *ua, POOL_DBR *pr);
-int     get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
+int    get_media_type(UAContext *ua, char *MediaType, int max_media);
+int    get_pool_dbr(UAContext *ua, POOL_DBR *pr);
+int    get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
 POOL   *get_pool_resource(UAContext *ua);
 POOL   *select_pool_resource(UAContext *ua);
 CLIENT *get_client_resource(UAContext *ua);
-int     get_job_dbr(UAContext *ua, JOB_DBR *jr);
+int    get_job_dbr(UAContext *ua, JOB_DBR *jr);
 
 int find_arg_keyword(UAContext *ua, char **list);
 int find_arg(UAContext *ua, char *keyword);
index 35f019567e9749f0483119317cc25e837afcff92..2ddd2dc38122d20d01442dfd7f4a3097ed59b548 100644 (file)
@@ -390,20 +390,21 @@ static int do_list_cmd(UAContext *ua, char *cmd, e_list_type llist)
               }
            }
         }
-        run = find_next_run(job, runtime);
-        pool = run ? run->pool : NULL;
-        if (!complete_jcr_for_job(jcr, job, pool)) {
-           return 1;
-        }
-          
-        if (!find_next_volume_for_append(jcr, &mr, 0)) {
-            bsendmsg(ua, "Could not find next Volume\n");
-           db_close_database(jcr, jcr->db);
-           jcr->db = NULL;
-           return 1;
-        } else {
-            bsendmsg(ua, "The next Volume to be used by Job \"%s\" will be %s\n", 
-              job->hdr.name, mr.VolumeName);
+        for (run=NULL; (run = find_next_run(run, job, runtime)); ) {
+           pool = run ? run->pool : NULL;
+           if (!complete_jcr_for_job(jcr, job, pool)) {
+              return 1;
+           }
+             
+           if (!find_next_volume_for_append(jcr, &mr, 0)) {
+               bsendmsg(ua, "Could not find next Volume\n");
+              db_close_database(jcr, jcr->db);
+              jcr->db = NULL;
+              return 1;
+           } else {
+               bsendmsg(ua, "The next Volume to be used by Job \"%s\" will be %s\n", 
+                 job->hdr.name, mr.VolumeName);
+           }
         }
         db_close_database(jcr, jcr->db);
         jcr->db = NULL;
@@ -418,10 +419,9 @@ static int do_list_cmd(UAContext *ua, char *cmd, e_list_type llist)
  * For a given job, we examine all his run records
  *  to see if it is scheduled today or tomorrow.
  */
-RUN *find_next_run(JOB *job, time_t &runtime)
+RUN *find_next_run(RUN *run, JOB *job, time_t &runtime)
 {
    time_t now, tomorrow;
-   RUN *run;
    SCHED *sched;
    struct tm tm;
    int mday, wday, month, wpos, tmday, twday, tmonth, twpos, i, hour;
@@ -449,7 +449,12 @@ RUN *find_next_run(JOB *job, time_t &runtime)
    tmonth = tm.tm_mon;
    twpos  = (tm.tm_mday - 1) / 7;
 
-   for (run=sched->run; run; run=run->next) {
+   if (run == NULL) {
+      run = sched->run;
+   } else {
+      run = run->next;
+   }
+   if (run) {
       /* 
        * Find runs in next 24 hours
        */
index d2eddedcb9783c188c5001ad7a153f4f3e311052..53942dae9b7fc208e84179e5522932a3531eea0b 100644 (file)
@@ -452,19 +452,17 @@ static void print_jobs_scheduled(UAContext *ua)
    /* Loop through all jobs */
    LockRes();
    for (job=NULL; (job=(JOB *)GetNextRes(R_JOB, (RES *)job)); ) {
-      level = job->level;   
-      run = find_next_run(job, runtime);
-      if (!run) {
-        continue;
-      }
-      if (run->level) {
-        level = run->level;
-      }
-      if (!hdr_printed) {
-        hdr_printed = true;
-        prt_runhdr(ua);
+      for (run=NULL; (run = find_next_run(run, job, runtime)); ) {
+        level = job->level;   
+        if (run->level) {
+           level = run->level;
+        }
+        if (!hdr_printed) {
+           hdr_printed = true;
+           prt_runhdr(ua);
+        }
+        prt_runtime(ua, job, level, runtime, run->pool);
       }
-      prt_runtime(ua, job, level, runtime, run->pool);
 
    } /* end for loop over resources */
    UnlockRes();
index a44290b75d61912f4c3a35343bbe2ff616cc6624..1501e18d2c41fd4b8333e709ebaaf5591e2c69b7 100644 (file)
@@ -92,6 +92,9 @@ BPIPE *open_bpipe(char *prog, int wait, char *mode)
         dup2(readp[1], 1);           /* dup our read to his stdout */
         dup2(readp[1], 2);           /*   and his stderr */
       }
+      for (int i=3; i<=32; i++) {     /* close any open file descriptors */
+        close(i);
+      }
       execvp(bargv[0], bargv);       /* call the program */
       exit(errno);                    /* shouldn't get here */
 
index 8dbfcbbc6ea37a703b5407f5ce9c334a137d11a8..500a14a2009c6e107502b28dc32284877ef9f95a 100644 (file)
@@ -2,8 +2,8 @@
 #undef  VERSION
 #define VERSION "1.32c"
 #define VSTRING "1"
-#define BDATE   "20 Oct 2003"
-#define LSMDATE "20Oct03"
+#define BDATE   "22 Oct 2003"
+#define LSMDATE "22Oct03"
 
 /* Debug flags */
 #undef  DEBUG