Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > df754e4e6f7f5fc8ab9d6ed8559f3e3d > files > 275

bacula-docs-5.0.3-19.fc16.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>What To Do When Bacula Crashes (Kaboom)</TITLE>
<META NAME="description" CONTENT="What To Do When Bacula Crashes (Kaboom)">
<META NAME="keywords" CONTENT="problems">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="problems.css">

<LINK REL="next" HREF="GNU_Free_Documentation_Lice.html">
<LINK REL="previous" HREF="Dealing_with_Firewalls.html">
<LINK REL="up" HREF="Bacula_Problem_Resolution_G.html">
<LINK REL="next" HREF="GNU_Free_Documentation_Lice.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html372"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html366"
  HREF="Bacula_Problem_Resolution_G.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html360"
  HREF="Dealing_with_Firewalls.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html368"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html370"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html373"
  HREF="GNU_Free_Documentation_Lice.html">GNU Free Documentation License</A>
<B> Up:</B> <A NAME="tex2html367"
  HREF="Bacula_Problem_Resolution_G.html">Bacula Problem Resolution Guide</A>
<B> Previous:</B> <A NAME="tex2html361"
  HREF="Dealing_with_Firewalls.html">Dealing with Firewalls</A>
 &nbsp; <B>  <A NAME="tex2html369"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html371"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html374"
  HREF="What_Do_When_Bacula.html#SECTION00610000000000000000">Traceback</A>
<LI><A NAME="tex2html375"
  HREF="What_Do_When_Bacula.html#SECTION00620000000000000000">Testing The Traceback</A>
<LI><A NAME="tex2html376"
  HREF="What_Do_When_Bacula.html#SECTION00630000000000000000">Getting A Traceback On Other Systems</A>
<LI><A NAME="tex2html377"
  HREF="What_Do_When_Bacula.html#SECTION00640000000000000000">Manually Running Bacula Under The Debugger</A>
<LI><A NAME="tex2html378"
  HREF="What_Do_When_Bacula.html#SECTION00650000000000000000">Getting Debug Output from Bacula</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION00600000000000000000"></A>
<A NAME="KaboomChapter"></A>
<BR>
What To Do When Bacula Crashes (Kaboom)
</H1>
<A NAME="3057"></A>
<A NAME="3058"></A>

<P>
If you are running on a Linux system, and you have a set of working
configuration files, it is very unlikely that <B>Bacula</B> will crash. As with
all software, however, it is inevitable that someday, it may crash,
particularly if you are running on another operating system or using a new or
unusual feature. 

<P>
This chapter explains what you should do if one of the three <B>Bacula</B>
daemons (Director, File, Storage) crashes.  When we speak of crashing, we 
mean that the daemon terminates abnormally because of an error.  There are
many cases where Bacula detects errors (such as PIPE errors) and will fail 
a job. These are not considered crashes.  In addition, under certain
conditions, Bacula will detect a fatal in the configuration, such as 
lack of permission to read/write the working directory. In that case,
Bacula will force itself to crash with a SEGFAULT. However, before
crashing, Bacula will normally display a message indicating why.    
For more details, please read on.

<P>

<H1><A NAME="SECTION00610000000000000000">
Traceback</A>
</H1>
<A NAME="3062"></A>

<P>
Each of the three Bacula daemons has a built-in exception handler which, in
case of an error, will attempt to produce a traceback. If successful the
traceback will be emailed to you. 

<P>
For this to work, you need to ensure that a few things are setup correctly on
your system: 

<P>

<OL>
<LI>You must have a version of Bacula built with debug information turned
   on and not stripped of debugging symbols.

<P>
</LI>
<LI>You must have an installed copy of <B>gdb</B> (the GNU debugger),  and it
   must be on <B>Bacula's</B> path. On some systems such as Solaris, <B>   gdb</B> may be replaced by <B>dbx</B>.

<P>
</LI>
<LI>The Bacula installed script file <B>btraceback</B> must  be in the same
   directory as the daemon which dies, and it must  be marked as executable.  

<P>
</LI>
<LI>The script file <B>btraceback.gdb</B> must  have the correct  path to it
   specified in the <B>btraceback</B> file.  

