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