4 \section*{Installing Bacula}
5 \label{_ChapterStart17}
6 \index[general]{Bacula!Installing }
7 \index[general]{Installing Bacula }
8 \addcontentsline{toc}{section}{Installing Bacula}
11 \index[general]{General }
12 \addcontentsline{toc}{subsection}{General}
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}
17 to build properly depending on the options you specify. To simplify your task,
18 we have combined a number of these packages into two {\bf depkgs} releases
19 (Dependency Packages). This can vastly simplify your life by providing you
20 with all the necessary packages rather than requiring you to find them on the
21 Web, load them, and install them.
24 \subsection*{Upgrading Bacula}
25 \index[general]{Bacula!Upgrading }
26 \index[general]{Upgrading Bacula }
27 \addcontentsline{toc}{subsection}{Upgrading Bacula}
29 If you are upgrading from one Bacula version to another, you should first
30 carefully read the ReleaseNotes of all versions between your current version
31 and the version to which you are upgrading. If the Bacula catalog database has
32 been upgraded, you will either need to reinitialize your database starting
33 from scratch, or save an ASCII copy of your database, then proceed to upgrade
34 it. If there are several database upgrades between your version and the
35 version to which you are upgrading, you will need to apply each database
36 upgrade script. For your convenience, you can find all the old upgrade scripts
37 in the {\bf upgradedb} directory of the source code. You will need to edit the
38 scripts to correspond to your system configuration. The final upgrade script,
39 if any, will be in the {\bf src/cats} directory as described in the
42 If you are upgrading from one major version to another, you will need to
43 replace all your components at the same time as generally the inter-daemon
44 protocol will change. However, within any particular release (e.g. version
45 1.32.x) unless there is an oversight or bug, the daemon protocol will not
46 change. If this is confusing, simply read the ReleaseNotes very carefully as
47 they will note if all daemons must be upgraded at the same time.
49 Finally, please note that in general it is not necessary to do a
50 {\bf make uninstall} before doing an upgrade. In fact, if you do so, you will
51 most likely delete all your conf files, which could be disastrous.
52 For additional information on upgrading, please see the \ilink{Upgrading Bacula
53 Versions}{upgrading} in the Tips chapter of this manual.
56 \subsection*{Dependency Packages}
58 \index[general]{Dependency Packages }
59 \index[general]{Packages!Dependency }
60 \addcontentsline{toc}{subsection}{Dependency Packages}
62 As discussed above, we have combined a number of third party packages that
63 Bacula might need into the {\bf depkgs} and {\bf depkgs1} releases. You can,
64 of course, get the latest packages from the original authors. The locations of
65 where we obtained the packages are in the README file in each package.
66 However, be aware that the packages in the depkgs files have been tested by us
67 for compatibility with Bacula.
69 Typically, a dependency package will be named {\bf depkgs-ddMMMyy.tar.gz} and
70 {\bf depkgs1-ddMMyy.tar.gz} where {\bf dd} is the day we release it, {\bf MMM}
71 is the abbreviated month (e.g. Jan), and {\bf yy} is the year. An actual
72 example is: {\bf depkgs-07Apr02.tar.gz}. To install and build this package (if
73 needed), you do the following:
76 \item Create a {\bf bacula} directory, into which you will place both the
77 Bacula source as well as the dependency package.
78 \item Detar the {\bf depkg} into the {\bf bacula} directory.
79 \item cd bacula/depkgs
83 Although the exact composition of the dependency packages may change from time
84 to time, the current makeup is the following:
86 \addcontentsline{lot}{table}{Depedency Packages}
87 \begin{longtable}{|l|l|l|l|}
89 \multicolumn{1}{|c| }{\bf 3rd Party Package } & \multicolumn{1}{c| }{\bf
90 depkgs } & \multicolumn{1}{c| }{\bf depkgs1 } & \multicolumn{1}{c| }{\bf
92 \hline {SQLite } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{- } &
93 \multicolumn{1}{c| }{- } \\
94 \hline {mtx } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{- } &
95 \multicolumn{1}{c| }{- } \\
96 \hline {readline } & \multicolumn{1}{c| }{- } & \multicolumn{1}{c| }{X } &
97 \multicolumn{1}{c| }{- } \\
98 \hline {pthreads } & \multicolumn{1}{c| }{- } & \multicolumn{1}{c| }{- } &
99 \multicolumn{1}{c| }{X } \\
100 \hline {zlib } & \multicolumn{1}{c| }{- } & \multicolumn{1}{c| }{- } &
101 \multicolumn{1}{c| }{X } \\
102 \hline {wxWidgits } & \multicolumn{1}{c| }{- } & \multicolumn{1}{c| }{- } &
103 \multicolumn{1}{c| }{X }
108 Note, some of these packages are quite large, so that building them can be a
109 bit time consuming. The above instructions will build all the packages
110 contained in the directory. However, when building Bacula, it will take only
111 those pieces that it actually needs.
113 Alternatively, you can make just the packages that are needed. For example,
122 will configure and build only the SQLite package.
124 You should build the packages that you will require in {\bf depkgs} and/or
125 {\bf depkgs1} prior to configuring and building Bacula, since Bacula will need
126 them during the build process.
128 Even if you do not use SQLite, you might find it worthwhile to build {\bf mtx}
129 because the {\bf tapeinfo} program that comes with it can often provide you
130 with valuable information about your SCSI tape drive (e.g. compression,
131 min/max block sizes, ...).
133 The {\bf depkgs-win32} package contains the source code for the pthreads and
134 zlib libraries used by the native Win32 client program. It will only be needed
135 if you intend to build the Win32 client from source.
137 \subsection*{Supported Operating Systems}
139 \index[general]{Systems!Supported Operating }
140 \index[general]{Supported Operating Systems }
141 \addcontentsline{toc}{subsection}{Supported Operating Systems}
144 \ilink{ Supported Operating Systems}{SupportedOSes} section
145 of the QuickStart chapter of this manual.
147 \subsection*{Building Bacula from Source}
149 \index[general]{Source!Building Bacula from }
150 \index[general]{Building Bacula from Source }
151 \addcontentsline{toc}{subsection}{Building Bacula from Source}
153 The basic installation is rather simple.
156 \item Install and build any {\bf depkgs} as noted above.
157 \item Configure and install MySQL or PostgreSQL (if desired).
158 \ilink{Installing and Configuring MySQL Phase I}{_ChapterStart} or
159 \ilink{Installing and Configuring PostgreSQL Phase
160 I}{_ChapterStart10}. If you are installing from rpms, and are
161 using MySQL, please be sure to install {\bf mysql-devel}, so that the MySQL
162 header files are available while compiling Bacula. In addition, the MySQL
163 client library {\bf mysqlclient} requires the gzip compression library {\bf
164 libz.a} or {\bf libz.so}. If you are using rpm packages, these libraries are
165 in the {\bf libz-devel} package. On Debian systems, you will need to load the
166 {\bf zlib1g-dev} package. If you are not using rpms or debs, you will need to
167 find the appropriate package for your system.
168 Note, if you already have a running MySQL or PostgreSQL on your system, you
169 can skip this phase provided that you have built the thread safe libraries.
170 And you have already installed the additional rpms noted above.
171 \item As an alternative to MySQL and PostgreSQL, configure and install SQLite,
172 which is part of the {\bf depkgs}.
173 \ilink{Installing and Configuring SQLite}{_ChapterStart33}.
174 \item Detar the Bacula source code preferably into the {\bf bacula} directory
176 \item {\bf cd} to the directory containing the source code.
177 \item ./configure (with appropriate options as described below)
178 \item Check the output of ./configure very carefully, especially the Install
179 binaries and Install config files directories. If they are not correct,
180 please rerun ./configure until they are. The output from ./configure is
181 stored in {\bf config.out} and can be re-displayed at any time without
182 rerunning the ./configure by doing {\bf cat config.out}.
183 \item If after running ./configure once, you decide to change options and
184 re-run it, that is perfectly fine, but before re-running it, you should run:
194 so that you are sure to start from scratch and not have a mixture of the two
195 options. This is because ./configure caches much of the information. The {\bf
196 make distclean} is also critical if you move the source file from one
197 machine to another. If the {\bf make distclean} fails, just ignore it and
201 If you get errors while linking in the Storage daemon directory (src/stored),
202 it is probably because you have not loaded the static libraries on your
203 system. I noticed this problem on a Solaris system. To correct it, make sure
204 that you have not added {\bf \verb{--{enable-static-tools} to the {\bf ./configure}
207 \item If you are new to Bacula, we {\bf strongly} recommend that you skip the
208 next step and use the default configuration files, then run the example
209 program in the next chapter, then come back and modify your configuration
210 files to suit your particular needs.
211 \item Customize the configuration files for each of the three daemons
212 (Directory, File, Storage) and for the Console program. For the details of
213 how to do this, please see
214 \ilink{Setting Up Bacula Configuration Files}{_ChapterStart16} in
215 the Configuration chapter of this manual. We recommend that you start by
216 modifying the default configuration files supplied, making the minimum
217 changes necessary. Complete customization can be done after you have Bacula
218 up and running. Please take care when modifying passwords, which were
219 randomly generated, and the {\bf Name}s as the passwords and names must agree
220 between the configuration files for security reasons.
221 \item Create the Bacula MySQL database and tables (if using MySQL)
222 \ilink{Installing and Configuring MySQL Phase II}{mysql_phase2} or
223 create the Bacula PostgreSQL database and tables
224 \ilink{Installing and Configuring PostgreSQL Phase
225 II}{PostgreSQL_phase2} or alternatively if you are using
227 \ilink{Installing and Configuring SQLite Phase II}{phase2}.
228 \item Start Bacula ({\bf ./bacula start}) Note. the next chapter shows you
229 how to do this in detail.
230 \item Interface with Bacula using the Console program
231 \item For the previous two items, please follow the instructions in the
232 \ilink{Running Bacula}{_ChapterStart1} chapter of this manual,
233 where you will run a simple backup and do a restore. Do this before you make
234 heavy modifications to the configuration files so that you are sure that
235 Bacula works and are familiar with it. After that changing the conf files
237 \item If after installing Bacula, you decide to ``move it'', that is to
238 install it in a different set of directories, proceed as follows:
244 ./configure (your-new-options)
253 If all goes well, the {\bf ./configure} will correctly determine which
254 operating system you are running and configure the source code appropriately.
255 Currently, FreeBSD, Linux (RedHat), and Solaris are supported. MacOS X 10.3 is
256 reported to work with the Client only as long as readline support is disabled.
259 If you install Bacula on more than one system, and they are identical, you can
260 simply transfer the source tree to that other system and do a ``make
261 install''. However, if there are differences in the libraries or OS versions,
262 or you wish to install on a different OS, you should start from the original
263 compress tar file. If you do transfer the source tree, and you have previously
264 done a ./configure command, you MUST do:
272 prior to doing your new ./configure. This is because the GNU autoconf tools
273 cache the configuration, and if you re-use a configuration for a Linux machine
274 on a Solaris, you can be sure your build will fail. To avoid this, as
275 mentioned above, either start from the tar file, or do a ``make distclean''.
277 In general, you will probably want to supply a more complicated {\bf
278 configure} statement to ensure that the modules you want are built and that
279 everything is placed into the correct directories.
281 For example, on RedHat, one could use the following:
287 --sbindir=$HOME/bacula/bin \
288 --sysconfdir=$HOME/bacula/bin \
289 --with-pid-dir=$HOME/bacula/bin/working \
290 --with-subsys-dir=$HOME/bacula/bin/working \
291 --with-mysql=$HOME/mysql \
292 --with-working-dir=$HOME/bacula/bin/working \
293 --with-dump-email=$USER
297 Note, the advantage of using the above configuration to start is that
298 everything will be put into a single directory, which you can later delete
299 once you have run the examples in the next chapter and learned how Bacula
300 works. In addition, the above can be installed and run as non-root.
302 For the developer's convenience, I have added a {\bf defaultconfig} script to
303 the {\bf examples} directory. This script contains the statements that you
304 would normally use, and each developer/user may modify them to suit his needs.
305 You should find additional useful examples in this directory as well.
307 The {\bf \verb{--{enable-conio} or {\bf \verb{--{enable-readline} options are useful because
308 they provide a command line history and editing capability for the Console
309 program. If you have included either option in the build, either the {\bf
310 termcap} or the {\bf ncurses} package will be needed to link. On some systems,
311 such as SuSE, the termcap library is not in the standard library directory. As
312 a consequence, the option may be disabled or you may get an error message such
317 /usr/lib/gcc-lib/i586-suse-linux/3.3.1/.../ld:
318 cannot find -ltermcap
319 collect2: ld returned 1 exit status
323 while building the Bacula Console. In that case, you will need to set the {\bf
324 LDFLAGS} environment variable prior to building.
328 export LDFLAGS="-L/usr/lib/termcap"
332 The same library requirements apply if you wish to use the readline
333 subroutines for command line editing and history or
334 if you are using a MySQL library that requires encryption. If you need encryption,
335 you can either export the appropriate additional library options as shown
336 above or, alternatively, you can include them directly on the ./configure line
341 LDFLAGS="-lssl -lcyrpto" \
347 On some systems such as Mandriva, readline tends to
348 gobble up prompts, which makes it totally useless. If this happens to you, use
349 the disable option, or if you are using version 1.33 and above try using {\bf
350 \verb{--{enable-conio} to use a built-in readline replacement. You will still need
351 either the termcap or the ncurses library, but it is unlikely that the {\bf conio}
352 package will gobble up prompts.
354 readline is no longer supported after version 1.34. The code is still
355 available and if users submit patches for it, I will be happy to apply them.
356 However, due to the fact that each version of readline seems to be
357 incompatible with previous versions, and that there are significant
358 differences between systems, I can no longer afford to support it.
360 \subsection*{What Database to Use?}
362 \index[general]{What Database to Use? }
363 \index[general]{Use!What Database to }
364 \addcontentsline{toc}{subsection}{What Database to Use?}
366 Before building Bacula you need to decide if you want to use SQLite, MySQL, or
367 PostgreSQL. If you are not already running MySQL or PostgreSQL, we recommend
368 that you start by using SQLite. This will greatly simplify the setup for you
369 because SQLite is compiled into Bacula an requires no administration. It
370 performs well and is suitable for small to medium sized installations (maximum
373 If you wish to use MySQL as the Bacula catalog, please see the
374 \ilink{Installing and Configuring MySQL}{_ChapterStart} chapter of
375 this manual. You will need to install MySQL prior to continuing with the
376 configuration of Bacula. MySQL is a high quality database that is very
377 efficient and is suitable for any sized installation. It is slightly more
378 complicated than SQLite to setup and administer because it has a number of
379 sophisticated features such as userids and passwords. It runs as a separate
380 process, is truly professional and can manage a database of any size.
382 If you wish to use PostgreSQL as the Bacula catalog, please see the
383 \ilink{Installing and Configuring PostgreSQL}{_ChapterStart10}
384 chapter of this manual. You will need to install PostgreSQL prior to
385 continuing with the configuration of Bacula. PostgreSQL is very similar to
386 MySQL, though it tends to be slightly more SQL92 compliant and has many more
387 advanced features such as transactions, stored procedures, and the such. It
388 requires a certain knowledge to install and maintain. There are some important
389 performance problems with PostgreSQL in Bacula versions prior to 1.35.5.
391 If you wish to use SQLite as the Bacula catalog, please see
392 \ilink{Installing and Configuring SQLite}{_ChapterStart33} chapter of
395 \subsection*{Quick Start}
396 \index[general]{Quick Start }
397 \index[general]{Start!Quick }
398 \addcontentsline{toc}{subsection}{Quick Start}
400 There are a number of options and important considerations given below
401 that you can skip for the moment if you have not had any problems building
402 Bacula with a simplified configuration as shown above.
404 If you want to dive right into it, we recommend you skip to the next chapter,
405 and run the example program. It will teach you a lot about Bacula and as an
406 example can be installed into a single directory (for easy removal) and run as
407 non-root. If you have any problems or when you want to do a real installation,
408 come back to this chapter and read the details presented below.
410 \subsection*{Configure Options}
412 \index[general]{Options!Configure }
413 \index[general]{Configure Options }
414 \addcontentsline{toc}{subsection}{Configure Options}
416 The following command line options are available for {\bf configure} to
417 customize your installation.
421 \item [ \verb?--?sysbindir=\lt{}binary-path\gt{}]
422 \index[dir]{\verb{--{sysbindir }
423 Defines where the Bacula binary (executable) files will be placed during a
424 {\bf make install} command.
426 \item [ \verb?--?sysconfdir=\lt{}config-path\gt{}]
427 \index[dir]{\verb{--{sysconfdir }
428 Defines where the Bacula configuration files should be placed during a {\bf
429 make install} command.
431 \item [ \verb?--?enable-smartalloc ]
432 \index[dir]{\verb{--{enable-smartalloc }
433 This enables the inclusion of the Smartalloc orphaned buffer detection code.
434 This option is highly recommended. Because we never build without this
435 option, you may experience problems if it is not enabled. In this case,
436 simply re-enable the option. We strongly recommend keeping this option
437 enabled as it helps detect memory leaks. This configuration parameter is used
438 while building Bacula
440 \item [ \verb?--?enable-gnome ]
441 \index[dir]{\verb{--{enable-gnome }
442 If you have GNOME installed on your computer and you want to use the GNOME
443 GUI Console interface to Bacula, you must specify this option. Doing so will
444 build everything in the {\bf src/gnome-console} directory.
446 \item [ \verb?--?enable-wx-console ]
447 \index[console]{\verb{--{enable-wx-console }
448 If you have wxWidgets installed on your computer and you want to use the
449 wxWidgets GUI Console interface to Bacula, you must specify this option.
450 Doing so will build everything in the {\bf src/wx-console} directory. This
451 could also be useful to users who want a GUI Console and don't want to
452 install Gnome, as wxWidgets can work with GTK+, Motif or even X11 libraries.
455 \item [ \verb?--?enable-tray-monitor ]
456 \index[dir]{\verb{--{enable-tray-monitor }
457 If you have GTK installed on your computer, you run a graphical environment
458 or a window manager compatible with the FreeDesktop system tray standard
459 (like KDE and GNOME) and you want to use a GUI to monitor Bacula daemons, you
460 must specify this option. Doing so will build everything in the {\bf
461 src/tray-monitor} directory.
463 \item [ \verb?--?enable-static-tools]
464 \index[dir]{\verb{--{enable-static-tools }
465 This option causes the linker to link the Storage daemon utility tools ({\bf
466 bls}, {\bf bextract}, and {\bf bscan}) statically. This permits using them
467 without having the shared libraries loaded. If you have problems linking in
468 the {\bf src/stored} directory, make sure you have not enabled this option,
469 or explicitly disable static linking by adding {\bf \verb{--{disable-static-tools}.
472 \item [ \verb?--?enable-static-fd]
473 \index[fd]{\verb{--{enable-static-fd }
474 This option causes the make process to build a {\bf static-bacula-fd} in
475 addition to the standard File daemon. This static version will include
476 statically linked libraries and is required for the Bare Metal recovery. This
477 option is largely superseded by using {\bf make static-bacula-fd} from with
478 in the {\bf src/filed} directory. Also, the {\bf \verb{--{enable-client-only} option
479 described below is useful for just building a client so that all the other
480 parts of the program are not compiled.
482 \item [ \verb?--?enable-static-sd]
483 \index[sd]{\verb{--{enable-static-sd }
484 This option causes the make process to build a {\bf static-bacula-sd} in
485 addition to the standard Storage daemon. This static version will include
486 statically linked libraries and could be useful during a Bare Metal recovery.
489 \item [ \verb?--?enable-static-dir]
490 \index[dir]{\verb{--{enable-static-dir }
491 This option causes the make process to build a {\bf static-bacula-dir} in
492 addition to the standard Director. This static version will include
493 statically linked libraries and could be useful during a Bare Metal recovery.
496 \item [ \verb?--?enable-static-cons]
497 \index[dir]{\verb{--{enable-static-cons }
498 This option causes the make process to build a {\bf static-console} and a
499 {\bf static-gnome-console} in addition to the standard console. This static
500 version will include statically linked libraries and could be useful during a
503 \item [ \verb?--?enable-client-only]
504 \index[console]{\verb{--{enable-client-only }
505 This option causes the make process to build only the File daemon and the
506 libraries that it needs. None of the other daemons, storage tools, nor the
507 console will be built. Likewise a {\bf make install} will then only install
508 the File daemon. To cause all daemons to be built, you will need to do a
509 configuration without this option. This option greatly facilitates building a
510 Client on a client only machine.
512 \item [ \verb?--?enable-largefile]
513 \index[console]{\verb{--{enable-largefile }
514 This option (default) causes Bacula to be built with 64 bit file address
515 support if it is available on your system. This permits Bacula to read and
516 write files greater than 2 GBytes in size. You may disable this feature and
517 revert to 32 bit file addresses by using {\bf \verb{--{disable-largefile}.
519 \item [ \verb?--?with-sqlite=\lt{}sqlite-path\gt{}]
520 \index[fd]{\verb{--{with-sqlite }
521 This enables use of the SQLite database. The {\bf sqlite-path} is not
522 normally specified as Bacula looks for the necessary components in a
523 standard location ({\bf depkgs/sqlite}). See
524 \ilink{Installing and Configuring SQLite}{_ChapterStart33} chapter of
525 this manual for more details.
527 \item [ \verb?--?with-mysql=\lt{}mysql-path\gt{}]
528 \index[fd]{\verb{--{with-mysql }
529 This enables building of the Catalog services for Bacula. It assumes that
530 MySQL is running on your system, and expects it to be installed in the {\bf
531 mysql-path} that you specify. If this option is not present, the build will
532 automatically include the internal Bacula database code. We recommend that
533 you use this option if possible. If you do use this option, please proceed to
534 installing MySQL in the
535 \ilink{Installing and Configuring MySQL}{_ChapterStart} chapter
536 before proceeding with the configuration.
538 \item [ \verb?--?with-postgresql=\lt{}path\gt{}]
539 \index[fd]{\verb{--{with-postgresql }
540 This provides an explicit path to the PostgreSQL libraries if Bacula cannot
543 \item [ \verb?--?enable-conio]
544 \index[fd]{\verb{--{enable-conio }
545 Tells Bacula to enable building the small, light weight readline replacement
546 routine. It is generally much easier to configure than readline, although,
547 like readline, it needs either the termcap or ncurses library.
549 \item [ \verb?--?with-readline=\lt{}readline-path\gt{}]
550 \index[fd]{\verb{--{with-readline }
551 Tells Bacula where {\bf readline} is installed. Normally, Bacula will find
552 readline if it is in a standard library. If it is not found and no
553 \verb{--{with-readline is specified, readline will be disabled. This option affects
554 the Bacula build. Readline provides the Console program with a command line
555 history and editing capability and is no longer supported, so you are on your
556 own if you have problems.
558 \item [ \verb?--?enable-readline]
559 \index[fd]{\verb{--{enable-readline }
560 Tells Bacula to enable readline support. It is normally disabled due to the
561 large number of configuration problems and the fact that the package seems to
562 change in incompatible ways from version to version.
564 \item [ \verb?--?with-tcp-wrappers=\lt{}path\gt{}]
565 \index[fd]{\verb{--{with-tcp-wrappers }
566 This specifies that you want TCP wrappers (man hosts\_access(5)) compiled in.
567 The path is optional since Bacula will normally find the libraries in the
568 standard locations. This option affects the Bacula build. In specifying your
569 restrictions in the {\bf /etc/hosts.allow} or {\bf /etc/hosts.deny} files, do
570 not use the {\bf twist} option (hosts\_options(5)) or the Bacula process will
573 For more information on configuring and testing TCP wrappers, please see the
574 \ilink{Configuring and Testing TCP Wrappers}{wrappers} section
575 in the Security Chapter.
577 \item [ \verb?--?with-working-dir=\lt{}working-directory-path\gt{} ]
578 \index[dir]{\verb{--{with-working-dir }
579 This option is mandatory and specifies a directory into which Bacula may
580 safely place files that will remain between Bacula executions. For example,
581 if the internal database is used, Bacula will keep those files in this
582 directory. This option is only used to modify the daemon configuration
583 files. You may also accomplish the same thing by directly editing them later.
584 The working directory is not automatically created by the install process, so
585 you must ensure that it exists before using Bacula for the first time.
587 \item [ \verb?--?with-base-port=\lt{}port=number\gt{}]
588 \index[dir]{\verb{--{with-base-port }
589 In order to run, Bacula needs three TCP/IP ports (one for the Bacula
590 Console, one for the Storage daemon, and one for the File daemon). The {\bf
591 \verb{--{with-baseport} option will automatically assign three ports beginning at
592 the base port address specified. You may also change the port number in the
593 resulting configuration files. However, you need to take care that the
594 numbers correspond correctly in each of the three daemon configuration
595 files. The default base port is 9101, which assigns ports 9101 through 9103.
596 These ports (9101, 9102, and 9103) have been officially assigned to Bacula by
597 IANA. This option is only used to modify the daemon configuration files. You
598 may also accomplish the same thing by directly editing them later.
600 \item [ \verb?--?with-dump-email=\lt{}email-address\gt{}]
601 \index[dir]{\verb{--{with-dump-email }
602 This option specifies the email address where any core dumps should be set.
603 This option is normally only used by developers.
605 \item [ \verb?--?with-pid-dir=\lt{}PATH\gt{} ]
606 \index[dir]{\verb{--{with-pid-dir }
607 This specifies where Bacula should place the process id file during
608 execution. The default is: {\bf /var/run}. This directory is not created by
609 the install process, so you must ensure that it exists before using Bacula
612 \item [ \verb?--?with-subsys-dir=\lt{}PATH\gt{}]
613 \index[dir]{\verb{--{with-subsys-dir }
614 This specifies where Bacula should place the subsystem lock file during
615 execution. The default is {\bf /var/run/subsys}. Please make sure that you do
616 not specify the same directory for this directory and for the {\bf sbindir}
617 directory. This directory is used only within the autostart scripts. The
618 subsys directory is not created by the Bacula install, so you must be sure to
619 create it before using Bacula.
621 \item [ \verb?--?with-dir-password=\lt{}Password\gt{}]
622 \index[dir]{\verb{--{with-dir-password }
623 This option allows you to specify the password used to access the Directory
624 (normally from the Console program). If it is not specified, configure will
625 automatically create a random password.
627 \item [ \verb?--?with-fd-password=\lt{}Password\gt{} ]
628 \index[fd]{\verb{--{with-fd-password }
629 This option allows you to specify the password used to access the File daemon
630 (normally called from the Director). If it is not specified, configure will
631 automatically create a random password.
633 \item [ \verb?--?with-sd-password=\lt{}Password\gt{} ]
634 \index[sd]{\verb{--{with-sd-password }
635 This option allows you to specify the password used to access the Directory
636 (normally called from the Director). If it is not specified, configure will
637 automatically create a random password.
639 \item [ \verb?--?with-dir-user=\lt{}User\gt{} ]
640 \index[dir]{\verb{--{with-dir-user }
641 This option allows you to specify the Userid used to run the Director. The
642 Director must be started as root, but doesn't need to run as root, and after
643 doing preliminary initializations, it can ``drop'' to the UserId specified on
646 \item [ \verb?--?with-dir-group=\lt{}Group\gt{} ]
647 \index[dir]{\verb{--{with-dir-group }
648 This option allows you to specify the GroupId used to run the Director. The
649 Director must be started as root, but doesn't need to run as root, and after
650 doing preliminary initializations, it can ``drop'' to the GroupId specified
653 \item [ \verb?--?with-sd-user=\lt{}User\gt{} ]
654 \index[sd]{\verb{--{with-sd-user }
655 This option allows you to specify the Userid used to run the Storage daemon.
656 The Storage daemon must be started as root, but doesn't need to run as root,
657 and after doing preliminary initializations, it can ``drop'' to the UserId
658 specified on this option. If you use this option, you will need to take care
659 that the Storage daemon has access to all the devices (tape drives, ...) that
662 \item [ \verb?--?with-sd-group=\lt{}Group\gt{} ]
663 \index[sd]{\verb{--{with-sd-group }
664 This option allows you to specify the GroupId used to run the Storage daemon.
665 The Storage daemon must be started as root, but doesn't need to run as root,
666 and after doing preliminary initializations, it can ``drop'' to the GroupId
667 specified on this option.
669 \item [ \verb?--?with-fd-user=\lt{}User\gt{} ]
670 \index[fd]{\verb{--{with-fd-user }
671 This option allows you to specify the Userid used to run the File daemon. The
672 File daemon must be started as root, and in most cases, it needs to run as
673 root, so this option is used only in very special cases, after doing
674 preliminary initializations, it can ``drop'' to the UserId specified on this
677 \item [ \verb?--?with-fd-group=\lt{}Group\gt{} ]
678 \index[fd]{\verb{--{with-fd-group }
679 This option allows you to specify the GroupId used to run the File daemon.
680 The File daemon must be started as root, and in most cases, it must be run as
681 root, however, after doing preliminary initializations, it can ``drop'' to
682 the GroupId specified on this option.
686 Note, many other options are presented when you do a {\bf ./configure \verb{--{help},
687 but they are not implemented.
689 \subsection*{Recommended Options for most Systems}
690 \index[general]{Systems!Recommended Options for most }
691 \index[general]{Recommended Options for most Systems }
692 \addcontentsline{toc}{subsection}{Recommended Options for most Systems}
694 For most systems, we recommend starting with the following options:
699 --enable-smartalloc \
700 --sbindir=$HOME/bacula/bin \
701 --sysconfdir=$HOME/bacula/bin \
702 --with-pid-dir=$HOME/bacula/bin/working \
703 --with-subsys-dir=$HOME/bacula/bin/working \
704 --with-mysql=$HOME/mysql \
705 --with-working-dir=$HOME/bacula/working
709 If you want to install Bacula in an installation directory rather than run it
710 out of the build directory (as developers will do most of the time), you
711 should also include the \verb{--{sbindir and \verb{--{sysconfdir options with appropriate
712 paths. Neither are necessary if you do not use ``make install'' as is the case
713 for most development work. The install process will create the sbindir and
714 sysconfdir if they do not exist, but it will not automatically create the
715 pid-dir, subsys-dir, or working-dir, so you must ensure that they exist before
716 running Bacula for the first time. See below for an example of how Kern does
720 \index[general]{RedHat }
721 \addcontentsline{toc}{subsection}{RedHat}
728 CFLAGS="-g -Wall" ./configure \
729 --sbindir=$HOME/bacula/bin \
730 --sysconfdir=$HOME/bacula/bin \
731 --enable-smartalloc \
732 --with-sqlite=$HOME/bacula/depkgs/sqlite \
733 --with-working-dir=$HOME/bacula/working \
734 --with-pid-dir=$HOME/bacula/bin/working \
735 --with-subsys-dir=$HOME/bacula/bin/working \
746 CFLAGS="-g -Wall" ./configure \
747 --sbindir=$HOME/bacula/bin \
748 --sysconfdir=$HOME/bacula/bin \
749 --enable-smartalloc \
750 --with-mysql=$HOME/mysql \
751 --with-working-dir=$HOME/bacula/working
752 --with-pid-dir=$HOME/bacula/bin/working \
753 --with-subsys-dir=$HOME/bacula/bin/working
759 or finally, a completely traditional RedHat Linux install:
763 CFLAGS="-g -Wall" ./configure \
765 --sbindir=/usr/sbin \
766 --sysconfdir=/etc/bacula \
767 --with-scriptdir=/etc/bacula \
768 --enable-smartalloc \
771 --with-working-dir=/var/bacula \
772 --with-pid-dir=/var/run \
773 --with-subsys-dir=/var/lock/subsys \
778 Note, Bacula assumes that /var/bacula, /var/run, and /var/loc/subsys exist so
779 it will not automatically create them during the install process.
781 \subsection*{Solaris}
782 \index[general]{Solaris }
783 \addcontentsline{toc}{subsection}{Solaris}
785 To build Bacula from source, you will need the following installed on your
786 system (they are not by default): libiconv, gcc 3.3.2, stdc++, libgcc (for
787 stdc++ and gcc\_s libraries), make 3.8 or later.
789 You will probably also need to: Add /usr/local/bin to PATH and Add
790 /usr/ccs/bin to PATH for ar.
795 CFLAGS="-g" ./configure \
796 --sbindir=$HOME/bacula/bin \
797 --sysconfdir=$HOME/bacula/bin \
798 --with-mysql=$HOME/mysql \
799 --enable-smartalloc \
800 --with-pid-dir=$HOME/bacula/bin/working \
801 --with-subsys-dir=$HOME/bacula/bin/working \
802 --with-working-dir=$HOME/bacula/working
806 As mentioned above, the install process will create the sbindir and sysconfdir
807 if they do not exist, but it will not automatically create the pid-dir,
808 subsys-dir, or working-dir, so you must ensure that they exist before running
809 Bacula for the first time.
811 \subsection*{FreeBSD}
812 \index[general]{FreeBSD }
813 \addcontentsline{toc}{subsection}{FreeBSD}
816 \elink{The FreeBSD Diary}{http://www.freebsddiary.org/bacula.php} for a
817 detailed description on how to make Bacula work on your system. In addition,
818 users of FreeBSD prior to 4.9-STABLE dated Mon Dec 29 15:18:01 2003 UTC who
819 plan to use tape devices, please see the
820 \ilink{Tape Testing Chapter}{FreeBSDTapes} of this manual for
821 {\bf important} information on how to configure your tape drive for
822 compatibility with Bacula.
824 If you are using Bacula with MySQL, you should take care to compile MySQL with
825 FreeBSD native threads rather than LinuxThreads, since Bacula is normally built
826 with FreeBSD native threads rather than LinuxTreads. Mixing the two will
830 \index[general]{Win32 }
831 \addcontentsline{toc}{subsection}{Win32}
833 To install the binary Win32 version of the File daemon please see the
834 \ilink{Win32 Installation Chapter}{_ChapterStart7} in this document.
836 \subsection*{Windows Systems with CYGWIN Installed}
838 \index[general]{Windows Systems with CYGWIN Installed }
839 \index[general]{Installed!Windows Systems with CYGWIN }
840 \addcontentsline{toc}{subsection}{Windows Systems with CYGWIN Installed}
842 As of version 1.34, Bacula no longer uses CYGWIN for the Win32 File daemon.
843 However, it is still built under a CYGWIN build environment -- though you can
844 probably do it with VC Studio only. If you wish to build the Win32 File daemon
845 from the source, you will need Microsoft C++ version 6.0 or greater. In Bacula
846 prior to version 1.33, CYGWIN was used. Details for building it are in the
847 README file of the src/win32 directory.
849 Note, although most parts of Bacula build on Windows systems, the only part
850 that we have tested and used is the File daemon.
852 Finally, you should follow the installation instructions in the
853 \ilink{Win32 Installation}{_ChapterStart7} section of this document.
855 \subsection*{Kern's Configure Script}
856 \index[general]{Script!Kern's Configure }
857 \index[general]{Kern's Configure Script }
858 \addcontentsline{toc}{subsection}{Kern's Configure Script}
860 The script that I use for building on my ``production'' Linux machines is:
865 # This is Kern's configure script for Bacula
868 --sbindir=$HOME/bacula/bin \
869 --sysconfdir=$HOME/bacula/bin \
870 --enable-smartalloc \
872 --with-pid-dir=$HOME/bacula/bin/working \
873 --with-subsys-dir=$HOME/bacula/bin/working \
874 --with-mysql=$HOME/mysql \
875 --with-working-dir=$HOME/bacula/bin/working \
876 --with-dump-email=$USER \
877 --with-smtp-host=mail.your-site.com \
883 Note that I define the base port as 9101, which means that Bacula will use
884 port 9101 for the Director console, port 9102 for the File daemons, and port
885 9103 for the Storage daemons. These ports should be available on all systems
886 because they have been officially assigned to Bacula by IANA (Internet
887 Assigned Numbers Authority). We strongly recommend that you use only these
888 ports to prevent any conflicts with other programs. This is in fact the
889 default if you do not specify a {\bf \verb{--{with-baseport} option.
891 You may also want to put the following entries in your {\bf /etc/services}
892 file as it will make viewing the connections made by Bacula easier to
893 recognize (i.e. netstat -a):
903 \subsection*{Installing Bacula}
904 \index[general]{Bacula!Installing }
905 \index[general]{Installing Bacula }
906 \addcontentsline{toc}{subsection}{Installing Bacula}
908 Before setting up your configuration files, you will want to install Bacula in
909 its final location. Simply enter:
917 If you have previously installed Bacula, the old binaries will be overwritten,
918 but the old configuration files will remain unchanged, and the ``new''
919 configuration files will be appended with a {\bf .new}. Generally if you have
920 previously installed and run Bacula you will want to discard or ignore the
921 configuration files with the appended {\bf .new}.
923 \subsection*{Building a File Daemon or Client}
924 \index[general]{Client!Building a File Daemon or }
925 \index[general]{Building a File Daemon or Client }
926 \addcontentsline{toc}{subsection}{Building a File Daemon or Client}
928 If you run the Director and the Storage daemon on one machine and you wish to
929 back up another machine, you must have a copy of the File daemon for that
930 machine. If the machine and the Operating System are identical, you can simply
931 copy the Bacula File daemon binary file {\bf bacula-fd} as well as its
932 configuration file {\bf bacula-fd.conf} then modify the name and password in
933 the conf file to be unique. Be sure to make corresponding additions to the
934 Director's configuration file ({\bf bacula-dir.conf}).
936 If the architecture or the O/S level are different, you will need to build a
937 File daemon on the Client machine. To do so, you can use the same {\bf
938 ./configure} command as you did for your main program, starting either from a
939 fresh copy of the source tree, or using {\bf make\ distclean} before the {\bf
942 Since the File daemon does not access the Catalog database, you can remove the
943 {\bf \verb{--{with-mysql} or {\bf \verb{--{with-sqlite} options, then add {\bf
944 \verb{--{enable-client-only}. This will compile only the necessary libraries and the
945 client programs and thus avoids the necessity of installing one or another of
946 those database programs to build the File daemon. With the above option, you
947 simply enter {\bf make} and just the client will be built.
950 \subsection*{Auto Starting the Daemons}
951 \index[general]{Daemons!Auto Starting the }
952 \index[general]{Auto Starting the Daemons }
953 \addcontentsline{toc}{subsection}{Auto Starting the Daemons}
955 If you wish the daemons to be automatically started and stopped when your
956 system is booted (a good idea), one more step is necessary. First, the
957 ./configure process must recognize your system -- that is it must be a
958 supported platform and not {\bf unknown}, then you must install the platform
959 dependent files by doing:
964 make install-autostart
968 Please note, that the auto-start feature is implemented only on systems that
969 we officially support (currently, FreeBSD, RedHat Linux, and Solaris), and has
970 only been fully tested on RedHat Linux.
972 The {\bf make install-autostart} will cause the appropriate startup scripts to
973 be installed with the necessary symbolic links. On RedHat Linux systems, these
974 scripts reside in {\bf /etc/rc.d/init.d/bacula-dir} {\bf
975 /etc/rc.d/init.d/bacula-fd}, and {\bf /etc/rc.d/init.d/bacula-sd}. However the
976 exact location depends on what operating system you are using.
978 If you only wish to install the File daemon, you may do so with:
982 make install-autostart-fd
986 \subsection*{Other Make Notes}
987 \index[general]{Notes!Other Make }
988 \index[general]{Other Make Notes }
989 \addcontentsline{toc}{subsection}{Other Make Notes}
991 To simply build a new executable in any directory, enter:
999 To clean out all the objects and binaries (including the files named 1, 2, or
1000 3, which Kern uses as temporary files), enter:
1008 To really clean out everything for distribution, enter:
1016 note, this cleans out the Makefiles and is normally done from the top level
1017 directory to prepare for distribution of the source. To recover from this
1018 state, you must redo the {\bf ./configure} in the top level directory, since
1019 all the Makefiles will be deleted.
1021 To add a new file in a subdirectory, edit the Makefile.in in that directory,
1022 then simply do a {\bf make}. In most cases, the make will rebuild the Makefile
1023 from the new Makefile.in. In some case, you may need to issue the {\bf make} a
1024 second time. In extreme cases, cd to the top level directory and enter: {\bf
1027 To add dependencies:
1035 The {\bf make depend} appends the header file dependencies for each of the
1036 object files to Makefile and Makefile.in. This command should be done in each
1037 directory where you change the dependencies. Normally, it only needs to be run
1038 when you add or delete source or header files. {\bf make depend} is normally
1039 automatically invoked during the configuration process.
1049 This not normally done if you are developing Bacula, but is used if you are
1050 going to run it to backup your system.
1052 After doing a {\bf make install} the following files will be installed on your
1053 system (more or less). The exact files and location (directory) for each file
1054 depends on your {\bf ./configure} command (e.g. gnome-console and
1055 gnome-console.conf are not installed if you do not configure GNOME. Also, if
1056 you are using SQLite instead of mysql, some of the files will be different).
1077 create_mysql_database
1079 delete_catalog_backup
1085 lymake_bacula_tables
1100 \subsection*{Installing Tray Monitor}
1101 \index[general]{Monitor!Installing Tray }
1102 \index[general]{Installing Tray Monitor }
1103 \addcontentsline{toc}{subsection}{Installing Tray Monitor}
1105 The Tray Monitor is already installed if you used the {\bf
1106 \verb{--{enable-tray-monitor} configure option and ran {\bf make install}.
1108 As you don't run your graphical environment as root (if you do, you should
1109 change that bad habit), don't forget to allow your user to read {\bf
1110 tray-monitor.conf}, and to execute {\bf bacula-tray-monitor} (this is not a
1113 Then log into your graphical environment (KDE, Gnome or something else), run
1114 {\bf bacula-tray-monitor} as your user, and see if a cassette icon appears
1115 somewhere on the screen, usually on the task bar.
1116 If it doesn't, follow the instructions below related to your environment or
1119 \subsubsection*{GNOME}
1120 \index[general]{GNOME }
1121 \addcontentsline{toc}{subsubsection}{GNOME}
1123 System tray, or notification area if you use the GNOME terminology, has been
1124 supported in GNOME since version 2.2. To activate it, right-click on one of
1125 your panels, open the menu {\bf Add to this Panel}, then {\bf Utility} and
1126 finally click on {\bf Notification Area}.
1128 \subsubsection*{KDE}
1129 \index[general]{KDE }
1130 \addcontentsline{toc}{subsubsection}{KDE}
1132 System tray has been supported in KDE since version 3.1. To activate it,
1133 right-click on one of your panels, open the menu {\bf Add}, then {\bf Applet}
1134 and finally click on {\bf System Tray}.
1136 \subsubsection*{Other window managers}
1137 \index[general]{Managers!Other window }
1138 \index[general]{Other window managers }
1139 \addcontentsline{toc}{subsubsection}{Other window managers}
1141 Read the documentation to know if the Freedesktop system tray standard is
1142 supported by your window manager, and if applicable, how to activate it.
1144 \subsection*{Modifying the Bacula Configuration Files}
1145 \index[general]{Modifying the Bacula Configuration Files }
1146 \index[general]{Files!Modifying the Bacula Configuration }
1147 \addcontentsline{toc}{subsection}{Modifying the Bacula Configuration Files}
1150 \ilink{Configuring Bacula}{_ChapterStart16} in this manual for
1151 instructions on how to set Bacula configuration files.