<P>
</LI>
<LI>You must have a <B>mail</B> program which is on <B>Bacula's</B>  path. 
   By default, this <B>mail</B> program is set to <B>bsmtp</B>, so it must
   be correctly configured.

<P>
</LI>
<LI>If you run either the Director or Storage daemon under a non-root
   userid, you will most likely need to modify the <B>btraceback</B> file
   to do something like <B>sudo</B> (raise to root priority) for the       
   call to <B>gdb</B> so that it has the proper permissions to debug
   Bacula.
</LI>
</OL>

<P>
If all the above conditions are met, the daemon that crashes will produce a
traceback report and email it to you. If the above conditions are not true,
you can either run the debugger by hand as described below, or you may be able
to correct the problems by editing the <B>btraceback</B> file. I recommend not
spending too much time on trying to get the traceback to work as it can be
very difficult. 

<P>
The changes that might be needed are to add a correct path to the <B>gdb</B>
program, correct the path to the <B>btraceback.gdb</B> file, change the <B>mail</B> program or its path, or change your email address. The key line in the
<B>btraceback</B> file is: 

<P>
<PRE>
gdb -quiet -batch -x /home/kern/bacula/bin/btraceback.gdb \
     $1 $2 2&gt;\&amp;1 | bsmtp -s "Bacula traceback" your-address@xxx.com
</PRE>
<P>
Since each daemon has the same traceback code, a single btraceback file is
sufficient if you are running more than one daemon on a machine. 

<P>

<H1><A NAME="SECTION00620000000000000000">
Testing The Traceback</A>
</H1>
<A NAME="3087"></A>
<A NAME="3088"></A>

<P>
To "manually" test the traceback feature, you simply start <B>Bacula</B> then
obtain the <B>PID</B> of the main daemon thread (there are multiple threads).
The output produced here will look different depending on what OS and what
version of the kernel you are running.
Unfortunately, the output had to be split to fit on this page: 

<P>
<PRE>
[kern@rufus kern]$ ps fax --columns 132 | grep bacula-dir
 2103 ?        S      0:00 /home/kern/bacula/k/src/dird/bacula-dir -c
                                       /home/kern/bacula/k/src/dird/dird.conf
 2104 ?        S      0:00  \_ /home/kern/bacula/k/src/dird/bacula-dir -c
                                       /home/kern/bacula/k/src/dird/dird.conf
 2106 ?        S      0:00      \_ /home/kern/bacula/k/src/dird/bacula-dir -c
                                       /home/kern/bacula/k/src/dird/dird.conf
 2105 ?        S      0:00      \_ /home/kern/bacula/k/src/dird/bacula-dir -c
                                       /home/kern/bacula/k/src/dird/dird.conf
</PRE>
<P>
which in this case is 2103. Then while Bacula is running, you call the program
giving it the path to the Bacula executable and the <B>PID</B>. In this case,
it is: 

<P>
<PRE>
./btraceback /home/kern/bacula/k/src/dird 2103
</PRE>
<P>
It should produce an email showing you the current state of the daemon (in
this case the Director), and then exit leaving <B>Bacula</B> running as if
nothing happened. If this is not the case, you will need to correct the
problem by modifying the <B>btraceback</B> script. 

<P>
Typical problems might be that <B>gdb</B> or <B>dbx</B> for Solaris is not on
the default path.  Fix this by specifying the full path to it in the <B>btraceback</B> file.  Another common problem is that you haven't modified the
script so that the <B>bsmtp</B> program has an appropriate smtp server or
the proper syntax for your smtp server.  If you use the <B>mail</B> program
and it is not on the default path, it will also fail.  On some systems, it
is preferable to use <B>Mail</B> rather than <B>mail</B>.

<P>

<H1><A NAME="SECTION00630000000000000000">
Getting A Traceback On Other Systems</A>
</H1>
<A NAME="3106"></A>
<A NAME="3107"></A>

