]> git.sur5r.net Git - bacula/docs/blob - docs/manual/install.tex
Update doc
[bacula/docs] / docs / manual / install.tex
1 %%
2 %%
3
4 \chapter{Installing Bacula}
5 \label{InstallChapter}
6 \index[general]{Bacula!Installing}
7 \index[general]{Installing Bacula}
8
9 In general, you will need the Bacula source release, and if you want to run
10 a Windows client, you will need the Bacula Windows binary release.
11 However, Bacula needs certain third party packages (such as {\bf MySQL},
12 {\bf PostgreSQL}, or {\bf SQLite} to build properly depending on the
13 options you specify.  Normally, {\bf MySQL} and {\bf PostgreSQL} are
14 packages that can be installed on your distribution.  However, if you do
15 not have them, to simplify your task, we have combined a number of these
16 packages into three {\bf depkgs} releases (Dependency Packages).  This can
17 vastly simplify your life by providing you with all the necessary packages
18 rather than requiring you to find them on the Web, load them, and install
19 them.
20
21 \section{Source Release Files}
22 \index[general]{Source Files}
23 \index[general]{Release Files}
24 Beginning with Bacula 1.38.0, the source code has been broken into
25 four separate tar files each corresponding to a different module in
26 the Bacula SVN. The released files are:
27
28 \begin{description}
29 \item [bacula-2.0.3.tar.gz]
30   This is the primary source code release for Bacula. On each
31   release the version number (2.0.3) will be updated.
32
33 \item [bacula-docs-2.0.3.tar.gz]
34   This file contains a copy of the docs directory with the
35   documents prebuild. English HTML directory, single HTML
36   file, and pdf file. The French and German translations
37   are in progress, but are not built.
38
39 \item [bacula-gui-2.0.3.tar.gz]
40   This file contains the non-core GUI programs. Currently,
41   it contains bacula-web, a PHP program for producing management
42   viewing of your Bacula job status in a browser; and bimagemgr
43   a browser program for burning CDROM images with Bacula Volumes.
44
45 \item [bacula-rescue-2.0.0.tar.gz]
46   This is the Bacula Rescue CDROM code. Note, the version number
47   of this package is not tied to the Bacula release version, so
48   it will be different.  Using this code, you can burn a CDROM
49   with your system configuration and containing a statically
50   linked version of the File daemon. This can permit you to easily
51   repartition and reformat your hard disks and reload your
52   system with Bacula in the case of a hard disk failure.
53
54   Note, this package evolves slower than the Bacula source code,
55   so there may not always be a new release of the rescue package when
56   making minor updates to the Bacula code. For example, when releasing
57   Bacula version 2.0.3, the rescue package may still be at version
58   2.0.0 if there were no updates.
59
60 \item [winbacula-2.0.3.exe]
61   This file is the 32 bit Windows installer for installing
62   the Windows client (File daemon) on a Windows machine.
63   This client will also run on 64 bit Windows machines.
64   Beginning with Bacula version 1.39.20, this executable will
65   also optionally load the Win32 Director and the Win32 
66   Storage daemon.
67
68 \end{description}
69
70 \label{upgrading1}
71 \section{Upgrading Bacula}
72 \index[general]{Bacula!Upgrading}
73 \index[general]{Upgrading Bacula}
74 \index[general]{Upgrading}
75
76 If you are upgrading from one Bacula version to another, you should first
77 carefully read the ReleaseNotes of all major versions between your current
78 version and the version to which you are upgrading.  If the Bacula catalog
79 database has been upgraded (as it is almost every major release), you will
80 either need to reinitialize your database starting from scratch (not
81 normally a good idea), or save an ASCII copy of your database, then proceed
82 to upgrade it. If you are upgrading two major versions (e.g. 1.36 to 2.0)
83 then life will be more complicated because you must do two database
84 upgrades. See below for more on this.
85
86 Upgrading the catalog is normally done after Bacula is build and installed
87 by:
88
89 \begin{verbatim}
90 cd <installed-scripts-dir> (default /etc/bacula)
91 ./update_bacula_tables
92 \end{verbatim}
93
94 This update script can also be find in the Bacula source src/cats
95 directory.
96
97 If there are several database upgrades between your version and the
98 version to which you are upgrading, you will need to apply each database
99 upgrade script. For your convenience, you can find all the old upgrade scripts
100 in the {\bf upgradedb} directory of the source code. You will need to edit the
101 scripts to correspond to your system configuration. The final upgrade script,
102 if any, can be applied as noted above.
103
104 If you are upgrading from one major version to another, you will need to
105 replace all your components at the same time as generally the inter-daemon
106 protocol will change. However, within any particular release (e.g. version
107 1.32.x) unless there is an oversight or bug, the daemon protocol will not
108 change. If this is confusing, simply read the ReleaseNotes very carefully as
109 they will note if all daemons must be upgraded at the same time. 
110
111 Finally, please note that in general it is not necessary to do a 
112 {\bf make uninstall} before doing an upgrade providing you are careful
113 not to change the installation directories. In fact, if you do so, you will 
114 most likely delete all your conf files, which could be disastrous.
115 The normal procedure during an upgrade is simply:
116
117 \begin{verbatim}
118 ./configure (your options)
119 make
120 make install
121 \end{verbatim}
122
123 In general none of your existing .conf or .sql files will be overwritten,
124 and you must do both the {\bf make} and {\bf make install}  commands, a
125 {\bf make install} without the preceding {\bf make} will not work.
126   
127 For additional information on upgrading, please see the \ilink{Upgrading Bacula
128 Versions}{upgrading} in the Tips chapter of this manual.
129
130 \section{Releases Numbering}
131 \index[general]{Release Numbering}
132 \index[general]{Version Numbering}
133 Every Bacula release whether beta or production has a different number  
134 as well as the date of the release build. The numbering system follows
135 traditional Open Source conventions in that it is of the form.
136
137 \begin{verbatim}
138 major.minor.release
139 \end{verbatim}
140
141 For example:
142 \begin{verbatim}
143 1.38.11
144 \end{verbatim}
145
146 where each component (major, minor, patch) is a number.
147 The major number is currently 1 and normally does not change
148 very frequently.  The minor number starts at 0 and increases
149 each for each production release by 2 (i.e. it is always an
150 even number for a production release), and the patch number is
151 starts at zero each time the minor number changes.  The patch
152 number is increased each time a bug fix (or fixes) is released
153 to production.
154
155 So, as of this date (10 September 2006), the current production Bacula
156 release is version 1.38.11.  If there are bug fixes, the next release
157 will be 1.38.12 (i.e. the patch number has increased by one).
158
159 For all patch releases where the minor version number does not change,
160 the database and all the daemons will be compatible.  That means that
161 you can safely run a 1.38.0 Director with a 1.38.11 Client.  Of course,
162 in this case, the Director may have bugs that are not fixed. Generally,
163 within a minor release (some minor releases are not so minor), all
164 patch numbers are officially released to production. This means that while
165 the current Bacula version is 1.38.11, versions 1.38.0, 1.38.1, ... 1.38.10
166 have all been previously released.
167
168 When the minor number is odd, it indicates that the package is under 
169 development and thus may not be stable. For example, while the current 
170 production release of Bacula is currently 1.38.11, the current development
171 version is 1.39.22. All patch versions of the development code are 
172 available in the SVN (source repository).  However, not all patch versions
173 of the development code (odd minor version) are officially released. When
174 they are released, they are released as beta versions (see below for a
175 definition of what beta means for Bacula releases).                     
176
177 In general when the minor number increases from one production release
178 to the next (i.e. 1.38.x to 1.40.0), the catalog database must be upgraded,
179 the Director and Storage daemon must always be on the same minor release
180 number, and often (not always), the Clients must also be on the same minor
181 release. As often as possible, we attempt to make new releases that are
182 downwards compatible with prior clients, but this is not always possible.
183 You must check the release notes.  In general, you will have fewer problems
184 if you always run all the components on the same minor version number (i.e.
185 all either 1.38.x or 1.40.x but not mixed).
186
187
188 \label{BetaReleases}
189 \section*{Beta Releases}
190 \index[general]{Beta Releases}
191 Towards the end of the development cycle, which typically runs
192 one year from a major release to another, there will be several beta
193 releases of the development code prior to a production release.  
194 As noted above, beta versions always have odd minor version numbers
195 (e.g 1.37.x or 1.39.x). 
196 The purpose of the beta releases is to allow early adopter users to test
197 the new code.  Beta releases are made with the following considerations:
198
199 \begin{itemize}
200 \item The code passes the regression testing on FreeBSD, Linux, and Solaris
201   machines.
202
203 \item There are no known major bugs, or on the rare occasion that 
204   there are, they will be documented or already in the bugs database.
205
206 \item Some of the new code/features may not yet be tested.
207
208 \item Bugs are expected to be found, especially in the new
209   code before the final production release.
210
211 \item The code will have been run in production in at least one small
212   site (mine).
213
214 \item The Win32 client will have been run in production at least
215   one night at that small site.
216
217 \item The documentation in the manual is unlikely to be complete especially
218   for the new features, and the Release Notes may not be fully
219   organized.
220
221 \item Beta code is not generally recommended for everyone, but
222   rather for early adopters.
223 \end{itemize}
224
225
226 \label{Dependency}
227 \section{Dependency Packages}
228 \index[general]{Dependency Packages}
229 \index[general]{Packages!Dependency}
230
231 As discussed above, we have combined a number of third party packages that
232 Bacula might need into the {\bf depkgs} release. You can,
233 of course, get the latest packages from the original authors or 
234 from your operating system supplier. The locations of
235 where we obtained the packages are in the README file in each package.
236 However, be aware that the packages in the depkgs files have been tested by us
237 for compatibility with Bacula. 
238
239 Typically, a dependency package will be named {\bf depkgs-ddMMMyy.tar.gz}
240 where {\bf dd} is the day we release it, {\bf MMM}
241 is the abbreviated month (e.g. Jan), and {\bf yy} is the year. An actual
242 example is: {\bf depkgs-07Apr02.tar.gz}. To install and build this package (if
243 needed), you do the following: 
244
245 \begin{enumerate}
246 \item Create a {\bf bacula} directory, into which you will place  both the
247    Bacula source as well as the dependency package.  
248 \item Detar the {\bf depkgs} into the {\bf bacula} directory.  
249 \item cd bacula/depkgs  
250 \item make 
251 \end{enumerate}
252
253 Although the exact composition of the dependency packages may change from time
254 to time, the current makeup is the following: 
255
256 \addcontentsline{lot}{table}{Dependency Packages}
257 \begin{longtable}{|l|l|l|}
258  \hline 
259 \multicolumn{1}{|c| }{\bf 3rd Party Package} & \multicolumn{1}{c| }{\bf depkgs}
260      & \multicolumn{1}{c| }{\bf depkgs-qt} \\
261  \hline {SQLite } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{ }\\
262  \hline {SQLite3 } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{ }\\
263  \hline {mtx } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{ } \\
264  \hline {qt4 } & \multicolumn{1}{c| }{ } & \multicolumn{1}{c| }{X } \\
265  \hline {qwt } & \multicolumn{1}{c| }{ } & \multicolumn{1}{c| }{X } \\
266  \hline 
267 \end{longtable}
268
269 Note, some of these packages are quite large, so that building them can be a
270 bit time consuming. The above instructions will build all the packages
271 contained in the directory. However, when building Bacula, it will take only
272 those pieces that it actually needs. 
273
274 Alternatively, you can make just the packages that are needed. For example, 
275
276 \footnotesize
277 \begin{verbatim}
278 cd bacula/depkgs
279 make sqlite
280 \end{verbatim}
281 \normalsize
282
283 will configure and build only the SQLite package. 
284
285 You should build the packages that you will require in {\bf depkgs} a     
286 prior to configuring and building Bacula, since Bacula will need
287 them during the build process. 
288
289 For more information on the {\bf depkgs-qt} package, please read the
290 INSTALL file in the main directory of that package. If you are going to 
291 build Qt4 using {\bf depkgs-qt}, you must source the {\bf qt4-paths} file
292 included in the package prior to building Bacula. Please read the INSTALL
293 file for more details.
294
295 Even if you do not use SQLite, you might find it worthwhile to build {\bf mtx}
296 because the {\bf tapeinfo} program that comes with it can often provide you
297 with valuable information about your SCSI tape drive (e.g. compression,
298 min/max block sizes, ...). Note, most distros provide {\bf mtx} as part of 
299 their release.
300
301 The {\bf depkgs1} package is depreciated and previously contained
302 readline, which should be available on all operating systems.
303
304 The {\bf depkgs-win32} package is deprecated and no longer used in 
305 Bacula version 1.39.x and later. It was previously used to build
306 the native Win32 client program, but this program is now built on Linux
307 systems using cross-compiling.  All the tools and third party libraries
308 are automatically downloaded by executing the appropriate scripts.  See
309 src/win32/README.mingw32 for more details.
310
311 \section{Supported Operating Systems}
312 \label{Systems}
313 \index[general]{Systems!Supported Operating}
314 \index[general]{Supported Operating Systems}
315
316 Please see the 
317 \ilink{ Supported Operating Systems}{SupportedOSes} section
318 of the QuickStart chapter of this manual. 
319
320 \section{Building Bacula from Source}
321 \label{Building}
322 \index[general]{Source!Building Bacula from}
323 \index[general]{Building Bacula from Source}
324
325 The basic installation is rather simple. 
326
327 \begin{enumerate}
328 \item Install and build any {\bf depkgs} as noted above. This
329    should be unnecessary on most modern Operating Systems.
330
331 \item Configure and install MySQL or PostgreSQL (if desired). 
332    \ilink{Installing and Configuring MySQL Phase I}{MySqlChapter} or  
333    \ilink{Installing and Configuring PostgreSQL Phase
334    I}{PostgreSqlChapter}.  If you are installing from rpms, and are
335    using MySQL, please be sure to install  {\bf mysql-devel}, so that the MySQL
336    header files are available  while compiling Bacula. In addition, the MySQL
337    client  library {\bf mysqlclient} requires the gzip compression library  {\bf
338    libz.a} or {\bf libz.so}. If you are using rpm packages,  these libraries are
339    in the {\bf libz-devel} package. On Debian  systems, you will need to load the
340    {\bf zlib1g-dev} package. If  you are not using rpms or debs, you will need to
341    find the  appropriate package for your system.  
342
343    Note, if you already have a running MySQL or PostgreSQL on your system, you 
344    can skip this phase provided that you have built the thread  safe libraries.
345    And you have already installed the additional  rpms noted above.  
346
347    SQLite is not supported on Solaris. This is because it
348    frequently fails with bus errors.  However SQLite3 may work.
349
350 \item Detar the Bacula source code preferably into the {\bf bacula}  directory
351    discussed above.  
352
353 \item {\bf cd} to the directory containing the source code.  
354
355 \item ./configure (with appropriate options as described below). Any
356    path names you specify as options on the ./configure command line
357    must be absolute paths and not relative.
358
359 \item Check the output of ./configure very carefully, especially  the Install
360    binaries and Install config directories.  If they are not correct,
361    please rerun ./configure until they  are. The output from ./configure is
362    stored in {\bf config.out}  and can be re-displayed at any time without
363    rerunning the  ./configure by doing {\bf cat config.out}.  
364
365 \item If after running ./configure once, you decide to change options  and
366    re-run it, that is perfectly fine, but before re-running it,  you should run: 
367
368 \footnotesize
369 \begin{verbatim}
370       make distclean
371 \end{verbatim}
372 \normalsize
373
374 so that you are sure to start from scratch and not have a  mixture of the two
375 options. This is because ./configure  caches much of the information. The {\bf
376 make distclean}  is also critical if you move the source directory from one 
377 machine to another. If the {\bf make distclean} fails,  just ignore it and
378 continue on.  
379
380 \item make  
381    If you get errors while linking in the Storage daemon directory
382    (src/stored), it is probably because you have not loaded the static
383    libraries on your system.  I noticed this problem on a Solaris system.
384    To correct it, make sure that you have not added {\bf
385    {-}{-}enable-static-tools} to the {\bf ./configure} command.
386
387    If you skip this step ({\bf make}) and proceed immediately to the {\bf
388    make install} you are making two serious errors: 1.  your install will
389    fail because Bacula requires a {\bf make} before a {\bf make install}.
390    2.  you are depriving yourself of the chance to make sure there are no
391    errors before beginning to write files to your system directories.
392                                  
393
394 \item make install  
395    Please be sure you have done a {\bf make} before entering this command,
396    and that everything has properly compiled and linked without errors.
397
398
399 \item If you are new to Bacula, we {\bf strongly} recommend that you skip
400    the next step and use the default configuration files, then run the
401    example program in the next chapter, then come back and modify your
402    configuration files to suit your particular needs.
403
404 \item Customize the configuration files for each of the three daemons 
405    (Directory, File, Storage) and for the Console program.  For the details
406    of how to do this, please see \ilink{Setting Up Bacula Configuration
407    Files}{ConfigureChapter} in the Configuration chapter of this manual.  We
408    recommend that you start by modifying the default configuration files
409    supplied, making the minimum changes necessary.  Complete customization
410    can be done after you have Bacula up and running.  Please take care when
411    modifying passwords, which were randomly generated, and the {\bf Name}s
412    as the passwords and names must agree between the configuration files
413    for security reasons.  
414
415 \label{CreateDatabase}
416 \item Create the Bacula MySQL database and tables
417    (if using MySQL)
418       \ilink{Installing and Configuring MySQL Phase II}{mysql_phase2} or 
419       create the Bacula PostgreSQL database and tables  
420    \ilink{Configuring PostgreSQL
421    II}{PostgreSQL_configure} or alternatively  if you are using
422    SQLite \ilink{Installing and Configuring SQLite Phase II}{phase2}.  
423
424 \item Start Bacula ({\bf ./bacula start}) Note. the next chapter  shows you
425    how to do this in detail.  
426
427 \item Interface with Bacula using the Console program  
428
429 \item For the previous two items, please follow the instructions  in the 
430    \ilink{Running Bacula}{TutorialChapter} chapter of  this manual,
431    where you will run a simple backup and do a  restore. Do this before you make
432    heavy modifications to the  configuration files so that you are sure that
433    Bacula works  and are familiar with it. After that changing the conf files 
434    will be easier.  
435
436 \item If after installing Bacula, you decide to "move it", that is  to
437    install it in a different set of directories, proceed  as follows:  
438
439 \footnotesize
440 \begin{verbatim}
441       make uninstall
442       make distclean
443       ./configure (your-new-options)
444       make
445       make install
446       
447 \end{verbatim}
448 \normalsize
449
450 \end{enumerate}
451
452 If all goes well, the {\bf ./configure} will correctly determine which
453 operating system you are running and configure the source code appropriately.
454 Currently, FreeBSD, Linux (Red Hat), and Solaris are supported. The Bacula
455 client (File daemon) is reported to work with MacOS X 10.3 is if 
456 readline support is not enabled (default) when building the client.       
457
458 If you install Bacula on more than one system, and they are identical, you can
459 simply transfer the source tree to that other system and do a "make
460 install". However, if there are differences in the libraries or OS versions,
461 or you wish to install on a different OS, you should start from the original
462 compress tar file. If you do transfer the source tree, and you have previously
463 done a ./configure command, you MUST do: 
464
465 \footnotesize
466 \begin{verbatim}
467 make distclean
468 \end{verbatim}
469 \normalsize
470
471 prior to doing your new ./configure. This is because the GNU autoconf tools
472 cache the configuration, and if you re-use a configuration for a Linux machine
473 on a Solaris, you can be sure your build will fail. To avoid this, as
474 mentioned above, either start from the tar file, or do a "make distclean". 
475
476 In general, you will probably want to supply a more complicated {\bf
477 configure} statement to ensure that the modules you want are built and that
478 everything is placed into the correct directories. 
479
480 For example, on Fedora, Red Hat, or SuSE one could use the following: 
481
482 \footnotesize
483 \begin{verbatim}
484 CFLAGS="-g -Wall" \
485   ./configure \
486     --sbindir=$HOME/bacula/bin \
487     --sysconfdir=$HOME/bacula/bin \
488     --with-pid-dir=$HOME/bacula/bin/working \
489     --with-subsys-dir=$HOME/bacula/bin/working \
490     --with-mysql \
491     --with-working-dir=$HOME/bacula/bin/working \
492     --with-dump-email=$USER
493 \end{verbatim}
494 \normalsize
495
496 Note, the advantage of using the above configuration to start is that
497 everything will be put into a single directory, which you can later delete
498 once you have run the examples in the next chapter and learned how Bacula
499 works. In addition, the above can be installed and run as non-root. 
500
501 For the developer's convenience, I have added a {\bf defaultconfig} script to
502 the {\bf examples} directory. This script contains the statements that you
503 would normally use, and each developer/user may modify them to suit his needs.
504 You should find additional useful examples in this directory as well. 
505
506 The {\bf \verb:--:enable-conio} or {\bf \verb:--:enable-readline} options are useful because
507 they provide a command line history and editing capability for the Console
508 program. If you have included either option in the build, either the {\bf
509 termcap} or the {\bf ncurses} package will be needed to link. On most
510 systems, including Red Hat and SuSE, you should include the ncurses package.
511 If Bacula's configure process finds the ncurses libraries, it will use
512 those rather than the termcap library.
513 On some systems, such as SuSE, the termcap library is not in the standard
514 library directory.  As a consequence, the option may be disabled or you may
515 get an error message such as:
516
517 \footnotesize
518 \begin{verbatim}
519 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/.../ld:
520 cannot find -ltermcap
521 collect2: ld returned 1 exit status
522 \end{verbatim}
523 \normalsize
524
525 while building the Bacula Console. In that case, you will need to set the {\bf
526 LDFLAGS} environment variable prior to building. 
527
528 \footnotesize
529 \begin{verbatim}
530 export LDFLAGS="-L/usr/lib/termcap"
531 \end{verbatim}
532 \normalsize
533
534 The same library requirements apply if you wish to use the readline
535 subroutines for command line editing and history or
536  if you are using a MySQL library that requires encryption. If you need encryption,
537 you can either export the appropriate additional library options as shown
538 above or, alternatively, you can include them directly on the ./configure line
539 as in: 
540
541 \footnotesize
542 \begin{verbatim}
543 LDFLAGS="-lssl -lcyrpto" \
544    ./configure <your-options>
545 \end{verbatim}
546 \normalsize
547
548 On some systems such as Mandriva, readline tends to
549 gobble up prompts, which makes it totally useless. If this happens to you, use
550 the disable option, or if you are using version 1.33 and above try using {\bf
551 \verb:--:enable-conio} to use a built-in readline replacement. You will still need
552 either the termcap or the ncurses library, but it is unlikely that the {\bf conio}
553 package will gobble up prompts. 
554
555 readline is no longer supported after version 1.34.  The code within Bacula
556 remains, so it should be usable, and if users submit patches for it, we will
557 be happy to apply them.  However, due to the fact that each version of
558 readline seems to be incompatible with previous versions, and that there
559 are significant differences between systems, we can no longer afford to
560 support it.
561
562 \section{What Database to Use?}
563 \label{DB}
564 \index[general]{What Database to Use?}
565 \index[general]{Use!What Database to}
566
567 Before building Bacula you need to decide if you want to use SQLite, MySQL, or
568 PostgreSQL. If you are not already running MySQL or PostgreSQL, you might
569 want to start by testing with SQLite (not supported on Solaris).
570 This will greatly simplify the setup for you
571 because SQLite is compiled into Bacula an requires no administration. It
572 performs well and is suitable for small to medium sized installations (maximum
573 10-20 machines). However, we should note that a number of users have
574 had unexplained database corruption with SQLite. For that reason, we
575 recommend that you install either MySQL or PostgreSQL for production
576 work.
577
578 If you wish to use MySQL as the Bacula catalog, please see the 
579 \ilink{Installing and Configuring MySQL}{MySqlChapter} chapter of
580 this manual. You will need to install MySQL prior to continuing with the
581 configuration of Bacula. MySQL is a high quality database that is very
582 efficient and is suitable for any sized installation. It is slightly more
583 complicated than SQLite to setup and administer because it has a number of
584 sophisticated features such as userids and passwords. It runs as a separate
585 process, is truly professional and can manage a database of any size. 
586
587 If you wish to use PostgreSQL as the Bacula catalog, please see the 
588 \ilink{Installing and Configuring PostgreSQL}{PostgreSqlChapter}
589 chapter of this manual. You will need to install PostgreSQL prior to
590 continuing with the configuration of Bacula. PostgreSQL is very similar to
591 MySQL, though it tends to be slightly more SQL92 compliant and has many more
592 advanced features such as transactions, stored procedures, and the such. It
593 requires a certain knowledge to install and maintain. 
594
595 If you wish to use SQLite as the Bacula catalog, please see 
596 \ilink{Installing and Configuring SQLite}{SqlLiteChapter} chapter of
597 this manual. SQLite is not supported on Solaris.
598
599 \section{Quick Start}
600 \index[general]{Quick Start}
601 \index[general]{Start!Quick}
602
603 There are a number of options and important considerations given below
604 that you can skip for the moment if you have not had any problems building
605 Bacula with a simplified configuration as shown above. 
606       
607 If the ./configure process is unable to find specific libraries (e.g.    
608 libintl, you should ensure that the appropriate package is installed on
609 your system. Alternatively, if the package is installed in a non-standard
610 location (as far as Bacula is concerned), then there is generally an
611 option listed below (or listed with "./configure {-}{-}help" that will
612 permit you to specify the directory that should be searched. In other
613 cases, there are options that will permit you to disable to feature 
614 (e.g. {-}{-}disable-nls).
615
616 If you want to dive right into it, we recommend you skip to the next chapter,
617 and run the example program. It will teach you a lot about Bacula and as an
618 example can be installed into a single directory (for easy removal) and run as
619 non-root. If you have any problems or when you want to do a real installation,
620 come back to this chapter and read the details presented below. 
621
622 \section{Configure Options}
623 \label{Options}
624 \index[general]{Options!Configure}
625 \index[general]{Configure Options}
626
627 The following command line options are available for {\bf configure} to
628 customize your installation. 
629
630 \begin{description}
631 \item [ {-}{-}sbindir=\lt{}binary-path\gt{}]
632    \index[general]{{-}{-}sbindir}
633    Defines where the Bacula  binary (executable) files will be placed during a
634    {\bf make  install} command.  
635
636 \item [ {-}{-}sysconfdir=\lt{}config-path\gt{}]
637    \index[general]{{-}{-}sysconfdir}
638    Defines where the Bacula configuration files should be placed during a
639    {\bf make install} command.
640
641 \item [ {-}{-}mandir=\lt{}path\gt{}]
642    \index[general]{{-}{-}mandir}
643    Note, as of Bacula version 1.39.14, the meaning of any path
644    specified on this option is change from prior versions. It
645    now specifies the top level man directory.
646    Previously the mandir specified the full path to where you
647    wanted the man files installed.
648    The man files will be installed in gzip'ed format under
649    mandir/man1 and mandir/man8 as appropriate.
650    For the install to succeed you must have {\bf gzip} installed
651    on your system.
652
653    By default, Bacula will install the Unix man pages in 
654    /usr/share/man/man1 and /usr/share/man/man8.  
655    If you wish the man page to be installed in
656    a different location, use this option to specify the path.
657    Note, the main HTML and PDF Bacula documents are in a separate
658    tar file that is not part of the source distribution.
659
660 \item [ {-}{-}datadir=\lt{}path\gt{} ]
661    \index[general]{{-}{-}datadir}
662    If you translate Bacula or parts of Bacula into a different language
663    you may specify the location of the po files using the {\bf
664    {-}{-}datadir} option. You must manually install any po files as
665    Bacula does not (yet) automatically do so.
666
667 \item [ {-}{-}disable-ipv6 ]
668    \index[general]{{-}{-}disable-ipv6}
669
670 \item [ {-}{-}enable-smartalloc ]
671    \index[general]{{-}{-}enable-smartalloc}
672    This enables the inclusion of the Smartalloc orphaned buffer detection
673    code.  This option is highly recommended.  Because we never build
674    without this option, you may experience problems if it is not enabled.
675    In this case, simply re-enable the option.  We strongly recommend
676    keeping this option enabled as it helps detect memory leaks.  This
677    configuration parameter is used while building Bacula
678
679 \item [ {-}{-}enable-bat ]
680    \label{enablebat}
681    \index[general]{{-}{-}enable-bat}
682    If you have Qt4 >= 4.2 installed on your computer including the
683    libqt4 and libqt4-devel (libqt4-dev on Debian) libraries, and you want
684    to use the Bacula Administration Tool (bat) GUI Console interface to
685    Bacula, you must specify this option.  Doing so will build everything in
686    the {\bf src/qt-console} directory.  In addition to the Qt4 libraries,
687    bat needs the qwt package installed on your system.  Please see the next
688    configure item for the details.
689
690    Qt4 is available on OpenSUSE 10.2, CentOS 5, Fedora, and Debian. If it
691    is not available on your system, you can download the {\bf depkgs-qt}
692    package from the Bacula Source Forge download area and build it and
693    the qwt package, both of which are needed to build bat.  See the
694    INSTALL file in that package for more details. In particular to use
695    the Qt4 built by {\bf depkgs-qt} you {bf must} source the file
696    {\bf qt4-paths}.
697
698 \item [ {-}{-}with-qwt=\lt{}path\gt{} ]
699   \index[general]{{-}{-}with-qwt}
700   To build bat, you need the qwt graphics package installed on
701   your system.  The path specified must be an absolute path and
702   not relative.  
703
704   The qwt package is available for download from
705   the qwt project on Source Forge.  If you wish, you may build and 
706   install it on your system (by default in /usr/lib). 
707   If you have done so, you would specify:
708
709 \begin{verbatim}
710  --with-qwt=/usr/lib/qwt-5.0.2
711 \end{verbatim}
712
713   Alternatively, you can download the Bacula depkgs package (currently
714   version 11Jul07) and build it, then assuming that you have put it 
715   into a directory named bacula, you would specify:
716
717 \begin{verbatim}
718  --with-qwt=$HOME/bacula/depkgs/qwt
719 \end{verbatim}
720
721    Some packages such as Debian do not adhere to the standard of
722    naming the library libqwt.a or libqwt.so, and you will either need
723    to manually add a soft link to the name they use or use the
724    depkgs version, which handles the naming correctly.
725
726
727 \item [ {-}{-}enable-batch-insert ]
728    \index[general]{{-}{-}enable-batch-insert}
729    This option enables batch inserts of the attribute records (default) in
730     the catalog database, which is much faster (10 times or more) than
731    without this option for large numbers of files. However, this option
732    will automatically be disabled if your SQL libraries are not
733    thread safe. SQLite2 is not thread safe, so this option cannot
734    be enabled when using it.  However, on most systems, PostgreSQL,
735    and SQLite3 are thread safe.  Bacula always links to the thread safe
736    MySQL libraries.
737
738    As far as we can determine SQLite2 is not thread safe and so should
739    not be used if you have enabled batch insert in Bacula.
740
741    As a default, Bacula runs SQLite3 with {\bf PRAGMA synchronous=OFF}
742    because it improves performance by more than 30 times. However, it 
743    increases the possibility of a corrupted database. If you want more
744    security, please modify src/version.h appropriately (it should be
745    obvious when you look at the file).
746
747 \item [ {-}{-}enable-gnome ]
748    \index[general]{{-}{-}enable-gnome}
749    If you have GNOME installed on your computer including the
750    GNOME development libraries, and you want to use the
751    GNOME GUI Console interface to Bacula, you must specify this option.
752    Doing so will build everything in the {\bf src/gnome2-console} directory.
753
754 \item [ {-}{-}enable-bwx-console ]
755    \index[general]{{-}{-}enable-bwx-console}
756    If you have wxWidgets installed on your computer and you want to use the
757    wxWidgets GUI Console interface to Bacula, you must specify this option.
758    Doing so will build everything in the {\bf src/wx-console} directory.
759    This could also be useful to users who want a GUI Console and don't want
760    to install GNOME, as wxWidgets can work with GTK+, Motif or even X11
761    libraries.
762
763 \item [ {-}{-}enable-tray-monitor ]
764    \index[general]{{-}{-}enable-tray-monitor}
765    If you have GTK installed on your computer, you run a graphical
766    environment or a window manager compatible with the FreeDesktop system
767    tray standard (like KDE and GNOME) and you want to use a GUI to monitor
768    Bacula daemons, you must specify this option.  Doing so will build
769    everything in the {\bf src/tray-monitor} directory.
770
771 \item [ {-}{-}enable-static-tools]
772    \index[general]{{-}{-}enable-static-tools}
773    This option causes the linker to link the Storage daemon utility tools
774    ({\bf bls}, {\bf bextract}, and {\bf bscan}) statically.  This permits
775    using them without having the shared libraries loaded.  If you have
776    problems linking in the {\bf src/stored} directory, make sure you have
777    not enabled this option, or explicitly disable static linking by adding
778    {\bf \verb:--:disable-static-tools}.
779
780 \item [ {-}{-}enable-static-fd]
781    \index[general]{{-}{-}enable-static-fd}
782    This option causes the make process to build a {\bf static-bacula-fd} in
783    addition to the standard File daemon.  This static version will include
784    statically linked libraries and is required for the Bare Metal recovery.
785    This option is largely superseded by using {\bf make static-bacula-fd}
786    from with in the {\bf src/filed} directory.  Also, the {\bf
787    \verb:--:enable-client-only} option described below is useful for just
788    building a client so that all the other parts of the program are not
789    compiled.   
790      
791    When linking a static binary, the linker needs the static versions
792    of all the libraries that are used, so frequently users will 
793    experience linking errors when this option is used. The first 
794    thing to do is to make sure you have the static glibc library 
795    installed on your system. The second thing to do is the make sure
796    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
797    on your ./configure statement as these options require additional
798    libraries. You may be able to enable those options, but you will
799    need to load additional static libraries.
800
801
802 \item [ {-}{-}enable-static-sd]
803    \index[general]{{-}{-}enable-static-sd}
804    This option causes the make process to build a {\bf static-bacula-sd} in
805    addition to the standard Storage daemon.  This static version will
806    include statically linked libraries and could be useful during a Bare
807    Metal recovery.
808
809    When linking a static binary, the linker needs the static versions
810    of all the libraries that are used, so frequently users will 
811    experience linking errors when this option is used. The first 
812    thing to do is to make sure you have the static glibc library 
813    installed on your system. The second thing to do is the make sure
814    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
815    on your ./configure statement as these options require additional
816    libraries. You may be able to enable those options, but you will
817    need to load additional static libraries.
818
819
820 \item [ {-}{-}enable-static-dir]
821    \index[general]{{-}{-}enable-static-dir}
822    This option causes the make process to build a {\bf static-bacula-dir}
823    in addition to the standard Director.  This static version will include
824    statically linked libraries and could be useful during a Bare Metal
825    recovery.
826
827    When linking a static binary, the linker needs the static versions
828    of all the libraries that are used, so frequently users will 
829    experience linking errors when this option is used. The first 
830    thing to do is to make sure you have the static glibc library 
831    installed on your system. The second thing to do is the make sure
832    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
833    on your ./configure statement as these options require additional
834    libraries. You may be able to enable those options, but you will
835    need to load additional static libraries.
836
837
838 \item [ {-}{-}enable-static-cons]
839    \index[general]{{-}{-}enable-static-cons}
840    This option causes the make process to build a {\bf static-console} and
841    a {\bf static-gnome-console} in addition to the standard console.  This
842    static version will include statically linked libraries and could be
843    useful during a Bare Metal recovery.
844
845    When linking a static binary, the linker needs the static versions
846    of all the libraries that are used, so frequently users will 
847    experience linking errors when this option is used. The first 
848    thing to do is to make sure you have the static glibc library 
849    installed on your system. The second thing to do is the make sure
850    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
851    on your ./configure statement as these options require additional
852    libraries. You may be able to enable those options, but you will
853    need to load additional static libraries.
854
855
856 \item [ {-}{-}enable-client-only]
857    \index[general]{{-}{-}enable-client-only}
858    This option causes the make process to build only the File daemon and
859    the libraries that it needs.  None of the other daemons, storage tools,
860    nor the console will be built.  Likewise a {\bf make install} will then
861    only install the File daemon.  To cause all daemons to be built, you
862    will need to do a configuration without this option.  This option
863    greatly facilitates building a Client on a client only machine.
864
865    When linking a static binary, the linker needs the static versions
866    of all the libraries that are used, so frequently users will 
867    experience linking errors when this option is used. The first 
868    thing to do is to make sure you have the static glibc library 
869    installed on your system. The second thing to do is the make sure
870    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
871    on your ./configure statement as these options require additional
872    libraries. You may be able to enable those options, but you will
873    need to load additional static libraries.
874
875 \item [ {-}{-}enable-build-dird]
876    \index[general]{{-}{-}enable-build-dird}
877    This option causes the make process to build the Director and the
878    Director's tools. By default, this option is on, but you may turn
879    it off by using {\bf {-}{-}disable-build-dird} to prevent the
880    Director from being built.
881
882 \item [ {-}{-}enable-build-stored]
883    \index[general]{{-}{-}enable-build-stored}
884    This option causes the make process to build the Storage daemon.
885    By default, this option is on, but you may turn
886    it off by using {\bf {-}{-}disable-build-stored} to prevent the
887    Storage daemon from being built.
888
889
890 \item [ {-}{-}enable-largefile]
891    \index[general]{{-}{-}enable-largefile}
892    This option (default) causes  Bacula to be built with 64 bit file address
893    support if it  is available on your system. This permits Bacula to read and 
894    write files greater than 2 GBytes in size. You may disable this  feature and
895    revert to 32 bit file addresses by using  {\bf \verb:--:disable-largefile}.  
896
897 \item [ {-}{-}disable-nls]
898    \index[general]{{-}{-}disable-nls}
899    By default, Bacula uses the GNU Native Language Support (NLS) libraries. On
900    some machines, these libraries may not be present or may not function 
901    correctly (especially on non-Linux implementations). In such cases, you
902    may specify {\bf {-}{-}disable-nls} to disable use of those libraries.
903    In such a case, Bacula will revert to using English.
904
905 \item [ {-}{-}disable-ipv6 ]
906    \index[general]{{-}{-}disable-ipv6}
907    By default, Bacula enables IPv6 protocol. On some systems, the files
908    for IPv6 may exist, but the functionality could be turned off in the
909    kernel. In that case, in order to correctly build Bacula, you will
910    explicitly need to use this option so that Bacula does not attempt
911    to reference OS function calls that do not exist.
912
913 \item [ {-}{-}with-sqlite=\lt{}sqlite-path\gt{}]
914    \index[general]{{-}{-}with-sqlite}
915    This enables use of the SQLite version 2.8.x database.  The {\bf
916    sqlite-path} is not normally specified as Bacula looks for the necessary
917    components in a standard location ({\bf depkgs/sqlite}).  See
918    \ilink{Installing and Configuring SQLite}{SqlLiteChapter} chapter of
919     this manual for more details. SQLite is not supported on Solaris.
920
921    See the note below under the {-}{-}with-postgresql item.
922
923 \item [ {-}{-}with-sqlite3=\lt{}sqlite3-path\gt{}]
924    \index[general]{{-}{-}with-sqlite3}
925    This enables use of the SQLite version 3.x database.  The {\bf
926    sqlite3-path} is not normally specified as Bacula looks for the
927    necessary components in a standard location ({\bf depkgs/sqlite3}).  See
928    \ilink{Installing and Configuring SQLite}{SqlLiteChapter} chapter of
929    this manual for more details. SQLite3 is not supported on Solaris.
930
931 \item [ {-}{-}with-mysql=\lt{}mysql-path\gt{}]
932    \index[general]{{-}{-}with-mysql}
933    This enables building of the Catalog services for Bacula.  It assumes
934    that MySQL is running on your system, and expects it to be installed in
935    the {\bf mysql-path} that you specify.  Normally, if MySQL is installed
936    in a standard system location, you can simply use {\bf {-}{-}with-mysql}
937    with no path specification.  If you do use this option, please proceed
938    to installing MySQL in the \ilink{Installing and Configuring
939    MySQL}{MySqlChapter} chapter before proceeding with the configuration.
940
941    See the note below under the {-}{-}with-postgresql item.
942
943 \item [ {-}{-}with-postgresql=\lt{}path\gt{}]
944    \index[general]{{-}{-}with-postgresql}
945    This provides an explicit path to the PostgreSQL libraries if Bacula
946    cannot find it by default.  Normally to build with PostgreSQL, you would
947    simply use {\bf {-}{-}with-postgresql}.
948
949    Note, for Bacula to be configured properly, you must specify one
950    of the four database options supported.  That is:
951    {-}{-}with-sqlite, {-}{-}with-sqlite3, {-}{-}with-mysql, or
952    {-}{-}with-postgresql, otherwise the ./configure will fail.
953
954 \item [ {-}{-}with-openssl=\lt{}path\gt{}]
955    This configuration option is necessary if you want to enable TLS (ssl),
956    which encrypts the communications within       
957    Bacula or if you want to use File Daemon PKI data encryption.
958    Normally, the {\bf path} specification is not necessary since
959    the configuration searches for the OpenSSL libraries in standard system
960    locations. Enabling OpenSSL in Bacula permits secure communications
961    between the daemons and/or data encryption in the File daemon.
962    For more information on using TLS, please see the
963    \ilink{Bacula TLS -- Communications Encryption}{CommEncryption} chapter
964    of this manual.
965    For more information on using PKI data encryption, please see the
966    \ilink{Bacula PKI -- Data Encryption}{DataEncryption}
967    chapter of this manual.
968
969 \item [ {-}{-}with-python=\lt{}path\gt{}]
970    \index[general]{{-}{-}with-python}
971    This option enables Bacula support for Python.  If no path is supplied,
972    configure will search the standard library locations for Python 2.2,
973    2.3, 2.4, or 2.5.  If it cannot find the library, you will need to
974    supply a path to your Python library directory.  Please see the
975    \ilink{Python chapter}{PythonChapter} for the details of using Python
976    scripting.
977
978 \item [ {-}{-}with-libintl-prefix=\lt{}DIR\gt{}]
979    \index[general]{{-}{-}with-libintl-prefix}
980    This option may be used to tell Bacula to search DIR/include and
981    DIR/lib for the libintl headers and libraries needed for Native
982    Language Support (NLS).
983
984 \item [ {-}{-}enable-conio]
985    \index[general]{{-}{-}enable-conio}
986    Tells Bacula to enable building the small, light weight readline
987    replacement routine.  It is generally much easier to configure than
988    readline, although, like readline, it needs either the termcap or
989    ncurses library.
990
991 \item [ {-}{-}with-readline=\lt{}readline-path\gt{}]
992    \index[general]{{-}{-}with-readline}
993    Tells Bacula where {\bf readline} is installed.  Normally, Bacula will
994    find readline if it is in a standard library.  If it is not found and no
995    {-}{-}with-readline is specified, readline will be disabled.  This
996    option affects the Bacula build.  Readline provides the Console program
997    with a command line history and editing capability and is no longer
998    supported, so you are on your own if you have problems.
999
1000 \item [ {-}{-}enable-readline]
1001    \index[general]{{-}{-}enable-readline}
1002    Tells Bacula to enable readline support.  It is normally disabled due to the
1003    large number of configuration  problems and the fact that the package seems to
1004    change in incompatible  ways from version to version.  
1005
1006 \item [ {-}{-}with-tcp-wrappers=\lt{}path\gt{}]
1007    \index[general]{{-}{-}with-tcp-wrappers}
1008    \index[general]{TCP Wrappers}
1009    \index[general]{Wrappers!TCP}
1010    \index[general]{libwrappers}
1011    This specifies that you  want TCP wrappers (man hosts\_access(5)) compiled in.
1012    The path is optional since  Bacula will normally find the libraries in the
1013    standard locations.  This option affects the Bacula build.  In specifying your
1014    restrictions in the {\bf /etc/hosts.allow}  or {\bf /etc/hosts.deny} files, do
1015    not use the {\bf twist}  option (hosts\_options(5)) or the Bacula process will
1016    be terminated. Note, when setting up your {\bf /etc/hosts.allow}
1017    or {\bf /etc/hosts.deny}, you must identify the Bacula daemon in
1018    question with the name you give it in your conf file rather than the
1019    name of the executable.
1020    
1021    For more information on configuring and testing TCP wrappers, please  see the 
1022    \ilink{Configuring and Testing TCP Wrappers}{wrappers}  section
1023    in the Security Chapter.  
1024
1025    On SuSE, the libwrappers libraries needed to link Bacula are
1026    contained in the tcpd-devel package. On Red Hat, the package is named
1027    tcp\_wrappers.
1028
1029 \item [ {-}{-}with-working-dir=\lt{}working-directory-path\gt{} ]
1030    \index[general]{{-}{-}with-working-dir}
1031    This option is mandatory and specifies a directory  into which Bacula may
1032    safely place files that  will remain between Bacula executions. For example, 
1033    if the internal database is used, Bacula will keep  those files in this
1034    directory.  This option is only used to modify the daemon  configuration
1035    files. You may also accomplish the same  thing by directly editing them later.
1036    The working directory  is not automatically created by the install process, so
1037    you  must ensure that it exists before using Bacula for the  first time. 
1038
1039 \item [ {-}{-}with-base-port=\lt{}port=number\gt{}]
1040    \index[general]{{-}{-}with-base-port}
1041    In order to run,  Bacula needs three TCP/IP ports (one for the Bacula 
1042    Console, one for the Storage daemon, and one for the File daemon).  The {\bf
1043    \verb:--:with-baseport} option will automatically assign three  ports beginning at
1044    the base port address specified. You may  also change the port number in the
1045    resulting configuration  files. However, you need to take care that the
1046    numbers  correspond correctly in each of the three daemon configuration 
1047    files. The default base port is 9101, which assigns ports 9101  through 9103.
1048    These ports (9101, 9102, and 9103) have been  officially assigned to Bacula by
1049    IANA.  This option is only used  to modify the daemon configuration files. You
1050    may also accomplish  the same thing by directly editing them later. 
1051
1052 \item [ {-}{-}with-dump-email=\lt{}email-address\gt{}]
1053    \index[general]{{-}{-}with-dump-email}
1054    This option specifies  the email address where any core dumps should be set.
1055    This option  is normally only used by developers.  
1056
1057 \item [ {-}{-}with-pid-dir=\lt{}PATH\gt{}  ]
1058    \index[general]{{-}{-}with-pid-dir}
1059    This specifies where Bacula should place the process id  file during
1060    execution. The default is: {\bf /var/run}.  This directory is not created by
1061    the install process, so  you must ensure that it exists before using Bacula
1062    the  first time.  
1063
1064 \item [ {-}{-}with-subsys-dir=\lt{}PATH\gt{}]
1065    \index[general]{{-}{-}with-subsys-dir}
1066    This specifies where Bacula should place the subsystem lock  file during
1067    execution. The default is {\bf /var/run/subsys}.  Please make sure that you do
1068    not specify the same directory  for this directory and for the {\bf sbindir}
1069    directory.  This directory is used only within the autostart scripts.  The
1070    subsys directory is not created by the Bacula install,  so you must be sure to
1071    create it before using Bacula. 
1072
1073 \item [ {-}{-}with-dir-password=\lt{}Password\gt{}]
1074    \index[general]{{-}{-}with-dir-password}
1075    This option allows you to specify the password used to  access the Director
1076    (normally from the Console program).  If it is not specified, configure will
1077    automatically create a random  password.  
1078
1079 \item [ {-}{-}with-fd-password=\lt{}Password\gt{} ]
1080    \index[general]{{-}{-}with-fd-password}
1081    This option allows you to specify the password used to  access the File daemon
1082    (normally called from the Director).  If it is not specified, configure will
1083    automatically create a random  password.  
1084
1085 \item [ {-}{-}with-sd-password=\lt{}Password\gt{} ]
1086    \index[general]{{-}{-}with-sd-password}
1087    This option allows you to specify the password used to access the Storage daemon
1088    (normally called from the Director).  If it is not specified, configure will
1089    automatically create a random  password.  
1090
1091 \item [ {-}{-}with-dir-user=\lt{}User\gt{} ]
1092    \index[general]{{-}{-}with-dir-user}
1093    This option allows you to specify the Userid used to run the Director.  The
1094    Director must be started as root, but doesn't need to run as root, and
1095    after doing preliminary initializations, it can "drop" to the UserId
1096    specified on this option.  
1097    If you specify this option, you must
1098    create the User prior to running {\bf make install}, because the
1099    working directory owner will be set to {\bf User}.
1100                        
1101 \item [ {-}{-}with-dir-group=\lt{}Group\gt{} ]
1102    \index[general]{{-}{-}with-dir-group}
1103    This option allows you to specify the GroupId used to  run the Director. The
1104    Director must be started as root, but  doesn't need to run as root, and  after
1105    doing preliminary initializations, it can "drop"  to the GroupId specified
1106    on this option. 
1107    If you specify this option, you must
1108    create the Group prior to running {\bf make install}, because the
1109    working directory group will be set to {\bf Group}.
1110
1111 \item [ {-}{-}with-sd-user=\lt{}User\gt{} ]
1112    \index[general]{{-}{-}with-sd-user}
1113    This option allows you to specify the Userid used to  run the Storage daemon.
1114    The Storage daemon must be started as root, but  doesn't need to run as root,
1115    and  after doing preliminary initializations, it can "drop"  to the UserId
1116    specified on this option. If you use this option,  you will need to take care
1117    that the Storage daemon has access  to all the devices (tape drives, ...) that
1118    it needs. 
1119
1120 \item [ {-}{-}with-sd-group=\lt{}Group\gt{} ]
1121    \index[general]{{-}{-}with-sd-group}
1122    This option allows you to specify the GroupId used to  run the Storage daemon.
1123    The Storage daemon must be started as root, but  doesn't need to run as root,
1124    and  after doing preliminary initializations, it can "drop"  to the GroupId
1125    specified on this option. 
1126
1127 \item [ {-}{-}with-fd-user=\lt{}User\gt{} ]
1128    \index[general]{{-}{-}with-fd-user}
1129    This option allows you to specify the Userid used to  run the File daemon. The
1130    File daemon must be started as root,  and in most cases, it needs to run as
1131    root, so this option is  used only in very special cases,  after doing
1132    preliminary initializations, it can "drop"  to the UserId specified on this
1133    option. 
1134
1135 \item [ {-}{-}with-fd-group=\lt{}Group\gt{} ]
1136    \index[general]{{-}{-}with-fd-group}
1137    This option allows you to specify the GroupId used to  run the File daemon.
1138    The File daemon must be started as root, and  in most cases, it must be run as
1139    root, however,  after doing preliminary initializations, it can "drop"  to
1140    the GroupId specified on this option. 
1141
1142 \item [ {-}{-}with-mon-dir-password=\lt{}Password\gt{}]
1143    \index[general]{{-}{-}with-mon-dir-password}
1144    This option allows you to specify the password used to  access the Directory
1145    from the monitor.  If it is not specified, configure will
1146    automatically create a random  password.  
1147
1148 \item [ {-}{-}with-mon-fd-password=\lt{}Password\gt{} ]
1149    \index[general]{{-}{-}with-mon-fd-password}
1150    This option allows you to specify the password used to  access the File daemon
1151    from the Monitor.  If it is not specified, configure will
1152    automatically create a random  password.  
1153
1154 \item [ {-}{-}with-mon-sd-password=\lt{}Password\gt{} ]
1155    \index[general]{{-}{-}with-mon-sd-password}
1156    This option allows you to specify the password used to  access the
1157    Storage daemon from the Monitor. If it is not specified, configure will
1158    automatically create a random  password.  
1159
1160 \item [ {-}{-}with-db-name=\lt{}database-name\gt{} ]
1161    \index[general]{{-}{-}with-db-name}
1162    This option allows you to specify the database name to be used in
1163    the conf files.  The default is bacula.
1164
1165 \item [ {-}{-}with-db-user=\lt{}database-user\gt{} ]
1166    \index[general]{{-}{-}with-db-user}
1167    This option allows you to specify the database user name to be used in
1168    the conf files.  The default is bacula.
1169
1170 \end{description}
1171
1172 Note, many other options are presented when you do a {\bf ./configure
1173 \verb:--:help}, but they are not implemented.
1174
1175 \section{Recommended Options for Most Systems}
1176 \index[general]{Systems!Recommended Options for Most}
1177 \index[general]{Recommended Options for Most Systems}
1178
1179 For most systems, we recommend starting with the following options: 
1180
1181 \footnotesize
1182 \begin{verbatim}
1183 ./configure \
1184   --enable-smartalloc \
1185   --sbindir=$HOME/bacula/bin \
1186   --sysconfdir=$HOME/bacula/bin \
1187   --with-pid-dir=$HOME/bacula/bin/working \
1188   --with-subsys-dir=$HOME/bacula/bin/working \
1189   --with-mysql=$HOME/mysql \
1190   --with-working-dir=$HOME/bacula/working
1191 \end{verbatim}
1192 \normalsize
1193
1194 If you want to install Bacula in an installation directory rather than run it
1195 out of the build directory (as developers will do most of the time), you
1196 should also include the \verb:--:sbindir and \verb:--:sysconfdir options with appropriate
1197 paths. Neither are necessary if you do not use "make install" as is the case
1198 for most development work. The install process will create the sbindir and
1199 sysconfdir if they do not exist, but it will not automatically create the
1200 pid-dir, subsys-dir, or working-dir, so you must ensure that they exist before
1201 running Bacula for the first time.
1202
1203 \section{Red Hat}
1204 \index[general]{Red Hat}
1205
1206 Using SQLite: 
1207
1208 \footnotesize
1209 \begin{verbatim}
1210  
1211 CFLAGS="-g -Wall" ./configure \
1212   --sbindir=$HOME/bacula/bin \
1213   --sysconfdir=$HOME/bacula/bin \
1214   --enable-smartalloc \
1215   --with-sqlite=$HOME/bacula/depkgs/sqlite \
1216   --with-working-dir=$HOME/bacula/working \
1217   --with-pid-dir=$HOME/bacula/bin/working \
1218   --with-subsys-dir=$HOME/bacula/bin/working \
1219   --enable-bat \
1220   --with-qwt=$HOME/bacula/depkgs/qwt \
1221   --enable-conio
1222 \end{verbatim}
1223 \normalsize
1224
1225 or 
1226
1227 \footnotesize
1228 \begin{verbatim}
1229  
1230 CFLAGS="-g -Wall" ./configure \
1231   --sbindir=$HOME/bacula/bin \
1232   --sysconfdir=$HOME/bacula/bin \
1233   --enable-smartalloc \
1234   --with-mysql=$HOME/mysql \
1235   --with-working-dir=$HOME/bacula/working
1236   --with-pid-dir=$HOME/bacula/bin/working \
1237   --with-subsys-dir=$HOME/bacula/bin/working
1238   --enable-gnome \
1239   --enable-conio
1240 \end{verbatim}
1241 \normalsize
1242
1243 or finally, a completely traditional Red Hat Linux install: 
1244
1245 \footnotesize
1246 \begin{verbatim}
1247 CFLAGS="-g -Wall" ./configure \
1248   --prefix=/usr \
1249   --sbindir=/usr/sbin \
1250   --sysconfdir=/etc/bacula \
1251   --with-scriptdir=/etc/bacula \
1252   --enable-smartalloc \
1253   --enable-bat \
1254   --with-qwt=$HOME/bacula/depkgs/qwt \
1255   --with-mysql \
1256   --with-working-dir=/var/bacula \
1257   --with-pid-dir=/var/run \
1258   --enable-conio
1259 \end{verbatim}
1260 \normalsize
1261
1262 Note, Bacula assumes that /var/bacula, /var/run, and /var/lock/subsys exist so
1263 it will not automatically create them during the install process. 
1264
1265 \section{Solaris}
1266 \index[general]{Solaris}
1267
1268 To build Bacula from source, you will need the following installed on your
1269 system (they are not by default): libiconv, gcc 3.3.2, stdc++, libgcc (for
1270 stdc++ and gcc\_s libraries), make 3.8 or later. 
1271
1272 You will probably also need to: Add /usr/local/bin to PATH and Add
1273 /usr/ccs/bin to PATH for ar. 
1274
1275 It is possible to build Bacula on Solaris with the Solaris compiler, but
1276 we recommend using GNU C++ if possible.  
1277
1278 A typical configuration command might look like:
1279
1280 \footnotesize
1281 \begin{verbatim}
1282 #!/bin/sh
1283 CFLAGS="-g" ./configure \
1284   --sbindir=$HOME/bacula/bin \
1285   --sysconfdir=$HOME/bacula/bin \
1286   --with-mysql=$HOME/mysql \
1287   --enable-smartalloc \
1288   --with-pid-dir=$HOME/bacula/bin/working \
1289   --with-subsys-dir=$HOME/bacula/bin/working \
1290   --with-working-dir=$HOME/bacula/working
1291 \end{verbatim}
1292 \normalsize
1293
1294 As mentioned above, the install process will create the sbindir and sysconfdir
1295 if they do not exist, but it will not automatically create the pid-dir,
1296 subsys-dir, or working-dir, so you must ensure that they exist before running
1297 Bacula for the first time.
1298
1299 Note, you may need to install the following packages to build Bacula
1300 from source:
1301 \footnotesize
1302 \begin{verbatim}
1303 SUNWbinutils,
1304 SUNWarc,
1305 SUNWhea,
1306 SUNWGcc,
1307 SUNWGnutls
1308 SUNWGnutls-devel
1309 SUNWGmake
1310 SUNWgccruntime
1311 SUNWlibgcrypt
1312 SUNWzlib
1313 SUNWzlibs
1314 SUNWbinutilsS
1315 SUNWGmakeS
1316 SUNWlibm
1317
1318 export 
1319 PATH=/usr/bin::/usr/ccs/bin:/etc:/usr/openwin/bin:/usr/local/bin:/usr/sfw/bin:/opt/sfw/bin:/usr/ucb:/usr/sbin
1320 \end{verbatim}
1321 \normalsize
1322
1323 If you have installed special software not normally in the Solaris
1324 libraries, such as OpenSSL, or the packages shown above, then you may need
1325 to add {\bf /usr/sfw/lib} to the library search path.  Probably the
1326 simplest way to do so is to run:
1327
1328 \footnotesize
1329 \begin{verbatim}
1330 setenv LDFLAGS "-L/usr/sfw/lib -R/usr/sfw/lib"
1331 \end{verbatim}
1332 \normalsize
1333
1334 Prior to running the ./configure command.
1335
1336 Alternatively, you can set the LD\_LIBARY\_PATH and/or the LD\_RUN\_PATH
1337 environment variables appropriately.
1338
1339 It is also possible to use the {\bf crle} program to set the library
1340 search path.  However, this should be used with caution.
1341
1342 \section{FreeBSD}
1343 \index[general]{FreeBSD}
1344
1345 Please see: 
1346 \elink{The FreeBSD Diary}{http://www.freebsddiary.org/bacula.php} for a
1347 detailed description on how to make Bacula work on your system. In addition,
1348 users of FreeBSD prior to 4.9-STABLE dated Mon Dec 29 15:18:01 2003 UTC who
1349 plan to use tape devices, please see the 
1350 \ilink{Tape Testing Chapter}{FreeBSDTapes} of this manual for
1351 {\bf important} information on how to configure your tape drive for
1352 compatibility with Bacula. 
1353
1354 If you are using Bacula with MySQL, you should take care to compile MySQL with
1355 FreeBSD native threads rather than LinuxThreads, since Bacula is normally built
1356 with FreeBSD native threads rather than LinuxTreads. Mixing the two will
1357 probably not work. 
1358
1359 \section{Win32}
1360 \index[general]{Win32}
1361
1362 To install the binary Win32 version of the File daemon please see the 
1363 \ilink{Win32 Installation Chapter}{Win32Chapter} in this document. 
1364
1365 \section{One File Configure Script}
1366 \index[general]{Script!One File Configure}
1367 \index[general]{One Files Configure Script}
1368
1369 The following script could be used if you want to put everything
1370 in a single file:
1371
1372 \footnotesize
1373 \begin{verbatim}
1374 #!/bin/sh
1375 CFLAGS="-g -Wall" \
1376   ./configure \
1377     --sbindir=$HOME/bacula/bin \
1378     --sysconfdir=$HOME/bacula/bin \
1379     --mandir=$HOME/bacula/bin \
1380     --enable-smartalloc \
1381     --enable-gnome \
1382     --enable-bat \
1383     --with-qwt=$HOME/bacula/depkgs/qwt \
1384     --enable-bwx-console \
1385     --enable-tray-monitor \
1386     --with-pid-dir=$HOME/bacula/bin/working \
1387     --with-subsys-dir=$HOME/bacula/bin/working \
1388     --with-mysql \
1389     --with-working-dir=$HOME/bacula/bin/working \
1390     --with-dump-email=$USER@your-site.com \
1391     --with-job-email=$USER@your-site.com \
1392     --with-smtp-host=mail.your-site.com
1393 exit 0
1394 \end{verbatim}
1395 \normalsize
1396
1397 You may also want to put the following entries in your {\bf /etc/services}
1398 file as it will make viewing the connections made by Bacula easier to
1399 recognize (i.e. netstat -a): 
1400
1401 \footnotesize
1402 \begin{verbatim}
1403 bacula-dir      9101/tcp
1404 bacula-fd       9102/tcp
1405 bacula-sd       9103/tcp
1406 \end{verbatim}
1407 \normalsize
1408
1409 \section{Installing Bacula}
1410 \index[general]{Bacula!Installing}
1411 \index[general]{Installing Bacula}
1412
1413 Before setting up your configuration files, you will want to install Bacula in
1414 its final location. Simply enter: 
1415
1416 \footnotesize
1417 \begin{verbatim}
1418 make install
1419 \end{verbatim}
1420 \normalsize
1421
1422 If you have previously installed Bacula, the old binaries will be overwritten,
1423 but the old configuration files will remain unchanged, and the "new"
1424 configuration files will be appended with a {\bf .new}. Generally if you have
1425 previously installed and run Bacula you will want to discard or ignore the
1426 configuration files with the appended {\bf .new}. 
1427
1428 \section{Building a File Daemon or Client}
1429 \index[general]{Client!Building a File Daemon or}
1430 \index[general]{Building a File Daemon or Client}
1431
1432 If you run the Director and the Storage daemon on one machine and you wish to
1433 back up another machine, you must have a copy of the File daemon for that
1434 machine. If the machine and the Operating System are identical, you can simply
1435 copy the Bacula File daemon binary file {\bf bacula-fd} as well as its
1436 configuration file {\bf bacula-fd.conf} then modify the name and password in
1437 the conf file to be unique. Be sure to make corresponding additions to the
1438 Director's configuration file ({\bf bacula-dir.conf}). 
1439
1440 If the architecture or the OS level are different, you will need to build a
1441 File daemon on the Client machine. To do so, you can use the same {\bf
1442 ./configure} command as you did for your main program, starting either from a
1443 fresh copy of the source tree, or using {\bf make\ distclean} before the {\bf
1444 ./configure}. 
1445
1446 Since the File daemon does not access the Catalog database, you can remove
1447 the {\bf \verb:--:with-mysql} or {\bf \verb:--:with-sqlite} options, then
1448 add {\bf \verb:--:enable-client-only}.  This will compile only the
1449 necessary libraries and the client programs and thus avoids the necessity
1450 of installing one or another of those database programs to build the File
1451 daemon.  With the above option, you simply enter {\bf make} and just the
1452 client will be built.
1453
1454 \label{autostart}
1455 \section{Auto Starting the Daemons}
1456 \index[general]{Daemons!Auto Starting the}
1457 \index[general]{Auto Starting the Daemons}
1458
1459 If you wish the daemons to be automatically started and stopped when your
1460 system is booted (a good idea), one more step is necessary. First, the
1461 ./configure process must recognize your system -- that is it must be a
1462 supported platform and not {\bf unknown}, then you must install the platform
1463 dependent files by doing: 
1464
1465 \footnotesize
1466 \begin{verbatim}
1467 (become root)
1468 make install-autostart
1469 \end{verbatim}
1470 \normalsize
1471
1472 Please note, that the auto-start feature is implemented only on systems
1473 that we officially support (currently, FreeBSD, Red Hat/Fedora Linux, and
1474 Solaris), and has only been fully tested on Fedora Linux.
1475
1476 The {\bf make install-autostart} will cause the appropriate startup scripts
1477 to be installed with the necessary symbolic links.  On Red Hat/Fedora Linux
1478 systems, these scripts reside in {\bf /etc/rc.d/init.d/bacula-dir} {\bf
1479 /etc/rc.d/init.d/bacula-fd}, and {\bf /etc/rc.d/init.d/bacula-sd}.  However
1480 the exact location depends on what operating system you are using.
1481
1482 If you only wish to install the File daemon, you may do so with: 
1483
1484 \footnotesize
1485 \begin{verbatim}
1486 make install-autostart-fd
1487 \end{verbatim}
1488 \normalsize
1489
1490 \section{Other Make Notes}
1491 \index[general]{Notes!Other Make}
1492 \index[general]{Other Make Notes}
1493
1494 To simply build a new executable in any directory, enter: 
1495
1496 \footnotesize
1497 \begin{verbatim}
1498 make
1499 \end{verbatim}
1500 \normalsize
1501
1502 To clean out all the objects and binaries (including the files named 1, 2, or
1503 3, which are development temporary files), enter: 
1504
1505 \footnotesize
1506 \begin{verbatim}
1507 make clean
1508 \end{verbatim}
1509 \normalsize
1510
1511 To really clean out everything for distribution, enter: 
1512
1513 \footnotesize
1514 \begin{verbatim}
1515 make distclean
1516 \end{verbatim}
1517 \normalsize
1518
1519 note, this cleans out the Makefiles and is normally done from the top level
1520 directory to prepare for distribution of the source. To recover from this
1521 state, you must redo the {\bf ./configure} in the top level directory, since
1522 all the Makefiles will be deleted. 
1523
1524 To add a new file in a subdirectory, edit the Makefile.in in that directory,
1525 then simply do a {\bf make}. In most cases, the make will rebuild the Makefile
1526 from the new Makefile.in. In some case, you may need to issue the {\bf make} a
1527 second time. In extreme cases, cd to the top level directory and enter: {\bf
1528 make Makefiles}. 
1529
1530 To add dependencies: 
1531
1532 \footnotesize
1533 \begin{verbatim}
1534 make depend
1535 \end{verbatim}
1536 \normalsize
1537
1538 The {\bf make depend} appends the header file dependencies for each of the
1539 object files to Makefile and Makefile.in. This command should be done in each
1540 directory where you change the dependencies. Normally, it only needs to be run
1541 when you add or delete source or header files. {\bf make depend} is normally
1542 automatically invoked during the configuration process. 
1543
1544 To install: 
1545
1546 \footnotesize
1547 \begin{verbatim}
1548 make install
1549 \end{verbatim}
1550 \normalsize
1551
1552 This not normally done if you are developing Bacula, but is used if you are
1553 going to run it to backup your system. 
1554
1555 After doing a {\bf make install} the following files will be installed on your
1556 system (more or less). The exact files and location (directory) for each file
1557 depends on your {\bf ./configure} command (e.g. bgnome-console and
1558 bgnome-console.conf are not installed if you do not configure GNOME. Also, if
1559 you are using SQLite instead of MySQL, some of the files will be different). 
1560
1561 \footnotesize
1562 \begin{verbatim}
1563 bacula
1564 bacula-dir
1565 bacula-dir.conf
1566 bacula-fd
1567 bacula-fd.conf
1568 bacula-sd
1569 bacula-sd.conf
1570 bacula-tray-monitor
1571 tray-monitor.conf
1572 bextract
1573 bls
1574 bscan
1575 btape
1576 btraceback
1577 btraceback.gdb
1578 bconsole
1579 bconsole.conf
1580 create_mysql_database
1581 dbcheck
1582 delete_catalog_backup
1583 drop_bacula_tables
1584 drop_mysql_tables
1585 fd
1586 bgnome-console
1587 bgnome-console.conf
1588 make_bacula_tables
1589 make_catalog_backup
1590 make_mysql_tables
1591 mtx-changer
1592 query.sql
1593 bsmtp
1594 startmysql
1595 stopmysql
1596 bwx-console
1597 bwx-console.conf
1598 9 man pages
1599 \end{verbatim}
1600 \normalsize
1601
1602 \label{monitor}
1603
1604 \section{Installing Tray Monitor}
1605 \index[general]{Monitor!Installing Tray}
1606 \index[general]{Installing Tray Monitor}
1607
1608 The Tray Monitor is already installed if you used the {\bf
1609 \verb:--:enable-tray-monitor} configure option and ran {\bf make install}.
1610
1611 As you don't run your graphical environment as root (if you do, you should
1612 change that bad habit), don't forget to allow your user to read {\bf
1613 tray-monitor.conf}, and to execute {\bf bacula-tray-monitor} (this is not a
1614 security issue).
1615
1616 Then log into your graphical environment (KDE, GNOME or something else), run
1617 {\bf bacula-tray-monitor} as your user, and see if a cassette icon appears
1618 somewhere on the screen, usually on the task bar.
1619 If it doesn't, follow the instructions below related to your environment or
1620 window manager. 
1621
1622 \subsection{GNOME}
1623 \index[general]{GNOME}
1624
1625 System tray, or notification area if you use the GNOME terminology, has been
1626 supported in GNOME since version 2.2. To activate it, right-click on one of
1627 your panels, open the menu {\bf Add to this Panel}, then {\bf Utility} and
1628 finally click on {\bf Notification Area}. 
1629
1630 \subsection{KDE}
1631 \index[general]{KDE}
1632
1633 System tray has been supported in KDE since version 3.1. To activate it,
1634 right-click on one of your panels, open the menu {\bf Add}, then {\bf Applet}
1635 and finally click on {\bf System Tray}. 
1636
1637 \subsection{Other window managers}
1638 \index[general]{Managers!Other window}
1639 \index[general]{Other window managers}
1640
1641 Read the documentation to know if the Freedesktop system tray standard is
1642 supported by your window manager, and if applicable, how to activate it. 
1643
1644 \section{Modifying the Bacula Configuration Files}
1645 \index[general]{Modifying the Bacula Configuration Files}
1646 \index[general]{Files!Modifying the Bacula Configuration}
1647
1648 See the chapter 
1649 \ilink{Configuring Bacula}{ConfigureChapter} in this manual for
1650 instructions on how to set Bacula configuration files.