]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/dird.c
Fix bug #1367 by creating an empty query.sql file
[bacula/bacula] / bacula / src / dird / dird.c
index 5793342192023e62820ebe77f367abcecbb82f2d..2e3a4c7ce01cd6536a5f34093d8e89f1ae195f54 100644 (file)
@@ -31,7 +31,6 @@
  *
  *     Kern Sibbald, March MM
  *
- *   Version $Id$
  */
 
 #include "bacula.h"
@@ -74,7 +73,7 @@ void store_migtype(LEX *lc, RES_ITEM *item, int index, int pass);
 void init_device_resources();
 
 static char *runjob = NULL;
-static int background = 1;
+static bool background = true;
 static void init_reload(void);
 static CONFIG *config;
  
@@ -116,6 +115,7 @@ PROG_COPYRIGHT
 "       -dt         print timestamp in debug output\n"
 "       -f          run in foreground (for debugging)\n"
 "       -g          groupid\n"
+"       -m          print kaboom output for debugging)\n"
 "       -r <job>    run <job> now\n"
 "       -s          no signals\n"
 "       -t          test - read configuration and exit\n"
@@ -130,7 +130,7 @@ PROG_COPYRIGHT
 
 /*********************************************************************
  *
- *         Main Bacula Server program
+ *         Main Bacula Director Server program
  *
  */
 #if defined(HAVE_WIN32)
@@ -163,7 +163,7 @@ int main (int argc, char *argv[])
 
    console_command = run_console_command;
 
-   while ((ch = getopt(argc, argv, "c:d:fg:r:stu:v?")) != -1) {
+   while ((ch = getopt(argc, argv, "c:d:fg:mr:stu:v?")) != -1) {
       switch (ch) {
       case 'c':                    /* specify config file */
          if (configfile != NULL) {
@@ -185,13 +185,17 @@ int main (int argc, char *argv[])
          break;
 
       case 'f':                    /* run in foreground */
-         background = FALSE;
+         background = false;
          break;
 
       case 'g':                    /* set group id */
          gid = optarg;
          break;
 
+      case 'm':                    /* print kaboom output */
+         prt_kaboom = true;
+         break;
+
       case 'r':                    /* run job */
          if (runjob != NULL) {
             free(runjob);
@@ -325,7 +329,7 @@ int main (int argc, char *argv[])
 
    init_job_server(director->MaxConcurrentJobs);
 
-   dbg_jcr_add_hook(_dbg_print_db); /* used to debug B_DB connexion after fatal signal */
+   dbg_jcr_add_hook(dbg_print_db); /* used to debug B_DB connexion after fatal signal */
 
 //   init_device_resources();
 
@@ -954,6 +958,12 @@ static bool check_catalog(cat_op mode)
          OK = false;
          continue;
       }
+      
+      /* Display a message if the db max_connections is too low */
+      if (!db_check_max_connections(NULL, db, director->MaxConcurrentJobs+1)) {
+         Pmsg1(000, "Warning, settings problem for Catalog=%s\n", catalog->name());
+         Pmsg1(000, "%s", db_strerror(db));
+      }
 
       /* we are in testing mode, so don't touch anything in the catalog */
       if (mode == CHECK_CONNECTION) {