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