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