]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/signal.c
Add missing files for xattr and eliminate a few compiler complaints
[bacula/bacula] / bacula / src / lib / signal.c
index 941c6f709185dabd92ab27ee4413f6ea6925410f..1705942275f4b993fd53b1a25e77896f2a91b35c 100644 (file)
@@ -87,12 +87,14 @@ static void dbg_print_bacula()
 {
    char buf[512];
 
-   snprintf(buf, sizeof(buf), "%s/bacula.%d.bactrace", 
-            working_directory, getpid());
+   snprintf(buf, sizeof(buf), "%s/%s.%d.bactrace", 
+            working_directory, my_name, getpid());
    FILE *fp = fopen(buf, "ab") ;
    if (!fp) {
       fp = stderr;
    }
+   
+   fprintf(stderr, "Dumping: %s\n", buf);
 
    /* Print also B_DB and RWLOCK structure 
     * Can add more info about JCR with dbg_jcr_add_hook()
@@ -126,7 +128,10 @@ extern "C" void signal_handler(int sig)
    if (sig == SIGTERM) {
 //    Emsg1(M_TERM, -1, "Shutting down Bacula service: %s ...\n", my_name);
    } else {
-      Emsg2(M_FATAL, -1, _("Bacula interrupted by signal %d: %s\n"), sig, get_signal_name(sig));
+/* ***FIXME*** Display a message without taking any lock in the system
+ *    Emsg2(M_FATAL, -1, _("Bacula interrupted by signal %d: %s\n"), sig, get_signal_name(sig));
+ */
+      fprintf(stderr, _("Bacula interrupted by signal %d: %s\n"), sig, get_signal_name(sig));
    }
 
 #ifdef TRACEBACK
@@ -212,9 +217,9 @@ extern "C" void signal_handler(int sig)
          bmicrosleep(30, 0);
       }
       fprintf(stderr, _("It looks like the traceback worked ...\n"));
+      dbg_print_bacula();
    }
 #endif
-
    exit_handler(sig);
 }