]> git.sur5r.net Git - bacula/docs/blob - docs/manual/install.tex
bead1456a31705121a583b88a10db8a45c5e5223
[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 \subsection*{Dependency Packages}
215 \label{Dependency}
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
249 depkgs } & \multicolumn{1} \\
250  \hline {SQLite } & \multicolumn{1}{c| }{X } & \multicolumn{1} \\
251  \hline {SQLite3 } & \multicolumn{1}{c| }{X } & \multicolumn{1} \\
252  \hline {mtx } & \multicolumn{1}{c| }{X } & \multicolumn{1} \\
253  \hline 
254
255 \end{longtable}
256
257 Note, some of these packages are quite large, so that building them can be a
258 bit time consuming. The above instructions will build all the packages
259 contained in the directory. However, when building Bacula, it will take only
260 those pieces that it actually needs. 
261
262 Alternatively, you can make just the packages that are needed. For example, 
263
264 \footnotesize
265 \begin{verbatim}
266 cd bacula/depkgs
267 make sqlite
268 \end{verbatim}
269 \normalsize
270
271 will configure and build only the SQLite package. 
272
273 You should build the packages that you will require in {\bf depkgs} a     
274 prior to configuring and building Bacula, since Bacula will need
275 them during the build process. 
276
277 Even if you do not use SQLite, you might find it worthwhile to build {\bf mtx}
278 because the {\bf tapeinfo} program that comes with it can often provide you
279 with valuable information about your SCSI tape drive (e.g. compression,
280 min/max block sizes, ...). Note, most distros provide {\bf mtx} as part of 
281 their release.
282
283 The {\bf depkgs1} package is depreciated and previously contained
284 readline, which should be available on all operating systems.
285
286 The {\bf depkgs-win32} package is deprecated and no longer used in 
287 Bacula version 1.39.x and later. It was previously used to build
288 the native Win32 client program, but this program is now built on Linux
289 systems using cross-compiling.  All the tools and third party libraries
290 are automatically downloaded by executing the appropriate scripts.  See
291 src/win32/README.mingw32 for more details.
292
293 \subsection*{Supported Operating Systems}
294 \label{Systems}
295 \index[general]{Systems!Supported Operating }
296 \index[general]{Supported Operating Systems }
297 \addcontentsline{toc}{subsection}{Supported Operating Systems}
298
299 Please see the 
300 \ilink{ Supported Operating Systems}{SupportedOSes} section
301 of the QuickStart chapter of this manual. 
302
303 \subsection*{Building Bacula from Source}
304 \label{Building}
305 \index[general]{Source!Building Bacula from }
306 \index[general]{Building Bacula from Source }
307 \addcontentsline{toc}{subsection}{Building Bacula from Source}
308
309 The basic installation is rather simple. 
310
311 \begin{enumerate}
312 \item Install and build any {\bf depkgs} as noted above. This
313    should be unnecessary on most modern Operating Systems.
314 \item Configure and install MySQL or PostgreSQL (if desired). 
315    \ilink{Installing and Configuring MySQL Phase I}{_ChapterStart} or  
316    \ilink{Installing and Configuring PostgreSQL Phase
317    I}{_ChapterStart10}.  If you are installing from rpms, and are
318    using MySQL, please be sure to install  {\bf mysql-devel}, so that the MySQL
319    header files are available  while compiling Bacula. In addition, the MySQL
320    client  library {\bf mysqlclient} requires the gzip compression library  {\bf
321    libz.a} or {\bf libz.so}. If you are using rpm packages,  these libraries are
322    in the {\bf libz-devel} package. On Debian  systems, you will need to load the
323    {\bf zlib1g-dev} package. If  you are not using rpms or debs, you will need to
324    find the  appropriate package for your system.  
325
326    Note, if you already have a running MySQL or PostgreSQL on your system, you 
327    can skip this phase provided that you have built the thread  safe libraries.
328    And you have already installed the additional  rpms noted above.  
329
330 \item As an alternative to MySQL and PostgreSQL, configure and install SQLite,
331     which is part of the {\bf depkgs} and also available with most modern
332     Operating Systems.
333    \ilink{Installing and Configuring SQLite}{_ChapterStart33}. SQLite is
334    probably not suited to a fair size production environment because it
335    tends to be slow compared to MySQL and it has few or poor tools for
336    repairing database damage.
337      
338 \item Detar the Bacula source code preferably into the {\bf bacula}  directory
339    discussed above.  
340
341 \item {\bf cd} to the directory containing the source code.  
342
343 \item ./configure (with appropriate options as described below)  
344
345 \item Check the output of ./configure very carefully, especially  the Install
346    binaries and Install config directories.  If they are not correct,
347    please rerun ./configure until they  are. The output from ./configure is
348    stored in {\bf config.out}  and can be re-displayed at any time without
349    rerunning the  ./configure by doing {\bf cat config.out}.  
350
351 \item If after running ./configure once, you decide to change options  and
352    re-run it, that is perfectly fine, but before re-running it,  you should run: 
353
354
355 \footnotesize
356 \begin{verbatim}
357       make distclean
358 \end{verbatim}
359 \normalsize
360
361 so that you are sure to start from scratch and not have a  mixture of the two
362 options. This is because ./configure  caches much of the information. The {\bf
363 make distclean}  is also critical if you move the source directory from one 
364 machine to another. If the {\bf make distclean} fails,  just ignore it and
365 continue on.  
366
367 \item make  
368 \begin{verbatim}
369
370 \end{verbatim}
371    If you get errors while linking in the Storage daemon directory
372    (src/stored), it is probably because you have not loaded the static
373    libraries on your system.  I noticed this problem on a Solaris system.
374    To correct it, make sure that you have not added {\bf
375    {-}{-}enable-static-tools} to the {\bf ./configure} command.
376
377    If you skip this step ({\bf make}) and proceed immediately to the {\bf
378    make install} you are making two serious errors: 1.  your install will
379    fail because Bacula requires a {\bf make} before a {\bf make install}.
380    2.  you are depriving yourself of the chance to make sure there are no
381    errors before beginning to write files to your system directories.
382                                  
383
384 \item make install  
385    Please be sure you have done a {\bf make} before entering this command,
386    and that everything has properly compiled and linked without errors.
387
388
389 \item If you are new to Bacula, we {\bf strongly} recommend that you skip
390    the next step and use the default configuration files, then run the
391    example program in the next chapter, then come back and modify your
392    configuration files to suit your particular needs.
393
394 \item Customize the configuration files for each of the three daemons 
395    (Directory, File, Storage) and for the Console program.  For the details
396    of how to do this, please see \ilink{Setting Up Bacula Configuration
397    Files}{_ChapterStart16} in the Configuration chapter of this manual.  We
398    recommend that you start by modifying the default configuration files
399    supplied, making the minimum changes necessary.  Complete customization
400    can be done after you have Bacula up and running.  Please take care when
401    modifying passwords, which were randomly generated, and the {\bf Name}s
402    as the passwords and names must agree between the configuration files
403    for security reasons.  
404
405 \item Create the Bacula MySQL database and tables
406    (if using MySQL)
407       \ilink{Installing and Configuring MySQL Phase II}{mysql_phase2} or 
408       create the Bacula PostgreSQL database and tables  
409    \ilink{Installing and Configuring PostgreSQL Phase
410    II}{PostgreSQL_phase2} or alternatively  if you are using
411    SQLite  
412    \ilink{Installing and Configuring SQLite Phase II}{phase2}.  
413
414 \item Start Bacula ({\bf ./bacula start}) Note. the next chapter  shows you
415    how to do this in detail.  
416
417 \item Interface with Bacula using the Console program  
418
419 \item For the previous two items, please follow the instructions  in the 
420    \ilink{Running Bacula}{_ChapterStart1} chapter of  this manual,
421    where you will run a simple backup and do a  restore. Do this before you make
422    heavy modifications to the  configuration files so that you are sure that
423    Bacula works  and are familiar with it. After that changing the conf files 
424    will be easier.  
425
426 \item If after installing Bacula, you decide to "move it", that is  to
427    install it in a different set of directories, proceed  as follows:  
428
429 \footnotesize
430 \begin{verbatim}
431       make uninstall
432       make distclean
433       ./configure (your-new-options)
434       make
435       make install
436       
437 \end{verbatim}
438 \normalsize
439
440 \end{enumerate}
441
442 If all goes well, the {\bf ./configure} will correctly determine which
443 operating system you are running and configure the source code appropriately.
444 Currently, FreeBSD, Linux (RedHat), and Solaris are supported. MacOS X 10.3 is
445 reported to work with the Client only as long as readline support is disabled.
446
447
448 If you install Bacula on more than one system, and they are identical, you can
449 simply transfer the source tree to that other system and do a "make
450 install". However, if there are differences in the libraries or OS versions,
451 or you wish to install on a different OS, you should start from the original
452 compress tar file. If you do transfer the source tree, and you have previously
453 done a ./configure command, you MUST do: 
454
455 \footnotesize
456 \begin{verbatim}
457 make distclean
458 \end{verbatim}
459 \normalsize
460
461 prior to doing your new ./configure. This is because the GNU autoconf tools
462 cache the configuration, and if you re-use a configuration for a Linux machine
463 on a Solaris, you can be sure your build will fail. To avoid this, as
464 mentioned above, either start from the tar file, or do a "make distclean". 
465
466 In general, you will probably want to supply a more complicated {\bf
467 configure} statement to ensure that the modules you want are built and that
468 everything is placed into the correct directories. 
469
470 For example, on Fedora, RedHat, or SuSE one could use the following: 
471
472 \footnotesize
473 \begin{verbatim}
474 CFLAGS="-g -Wall" \
475   ./configure \
476     --sbindir=$HOME/bacula/bin \
477     --sysconfdir=$HOME/bacula/bin \
478     --with-pid-dir=$HOME/bacula/bin/working \
479     --with-subsys-dir=$HOME/bacula/bin/working \
480     --with-mysql \
481     --with-working-dir=$HOME/bacula/bin/working \
482     --with-dump-email=$USER
483 \end{verbatim}
484 \normalsize
485
486 Note, the advantage of using the above configuration to start is that
487 everything will be put into a single directory, which you can later delete
488 once you have run the examples in the next chapter and learned how Bacula
489 works. In addition, the above can be installed and run as non-root. 
490
491 For the developer's convenience, I have added a {\bf defaultconfig} script to
492 the {\bf examples} directory. This script contains the statements that you
493 would normally use, and each developer/user may modify them to suit his needs.
494 You should find additional useful examples in this directory as well. 
495
496 The {\bf \verb:--:enable-conio} or {\bf \verb:--:enable-readline} options are useful because
497 they provide a command line history and editing capability for the Console
498 program. If you have included either option in the build, either the {\bf
499 termcap} or the {\bf ncurses} package will be needed to link. On most
500 systems, including RedHat and SuSE, you should include the ncurses package.
501 If Bacula's configure process finds the ncurses libraries, it will use
502 those rather than the termcap library.
503 On some systems, such as SuSE, the termcap library is not in the standard
504 library directory.  As a consequence, the option may be disabled or you may
505 get an error message such as:
506
507 \footnotesize
508 \begin{verbatim}
509 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/.../ld:
510 cannot find -ltermcap
511 collect2: ld returned 1 exit status
512 \end{verbatim}
513 \normalsize
514
515 while building the Bacula Console. In that case, you will need to set the {\bf
516 LDFLAGS} environment variable prior to building. 
517
518 \footnotesize
519 \begin{verbatim}
520 export LDFLAGS="-L/usr/lib/termcap"
521 \end{verbatim}
522 \normalsize
523
524 The same library requirements apply if you wish to use the readline
525 subroutines for command line editing and history or
526  if you are using a MySQL library that requires encryption. If you need encryption,
527 you can either export the appropriate additional library options as shown
528 above or, alternatively, you can include them directly on the ./configure line
529 as in: 
530
531 \footnotesize
532 \begin{verbatim}
533 LDFLAGS="-lssl -lcyrpto" \
534    ./configure <your-options>
535 \end{verbatim}
536 \normalsize
537
538 On some systems such as Mandriva, readline tends to
539 gobble up prompts, which makes it totally useless. If this happens to you, use
540 the disable option, or if you are using version 1.33 and above try using {\bf
541 \verb:--:enable-conio} to use a built-in readline replacement. You will still need
542 either the termcap or the ncurses library, but it is unlikely that the {\bf conio}
543 package will gobble up prompts. 
544
545 readline is no longer supported after version 1.34.  The code within Bacula
546 remains, so it should be usable, and if users submit patches for it, we will
547 be happy to apply them.  However, due to the fact that each version of
548 readline seems to be incompatible with previous versions, and that there
549 are significant differences between systems, we can no longer afford to
550 support it.
551
552 \subsection*{What Database to Use?}
553 \label{DB}
554 \index[general]{What Database to Use? }
555 \index[general]{Use!What Database to }
556 \addcontentsline{toc}{subsection}{What Database to Use?}
557
558 Before building Bacula you need to decide if you want to use SQLite, MySQL, or
559 PostgreSQL. If you are not already running MySQL or PostgreSQL, you might
560 want to start by testing with SQLite. This will greatly simplify the setup for you
561 because SQLite is compiled into Bacula an requires no administration. It
562 performs well and is suitable for small to medium sized installations (maximum
563 10-20 machines). However, we should note that a number of users have
564 had unexplained database corruption with SQLite. For that reason, we
565 recommend that you install either MySQL or PostgreSQL for production
566 work.
567
568 If you wish to use MySQL as the Bacula catalog, please see the 
569 \ilink{Installing and Configuring MySQL}{_ChapterStart} chapter of
570 this manual. You will need to install MySQL prior to continuing with the
571 configuration of Bacula. MySQL is a high quality database that is very
572 efficient and is suitable for any sized installation. It is slightly more
573 complicated than SQLite to setup and administer because it has a number of
574 sophisticated features such as userids and passwords. It runs as a separate
575 process, is truly professional and can manage a database of any size. 
576
577 If you wish to use PostgreSQL as the Bacula catalog, please see the 
578 \ilink{Installing and Configuring PostgreSQL}{_ChapterStart10}
579 chapter of this manual. You will need to install PostgreSQL prior to
580 continuing with the configuration of Bacula. PostgreSQL is very similar to
581 MySQL, though it tends to be slightly more SQL92 compliant and has many more
582 advanced features such as transactions, stored procedures, and the such. It
583 requires a certain knowledge to install and maintain. 
584
585 If you wish to use SQLite as the Bacula catalog, please see 
586 \ilink{Installing and Configuring SQLite}{_ChapterStart33} chapter of
587 this manual. 
588
589 \subsection*{Quick Start}
590 \index[general]{Quick Start }
591 \index[general]{Start!Quick }
592 \addcontentsline{toc}{subsection}{Quick Start}
593
594 There are a number of options and important considerations given below
595 that you can skip for the moment if you have not had any problems building
596 Bacula with a simplified configuration as shown above. 
597       
598 If the ./configure process is unable to find specific libraries (e.g.    
599 libintl, you should ensure that the appropriate package is installed on
600 your system. Alternatively, if the package is installed in a non-standard
601 location (as far as Bacula is concerned), then there is generally an
602 option listed below (or listed with "./configure {-}{-}help" that will
603 permit you to specify the directory that should be searched. In other
604 cases, there are options that will permit you to disable to feature 
605 (e.g. {-}{-}disable-nls).
606
607 If you want to dive right into it, we recommend you skip to the next chapter,
608 and run the example program. It will teach you a lot about Bacula and as an
609 example can be installed into a single directory (for easy removal) and run as
610 non-root. If you have any problems or when you want to do a real installation,
611 come back to this chapter and read the details presented below. 
612
613 \subsection*{Configure Options}
614 \label{Options}
615 \index[general]{Options!Configure }
616 \index[general]{Configure Options }
617 \addcontentsline{toc}{subsection}{Configure Options}
618
619 The following command line options are available for {\bf configure} to
620 customize your installation. 
621
622 \begin{description}
623 \item [ {-}{-}sysbindir=\lt{}binary-path\gt{}]
624    \index[general]{{-}{-}sysbindir }
625    Defines where the Bacula  binary (executable) files will be placed during a
626    {\bf make  install} command.  
627
628 \item [ {-}{-}sysconfdir=\lt{}config-path\gt{}]
629    \index[general]{{-}{-}sysconfdir }
630    Defines where the Bacula configuration files should be placed during a
631    {\bf make install} command.
632
633 \item [ {-}{-}mandir=\lt{}path\gt{}]
634    \index[general]{{-}{-}mandir}
635    Note, as of Bacula version 1.39.14, the meaning of any path
636    specified is now changed to mean the top level man directory.
637    Previously the mandir specified the full path to where you
638    wanted the man files installed.
639    The man files will be installed in gzip'ed format under
640    mandir/man1 and mandir/man8 as appropriate.
641    For the install to succeed you must have {\bf gzip} installed
642    on your system.
643
644    By default, Bacula will install the Unix man pages in 
645    /usr/share/man/man1 and /usr/share/man/man8.  
646    If you wish the man page to be installed in
647    a different location, use this option to specify the path.
648    Note, the main HTML and PDF Bacula documents are in a separate
649    tar file that is not part of the source distribution.
650
651 \item [ {-}{-}datadir=\lt{}path\gt{}]
652    \index[general]{{-}{-}datadir}
653    If you translate Bacula or parts of Bacula into a different language
654    you may specify the location of the po files using the {\bf
655    {-}{-}datadir} option. You must manually install any po files as
656    Bacula does not (yet) automatically do so.
657
658
659 \item [ {-}{-}enable-smartalloc ]
660    \index[general]{{-}{-}enable-smartalloc }
661    This enables the inclusion of the Smartalloc orphaned buffer detection
662    code.  This option is highly recommended.  Because we never build
663    without this option, you may experience problems if it is not enabled.
664    In this case, simply re-enable the option.  We strongly recommend
665    keeping this option enabled as it helps detect memory leaks.  This
666    configuration parameter is used while building Bacula
667
668 \item [ {-}{-}enable-gnome ]
669    \index[general]{{-}{-}enable-gnome }
670    If you have GNOME installed on your computer including the
671    gnome development libraries, and you want to use the
672    GNOME GUI Console interface to Bacula, you must specify this option.
673    Doing so will build everything in the {\bf src/gnome-console} directory.
674
675 \item [ {-}{-}enable-wx-console ]
676    \index[general]{{-}{-}enable-wx-console }
677    If you have wxWidgets installed on your computer and you want to use the
678    wxWidgets GUI Console interface to Bacula, you must specify this option.
679    Doing so will build everything in the {\bf src/wx-console} directory.
680    This could also be useful to users who want a GUI Console and don't want
681    to install Gnome, as wxWidgets can work with GTK+, Motif or even X11
682    libraries.
683
684
685 \item [ {-}{-}enable-tray-monitor ]
686    \index[general]{{-}{-}enable-tray-monitor }
687    If you have GTK installed on your computer, you run a graphical
688    environment or a window manager compatible with the FreeDesktop system
689    tray standard (like KDE and GNOME) and you want to use a GUI to monitor
690    Bacula daemons, you must specify this option.  Doing so will build
691    everything in the {\bf src/tray-monitor} directory.
692
693 \item [ {-}{-}enable-static-tools]
694    \index[general]{{-}{-}enable-static-tools }
695    This option causes the linker to link the Storage daemon utility tools
696    ({\bf bls}, {\bf bextract}, and {\bf bscan}) statically.  This permits
697    using them without having the shared libraries loaded.  If you have
698    problems linking in the {\bf src/stored} directory, make sure you have
699    not enabled this option, or explicitly disable static linking by adding
700    {\bf \verb:--:disable-static-tools}.
701
702
703 \item [ {-}{-}enable-static-fd]
704    \index[general]{{-}{-}enable-static-fd }
705    This option causes the make process to build a {\bf static-bacula-fd} in
706    addition to the standard File daemon.  This static version will include
707    statically linked libraries and is required for the Bare Metal recovery.
708    This option is largely superseded by using {\bf make static-bacula-fd}
709    from with in the {\bf src/filed} directory.  Also, the {\bf
710    \verb:--:enable-client-only} option described below is useful for just
711    building a client so that all the other parts of the program are not
712    compiled.   
713      
714    When linking a static binary, the linker needs the static versions
715    of all the libraries that are used, so frequently users will 
716    experience linking errors when this option is used. The first 
717    thing to do is to make sure you have the static glibc library 
718    installed on your system. The second thing to do is the make sure
719    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
720    on your ./configure statement as these options require additional
721    libraries. You may be able to enable those options, but you will
722    need to load additional static libraries.
723
724
725 \item [ {-}{-}enable-static-sd]
726    \index[general]{{-}{-}enable-static-sd }
727    This option causes the make process to build a {\bf static-bacula-sd} in
728    addition to the standard Storage daemon.  This static version will
729    include statically linked libraries and could be useful during a Bare
730    Metal recovery.
731
732    When linking a static binary, the linker needs the static versions
733    of all the libraries that are used, so frequently users will 
734    experience linking errors when this option is used. The first 
735    thing to do is to make sure you have the static glibc library 
736    installed on your system. The second thing to do is the make sure
737    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
738    on your ./configure statement as these options require additional
739    libraries. You may be able to enable those options, but you will
740    need to load additional static libraries.
741
742  
743
744 \item [ {-}{-}enable-static-dir]
745    \index[general]{{-}{-}enable-static-dir }
746    This option causes the make process to build a {\bf static-bacula-dir}
747    in addition to the standard Director.  This static version will include
748    statically linked libraries and could be useful during a Bare Metal
749    recovery.
750
751    When linking a static binary, the linker needs the static versions
752    of all the libraries that are used, so frequently users will 
753    experience linking errors when this option is used. The first 
754    thing to do is to make sure you have the static glibc library 
755    installed on your system. The second thing to do is the make sure
756    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
757    on your ./configure statement as these options require additional
758    libraries. You may be able to enable those options, but you will
759    need to load additional static libraries.
760
761
762 \item [ {-}{-}enable-static-cons]
763    \index[general]{{-}{-}enable-static-cons }
764    This option causes the make process to build a {\bf static-console} and
765    a {\bf static-gnome-console} in addition to the standard console.  This
766    static version will include statically linked libraries and could be
767    useful during a Bare Metal recovery.
768
769    When linking a static binary, the linker needs the static versions
770    of all the libraries that are used, so frequently users will 
771    experience linking errors when this option is used. The first 
772    thing to do is to make sure you have the static glibc library 
773    installed on your system. The second thing to do is the make sure
774    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
775    on your ./configure statement as these options require additional
776    libraries. You may be able to enable those options, but you will
777    need to load additional static libraries.
778
779
780 \item [ {-}{-}enable-client-only]
781    \index[general]{{-}{-}enable-client-only }
782    This option causes the make process to build only the File daemon and
783    the libraries that it needs.  None of the other daemons, storage tools,
784    nor the console will be built.  Likewise a {\bf make install} will then
785    only install the File daemon.  To cause all daemons to be built, you
786    will need to do a configuration without this option.  This option
787    greatly facilitates building a Client on a client only machine.
788
789    When linking a static binary, the linker needs the static versions
790    of all the libraries that are used, so frequently users will 
791    experience linking errors when this option is used. The first 
792    thing to do is to make sure you have the static glibc library 
793    installed on your system. The second thing to do is the make sure
794    you do not specify {\bf {-}{-}openssl} or {\bf {-}{-}with-python}
795    on your ./configure statement as these options require additional
796    libraries. You may be able to enable those options, but you will
797    need to load additional static libraries.
798
799 \item [ {-}{-}enable-build-dird]
800    \index[general]{{-}{-}enable-build-dird }
801    This option causes the make process to build the Director and the
802    Director's tools. By default, this option is on, but you may turn
803    it off by using {\bf {-}{-}disable-build-dird} to prevent the
804    Director from being built.
805
806 \item [ {-}{-}enable-build-stored]
807    \index[general]{{-}{-}enable-build-stored }
808    This option causes the make process to build the Storage daemon.
809    By default, this option is on, but you may turn
810    it off by using {\bf {-}{-}disable-build-stored} to prevent the
811    Storage daemon from being built.
812
813
814 \item [ {-}{-}enable-largefile]
815    \index[general]{{-}{-}enable-largefile }
816    This option (default) causes  Bacula to be built with 64 bit file address
817    support if it  is available on your system. This permits Bacula to read and 
818    write files greater than 2 GBytes in size. You may disable this  feature and
819    revert to 32 bit file addresses by using  {\bf \verb:--:disable-largefile}.  
820
821 \item [ {-}{-}disable-nls]
822    \index[general]{{-}{-}disable-nls}
823    By default, Bacula uses the GNU Native Language Support (NLS) libraries. On
824    some machines, these libraries may not be present or may not function 
825    correctly (especially on non-Linux implementations). In such cases, you
826    may specify {\bf {-}{-}disable-nls} to disable use of those libraries.
827    In such a case, Bacula will revert to using English.
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}{_ChapterStart33} 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}{_ChapterStart33} 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}{_ChapterStart} 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}{_ChapterStart60} 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 RedHat 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 \subsection*{Recommended Options for most Systems}
1068 \index[general]{Systems!Recommended Options for most }
1069 \index[general]{Recommended Options for most Systems }
1070 \addcontentsline{toc}{subsection}{Recommended Options for most Systems}
1071
1072 For most systems, we recommend starting with the following options: 
1073
1074 \footnotesize
1075 \begin{verbatim}
1076 ./configure \
1077   --enable-smartalloc \
1078   --sbindir=$HOME/bacula/bin \
1079   --sysconfdir=$HOME/bacula/bin \
1080   --with-pid-dir=$HOME/bacula/bin/working \
1081   --with-subsys-dir=$HOME/bacula/bin/working \
1082   --with-mysql=$HOME/mysql \
1083   --with-working-dir=$HOME/bacula/working
1084 \end{verbatim}
1085 \normalsize
1086
1087 If you want to install Bacula in an installation directory rather than run it
1088 out of the build directory (as developers will do most of the time), you
1089 should also include the \verb:--:sbindir and \verb:--:sysconfdir options with appropriate
1090 paths. Neither are necessary if you do not use "make install" as is the case
1091 for most development work. The install process will create the sbindir and
1092 sysconfdir if they do not exist, but it will not automatically create the
1093 pid-dir, subsys-dir, or working-dir, so you must ensure that they exist before
1094 running Bacula for the first time. See below for an example of how Kern does
1095 it. 
1096
1097 \subsection*{RedHat}
1098 \index[general]{RedHat }
1099 \addcontentsline{toc}{subsection}{RedHat}
1100
1101 Using SQLite: 
1102
1103 \footnotesize
1104 \begin{verbatim}
1105  
1106 CFLAGS="-g -Wall" ./configure \
1107   --sbindir=$HOME/bacula/bin \
1108   --sysconfdir=$HOME/bacula/bin \
1109   --enable-smartalloc \
1110   --with-sqlite=$HOME/bacula/depkgs/sqlite \
1111   --with-working-dir=$HOME/bacula/working \
1112   --with-pid-dir=$HOME/bacula/bin/working \
1113   --with-subsys-dir=$HOME/bacula/bin/working \
1114   --enable-gnome \
1115   --enable-conio
1116 \end{verbatim}
1117 \normalsize
1118
1119 or 
1120
1121 \footnotesize
1122 \begin{verbatim}
1123  
1124 CFLAGS="-g -Wall" ./configure \
1125   --sbindir=$HOME/bacula/bin \
1126   --sysconfdir=$HOME/bacula/bin \
1127   --enable-smartalloc \
1128   --with-mysql=$HOME/mysql \
1129   --with-working-dir=$HOME/bacula/working
1130   --with-pid-dir=$HOME/bacula/bin/working \
1131   --with-subsys-dir=$HOME/bacula/bin/working
1132   --enable-gnome \
1133   --enable-conio
1134 \end{verbatim}
1135 \normalsize
1136
1137 or finally, a completely traditional RedHat Linux install: 
1138
1139 \footnotesize
1140 \begin{verbatim}
1141 CFLAGS="-g -Wall" ./configure \
1142   --prefix=/usr \
1143   --sbindir=/usr/sbin \
1144   --sysconfdir=/etc/bacula \
1145   --with-scriptdir=/etc/bacula \
1146   --enable-smartalloc \
1147   --enable-gnome \
1148   --with-mysql \
1149   --with-working-dir=/var/bacula \
1150   --with-pid-dir=/var/run \
1151   --with-subsys-dir=/var/lock/subsys \
1152   --enable-conio
1153 \end{verbatim}
1154 \normalsize
1155
1156 Note, Bacula assumes that /var/bacula, /var/run, and /var/loc/subsys exist so
1157 it will not automatically create them during the install process. 
1158
1159 Note, with gcc (GCC) 4.0.1 20050727 (Red Hat 4.0.1-5) on
1160 an AMD64 CPU running 64 bit CentOS4, there is a compiler bug that generates
1161 bad code that causes Bacula to segment fault.  Typically you will see this
1162 in the Storage daemon first.  The solution is to compile Bacula ensuring
1163 that no optimization is turned on (normally it is -O2).
1164
1165 \subsection*{Solaris}
1166 \index[general]{Solaris }
1167 \addcontentsline{toc}{subsection}{Solaris}
1168
1169 To build Bacula from source, you will need the following installed on your
1170 system (they are not by default): libiconv, gcc 3.3.2, stdc++, libgcc (for
1171 stdc++ and gcc\_s libraries), make 3.8 or later. 
1172
1173 You will probably also need to: Add /usr/local/bin to PATH and Add
1174 /usr/ccs/bin to PATH for ar. 
1175
1176 \footnotesize
1177 \begin{verbatim}
1178 #!/bin/sh
1179 CFLAGS="-g" ./configure \
1180   --sbindir=$HOME/bacula/bin \
1181   --sysconfdir=$HOME/bacula/bin \
1182   --with-mysql=$HOME/mysql \
1183   --enable-smartalloc \
1184   --with-pid-dir=$HOME/bacula/bin/working \
1185   --with-subsys-dir=$HOME/bacula/bin/working \
1186   --with-working-dir=$HOME/bacula/working
1187 \end{verbatim}
1188 \normalsize
1189
1190 As mentioned above, the install process will create the sbindir and sysconfdir
1191 if they do not exist, but it will not automatically create the pid-dir,
1192 subsys-dir, or working-dir, so you must ensure that they exist before running
1193 Bacula for the first time.
1194
1195 Note, you may need to install the following packages to build Bacula
1196 from source:
1197 \footnotesize
1198 \begin{verbatim}
1199 SUNWbinutils,
1200 SUNWarc,
1201 SUNWhea,
1202 SUNWGcc,
1203 SUNWGnutls
1204 SUNWGnutls-devel
1205 SUNWGmake
1206 SUNWgccruntime
1207 SUNWlibgcrypt
1208 SUNWzlib
1209 SUNWzlibs
1210 SUNWbinutilsS
1211 SUNWGmakeS
1212 SUNWlibm
1213
1214 export 
1215 PATH=/usr/bin::/usr/ccs/bin:/etc:/usr/openwin/bin:/usr/local/bin:/usr/sfw/bin:/opt/sfw/bin:/usr/ucb:/usr/sbin
1216 \end{verbatim}
1217 \normalsize
1218
1219 \subsection*{FreeBSD}
1220 \index[general]{FreeBSD }
1221 \addcontentsline{toc}{subsection}{FreeBSD}
1222
1223 Please see: 
1224 \elink{The FreeBSD Diary}{http://www.freebsddiary.org/bacula.php} for a
1225 detailed description on how to make Bacula work on your system. In addition,
1226 users of FreeBSD prior to 4.9-STABLE dated Mon Dec 29 15:18:01 2003 UTC who
1227 plan to use tape devices, please see the 
1228 \ilink{Tape Testing Chapter}{FreeBSDTapes} of this manual for
1229 {\bf important} information on how to configure your tape drive for
1230 compatibility with Bacula. 
1231
1232 If you are using Bacula with MySQL, you should take care to compile MySQL with
1233 FreeBSD native threads rather than LinuxThreads, since Bacula is normally built
1234 with FreeBSD native threads rather than LinuxTreads. Mixing the two will
1235 probably not work. 
1236
1237 \subsection*{Win32}
1238 \index[general]{Win32 }
1239 \addcontentsline{toc}{subsection}{Win32}
1240
1241 To install the binary Win32 version of the File daemon please see the 
1242 \ilink{Win32 Installation Chapter}{_ChapterStart7} in this document. 
1243
1244 \subsection*{Kern's Configure Script}
1245 \index[general]{Script!Kern's Configure }
1246 \index[general]{Kern's Configure Script }
1247 \addcontentsline{toc}{subsection}{Kern's Configure Script}
1248
1249 The script that I use for building on my "production" Linux machines is: 
1250
1251 \footnotesize
1252 \begin{verbatim}
1253 #!/bin/sh
1254 # This is Kern's configure script for Bacula
1255 CFLAGS="-g -Wall" \
1256   ./configure \
1257     --sbindir=$HOME/bacula/bin \
1258     --sysconfdir=$HOME/bacula/bin \
1259     --mandir=$HOME/bacula/bin \
1260     --enable-smartalloc \
1261     --enable-gnome \
1262     --enable-wx-console \
1263     --enable-tray-monitor \
1264     --with-pid-dir=$HOME/bacula/bin/working \
1265     --with-subsys-dir=$HOME/bacula/bin/working \
1266     --with-mysql \
1267     --with-working-dir=$HOME/bacula/bin/working \
1268     --with-dump-email=$USER@your-site.com \
1269     --with-job-email=$USER@your-site.com \
1270     --with-smtp-host=mail.your-site.com
1271 exit 0
1272 \end{verbatim}
1273 \normalsize
1274
1275 You may also want to put the following entries in your {\bf /etc/services}
1276 file as it will make viewing the connections made by Bacula easier to
1277 recognize (i.e. netstat -a): 
1278
1279 \footnotesize
1280 \begin{verbatim}
1281 bacula-dir      9101/tcp
1282 bacula-fd       9102/tcp
1283 bacula-sd       9103/tcp
1284 \end{verbatim}
1285 \normalsize
1286
1287 \subsection*{Installing Bacula}
1288 \index[general]{Bacula!Installing }
1289 \index[general]{Installing Bacula }
1290 \addcontentsline{toc}{subsection}{Installing Bacula}
1291
1292 Before setting up your configuration files, you will want to install Bacula in
1293 its final location. Simply enter: 
1294
1295 \footnotesize
1296 \begin{verbatim}
1297 make install
1298 \end{verbatim}
1299 \normalsize
1300
1301 If you have previously installed Bacula, the old binaries will be overwritten,
1302 but the old configuration files will remain unchanged, and the "new"
1303 configuration files will be appended with a {\bf .new}. Generally if you have
1304 previously installed and run Bacula you will want to discard or ignore the
1305 configuration files with the appended {\bf .new}. 
1306
1307 \subsection*{Building a File Daemon or Client}
1308 \index[general]{Client!Building a File Daemon or }
1309 \index[general]{Building a File Daemon or Client }
1310 \addcontentsline{toc}{subsection}{Building a File Daemon or Client}
1311
1312 If you run the Director and the Storage daemon on one machine and you wish to
1313 back up another machine, you must have a copy of the File daemon for that
1314 machine. If the machine and the Operating System are identical, you can simply
1315 copy the Bacula File daemon binary file {\bf bacula-fd} as well as its
1316 configuration file {\bf bacula-fd.conf} then modify the name and password in
1317 the conf file to be unique. Be sure to make corresponding additions to the
1318 Director's configuration file ({\bf bacula-dir.conf}). 
1319
1320 If the architecture or the OS level are different, you will need to build a
1321 File daemon on the Client machine. To do so, you can use the same {\bf
1322 ./configure} command as you did for your main program, starting either from a
1323 fresh copy of the source tree, or using {\bf make\ distclean} before the {\bf
1324 ./configure}. 
1325
1326 Since the File daemon does not access the Catalog database, you can remove
1327 the {\bf \verb:--:with-mysql} or {\bf \verb:--:with-sqlite} options, then
1328 add {\bf \verb:--:enable-client-only}.  This will compile only the
1329 necessary libraries and the client programs and thus avoids the necessity
1330 of installing one or another of those database programs to build the File
1331 daemon.  With the above option, you simply enter {\bf make} and just the
1332 client will be built.
1333
1334 \label{autostart}
1335 \subsection*{Auto Starting the Daemons}
1336 \index[general]{Daemons!Auto Starting the }
1337 \index[general]{Auto Starting the Daemons }
1338 \addcontentsline{toc}{subsection}{Auto Starting the Daemons}
1339
1340 If you wish the daemons to be automatically started and stopped when your
1341 system is booted (a good idea), one more step is necessary. First, the
1342 ./configure process must recognize your system -- that is it must be a
1343 supported platform and not {\bf unknown}, then you must install the platform
1344 dependent files by doing: 
1345
1346 \footnotesize
1347 \begin{verbatim}
1348 (become root)
1349 make install-autostart
1350 \end{verbatim}
1351 \normalsize
1352
1353 Please note, that the auto-start feature is implemented only on systems
1354 that we officially support (currently, FreeBSD, RedHat/Fedora Linux, and
1355 Solaris), and has only been fully tested on Fedora Linux.
1356
1357 The {\bf make install-autostart} will cause the appropriate startup scripts
1358 to be installed with the necessary symbolic links.  On RedHat/Fedora Linux
1359 systems, these scripts reside in {\bf /etc/rc.d/init.d/bacula-dir} {\bf
1360 /etc/rc.d/init.d/bacula-fd}, and {\bf /etc/rc.d/init.d/bacula-sd}.  However
1361 the exact location depends on what operating system you are using.
1362
1363 If you only wish to install the File daemon, you may do so with: 
1364
1365 \footnotesize
1366 \begin{verbatim}
1367 make install-autostart-fd
1368 \end{verbatim}
1369 \normalsize
1370
1371 \subsection*{Other Make Notes}
1372 \index[general]{Notes!Other Make }
1373 \index[general]{Other Make Notes }
1374 \addcontentsline{toc}{subsection}{Other Make Notes}
1375
1376 To simply build a new executable in any directory, enter: 
1377
1378 \footnotesize
1379 \begin{verbatim}
1380 make
1381 \end{verbatim}
1382 \normalsize
1383
1384 To clean out all the objects and binaries (including the files named 1, 2, or
1385 3, which Kern uses as temporary files), enter: 
1386
1387 \footnotesize
1388 \begin{verbatim}
1389 make clean
1390 \end{verbatim}
1391 \normalsize
1392
1393 To really clean out everything for distribution, enter: 
1394
1395 \footnotesize
1396 \begin{verbatim}
1397 make distclean
1398 \end{verbatim}
1399 \normalsize
1400
1401 note, this cleans out the Makefiles and is normally done from the top level
1402 directory to prepare for distribution of the source. To recover from this
1403 state, you must redo the {\bf ./configure} in the top level directory, since
1404 all the Makefiles will be deleted. 
1405
1406 To add a new file in a subdirectory, edit the Makefile.in in that directory,
1407 then simply do a {\bf make}. In most cases, the make will rebuild the Makefile
1408 from the new Makefile.in. In some case, you may need to issue the {\bf make} a
1409 second time. In extreme cases, cd to the top level directory and enter: {\bf
1410 make Makefiles}. 
1411
1412 To add dependencies: 
1413
1414 \footnotesize
1415 \begin{verbatim}
1416 make depend
1417 \end{verbatim}
1418 \normalsize
1419
1420 The {\bf make depend} appends the header file dependencies for each of the
1421 object files to Makefile and Makefile.in. This command should be done in each
1422 directory where you change the dependencies. Normally, it only needs to be run
1423 when you add or delete source or header files. {\bf make depend} is normally
1424 automatically invoked during the configuration process. 
1425
1426 To install: 
1427
1428 \footnotesize
1429 \begin{verbatim}
1430 make install
1431 \end{verbatim}
1432 \normalsize
1433
1434 This not normally done if you are developing Bacula, but is used if you are
1435 going to run it to backup your system. 
1436
1437 After doing a {\bf make install} the following files will be installed on your
1438 system (more or less). The exact files and location (directory) for each file
1439 depends on your {\bf ./configure} command (e.g. gnome-console and
1440 gnome-console.conf are not installed if you do not configure GNOME. Also, if
1441 you are using SQLite instead of mysql, some of the files will be different). 
1442
1443 \footnotesize
1444 \begin{verbatim}
1445 bacula
1446 bacula-dir
1447 bacula-dir.conf
1448 bacula-fd
1449 bacula-fd.conf
1450 bacula-sd
1451 bacula-sd.conf
1452 bacula-tray-monitor
1453 tray-monitor.conf
1454 bextract
1455 bls
1456 bscan
1457 btape
1458 btraceback
1459 btraceback.gdb
1460 bconsole
1461 bconsole.conf
1462 create_mysql_database
1463 dbcheck
1464 delete_catalog_backup
1465 drop_bacula_tables
1466 drop_mysql_tables
1467 fd
1468 gnome-console
1469 gnome-console.conf
1470 make_bacula_tables
1471 make_catalog_backup
1472 make_mysql_tables
1473 mtx-changer
1474 query.sql
1475 bsmtp
1476 startmysql
1477 stopmysql
1478 wx-console
1479 wx-console.conf
1480 9 man pages
1481 \end{verbatim}
1482 \normalsize
1483
1484 \label{monitor}
1485
1486 \subsection*{Installing Tray Monitor}
1487 \index[general]{Monitor!Installing Tray }
1488 \index[general]{Installing Tray Monitor }
1489 \addcontentsline{toc}{subsection}{Installing Tray Monitor}
1490
1491 The Tray Monitor is already installed if you used the {\bf
1492 \verb:--:enable-tray-monitor} configure option and ran {\bf make install}.
1493
1494 As you don't run your graphical environment as root (if you do, you should
1495 change that bad habit), don't forget to allow your user to read {\bf
1496 tray-monitor.conf}, and to execute {\bf bacula-tray-monitor} (this is not a
1497 security issue).
1498
1499 Then log into your graphical environment (KDE, Gnome or something else), run
1500 {\bf bacula-tray-monitor} as your user, and see if a cassette icon appears
1501 somewhere on the screen, usually on the task bar.
1502 If it doesn't, follow the instructions below related to your environment or
1503 window manager. 
1504
1505 \subsubsection*{GNOME}
1506 \index[general]{GNOME }
1507 \addcontentsline{toc}{subsubsection}{GNOME}
1508
1509 System tray, or notification area if you use the GNOME terminology, has been
1510 supported in GNOME since version 2.2. To activate it, right-click on one of
1511 your panels, open the menu {\bf Add to this Panel}, then {\bf Utility} and
1512 finally click on {\bf Notification Area}. 
1513
1514 \subsubsection*{KDE}
1515 \index[general]{KDE }
1516 \addcontentsline{toc}{subsubsection}{KDE}
1517
1518 System tray has been supported in KDE since version 3.1. To activate it,
1519 right-click on one of your panels, open the menu {\bf Add}, then {\bf Applet}
1520 and finally click on {\bf System Tray}. 
1521
1522 \subsubsection*{Other window managers}
1523 \index[general]{Managers!Other window }
1524 \index[general]{Other window managers }
1525 \addcontentsline{toc}{subsubsection}{Other window managers}
1526
1527 Read the documentation to know if the Freedesktop system tray standard is
1528 supported by your window manager, and if applicable, how to activate it. 
1529
1530 \subsection*{Modifying the Bacula Configuration Files}
1531 \index[general]{Modifying the Bacula Configuration Files }
1532 \index[general]{Files!Modifying the Bacula Configuration }
1533 \addcontentsline{toc}{subsection}{Modifying the Bacula Configuration Files}
1534
1535 See the chapter 
1536 \ilink{Configuring Bacula}{_ChapterStart16} in this manual for
1537 instructions on how to set Bacula configuration files.