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