<P>
It should be possible to produce a similar traceback on systems other than
Linux, either using <B>gdb</B> or some other debugger. Solaris with <B>dbx</B>
loaded works quite fine. On other systems, you will need to modify the <B>btraceback</B> program to invoke the correct debugger, and possibly correct the
<B>btraceback.gdb</B> script to have appropriate commands for your debugger. If
anyone succeeds in making this work with another debugger, please send us a
copy of what you modified. Please keep in mind that for any debugger to
work, it will most likely need to run as root, so you may need to modify
the <B>btraceback</B> script accordingly.

<P>
<A NAME="ManuallyDebugging"></A>
<H1><A NAME="SECTION00640000000000000000">
Manually Running Bacula Under The Debugger</A>
</H1>
<A NAME="3115"></A>
<A NAME="3116"></A>

<P>
If for some reason you cannot get the automatic traceback, or if you want to
interactively examine the variable contents after a crash, you can run Bacula
under the debugger. Assuming you want to run the Storage daemon under the
debugger (the technique is the same for the other daemons, only the name
changes), you would do the following: 

<P>

<OL>
<LI>Start the Director and the File daemon. If the  Storage daemon also
   starts, you will need to find its PID  as shown above (ps fax | grep
   bacula-sd) and kill it  with a command like the following:  

<P>
<PRE>
      kill -15 PID
</PRE>
<P>
where you replace <B>PID</B> by the actual value. 

<P>
</LI>
<LI>At this point, the Director and the File daemon should  be running but
   the Storage daemon should not.  

<P>
</LI>
<LI>cd to the directory containing the Storage daemon  

<P>
</LI>
<LI>Start the Storage daemon under the debugger:  

<P>
<PRE>
    gdb ./bacula-sd
</PRE>
<P>
</LI>
<LI>Run the Storage daemon:  

<P>
<PRE>
     run -s -f -c ./bacula-sd.conf
</PRE>
<P>
You may replace the <B>./bacula-sd.conf</B> with the full path  to the Storage
daemon's configuration file.  

<P>
</LI>
<LI>At this point, Bacula will be fully operational.  

<P>
</LI>
<LI>In another shell command window, start the Console program  and do what
   is necessary to cause Bacula to die.  

<P>
</LI>
<LI>When Bacula crashes, the <B>gdb</B> shell window will  become active and
   <B>gdb</B> will show you the error that  occurred.  

<P>
</LI>
<LI>To get a general traceback of all threads, issue the following  command:

<P>
<PRE>
       thread apply all bt
</PRE>
<P>
After that you can issue any debugging command. 
</LI>
</OL>

<P>

<H1><A NAME="SECTION00650000000000000000">
Getting Debug Output from Bacula</A>
</H1>
<A NAME="3132"></A>
Each of the daemons normally has debug compiled into the program, but
disabled. There are two ways to enable the debug output. One is to add the
<B>-d nnn</B> option on the command line when starting the debugger. The <B>nnn</B> is the debug level, and generally anything between 50 and 200 is
reasonable. The higher the number, the more output is produced. The output is
written to standard output. 

<P>
The second way of getting debug output is to dynamically turn it on using the
Console using the <B>setdebug</B> command. The full syntax of the command is: 

<P>
<PRE>
 setdebug level=nnn client=client-name storage=storage-name dir
</PRE>
<P>
If none of the options are given, the command will prompt you. You can
selectively turn on/off debugging in any or all the daemons (i.e. it is not
necessary to specify all the components of the above command). 

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html372"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html366"
  HREF="Bacula_Problem_Resolution_G.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html360"
  HREF="Dealing_with_Firewalls.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html368"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html370"
  HREF="GNU_Free_Documentation_Lice.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html373"
  HREF="GNU_Free_Documentation_Lice.html">GNU Free Documentation License</A>
<B> Up:</B> <A NAME="tex2html367"
  HREF="Bacula_Problem_Resolution_G.html">Bacula Problem Resolution Guide</A>
<B> Previous:</B> <A NAME="tex2html361"
  HREF="Dealing_with_Firewalls.html">Dealing with Firewalls</A>
 &nbsp; <B>  <A NAME="tex2html369"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html371"
  HREF="GNU_Free_Documentation_Lice.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2012-01-24
</ADDRESS>
</BODY>
</HTML>