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