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