This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
/
compile.tex
1714 lines (1432 loc) · 71.1 KB
/
compile.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%%
%%
\chapter{Installing Bareos}
% \label{InstallChapter}
% \index[general]{Bareos!Installing}
% \index[general]{Installing Bareos}
In general, you will need the Bareos source release, and if you want to run
a Windows client, you will need the Bareos Windows binary release.
However, Bareos needs certain third party packages (such as {\bf MySQL},
{\bf PostgreSQL}, or {\bf SQLite} to build and run
properly depending on the
options you specify. Normally, {\bf MySQL} and {\bf PostgreSQL} are
packages that can be installed on your distribution. However, if you do
not have them, to simplify your task, we have combined a number of these
packages into three {\bf depkgs} releases (Dependency Packages). This can
vastly simplify your life by providing you with all the necessary packages
rather than requiring you to find them on the Web, load them, and install
them.
\section{Source Release Files}
\index[general]{Source Files}
Beginning with Bareos 1.38.0, the source code has been broken into
four separate tar files each corresponding to a different module in
the Bareos SVN. The released files are:
\begin{description}
\item [bareos-5.0.0.tar.gz]
This is the primary source code release for Bareos. On each
release the version number (5.0.0) will be updated.
\item [bareos-docs-5.0.0.tar.bz2]
This file contains a copy of the docs directory with the
documents prebuild. English HTML directory, single HTML
file, and pdf file. The French, German, Spanish translations
are in progress, but are not built.
\item [bareos-gui-5.0.0.tar.gz]
This file contains the non-core GUI programs. Currently,
it contains bareos-web, a PHP program for producing management
viewing of your Bareos job status in a browser; and bimagemgr
a browser program for burning CDROM images with Bareos Volumes.
\item [bareos-rescue-5.0.0.tar.gz]
This is the Bareos Rescue USB key code. Note, the version number
of this package is not always tied to the Bareos release version, so
it may be different. Using this code, you can create a USB key
with your system configuration and containing a statically
linked version of the File daemon. This can permit you to easily
repartition and reformat your hard disks and reload your
system with Bareos in the case of a hard disk failure.
\item [win32bareos-5.0.0.exe]
This file is the 32 bit Windows installer for installing
the Windows client (File daemon) on a Windows machine.
This client will also run on 64 bit Windows machines, but
VSS support is not available if you are running a 64 bit
version of Windows. This installer installs only the FD,
the Director and Storage daemon are not included.
\item [win64bareos-5.0.0.exe]
This file is the 64 bit Windows installer for installing
Windows client (File daemon) on a Windows machine.
This client will only run on 64 bit Windows OS machines.
It will not run on 32 bit machines or 32 bit Windows OSes.
The win64bareos release is necessary for Volume Shadow
Copy (VSS) to work on Win64 OSes. This installer
installs only the FD, the Director and Storage daemon
are not included.
\end{description}
\label{upgrading1}
\section{Upgrading Bareos}
\index[general]{Upgrading Bareos}
\index[general]{Upgrading}
If you are upgrading from one Bareos version to another, you should first
carefully read the ReleaseNotes of all major versions between your current
version and the version to which you are upgrading. In many upgrades,
especially for minor patch upgrades (e.g. between 3.0.0 and 3.0.1) there
will be no database upgrade, and hence the process is rather simple.
With version 3.0.0 and later, you {\bf must} ensure that on any one
machine that all components of Bareos are running on exactly the
same version. Prior to version 3.0.0, it was possible to run a
lower level FD with a newer Director and SD. This is no longer the
case.
As always, we attempt to support older File daemons. This avoids the
need to do a simultaneous upgrade of many machines. For exactly what
older versions of the FD are supported, please see the ReleaseNotes
for the new version. In any case, you must always upgrade both the
Director and the Storage daemon at the same time, and you must also
upgrade any File daemon that is running on the same machine as a Director
or a Storage daemon (see the prior paragraph).
If the Bareos catalog
database has been upgraded (as it is almost every major release), you will
either need to reinitialize your database starting from scratch (not
normally a good idea), or save an ASCII copy of your database, then proceed
to upgrade it. If you are upgrading two major versions (e.g. 1.36 to 2.0)
then life will be more complicated because you must do two database
upgrades. See below for more on this.
Upgrading the catalog is normally done after Bareos is build and installed
by:
\begin{verbatim}
cd <installed-scripts-dir> (default /etc/bareos)
./update_bareos_tables
\end{verbatim}
This update script can also be find in the Bareos source src/cats
directory.
If there are several database upgrades between your version and the
version to which you are upgrading, you will need to apply each database
upgrade script. For your convenience, you can find all the old upgrade scripts
in the {\bf upgradedb} directory of the source code. You will need to edit the
scripts to correspond to your system configuration. The final upgrade script,
if any, can be applied as noted above.
If you are upgrading from one major version to another, you will need to
replace all your components at the same time as generally the inter-daemon
protocol will change. However, within any particular release (e.g. version
1.32.x) unless there is an oversight or bug, the daemon protocol will not
change. If this is confusing, simply read the ReleaseNotes very carefully as
they will note if all daemons must be upgraded at the same time.
Finally, please note that in general it is not necessary or desirable
to do a {\bf make uninstall} before doing an upgrade providing you are careful
not to change the installation directories. In fact, if you do so, you will
most likely delete all your conf files, which could be disastrous.
The normal procedure during an upgrade is simply:
\begin{verbatim}
./configure (your options)
make
make install
\end{verbatim}
In general none of your existing .conf or .sql files will be overwritten,
and you must do both the {\bf make} and {\bf make install} commands, a
{\bf make install} without the preceding {\bf make} will not work.
For additional information on upgrading, please see the \ilink{Upgrading Bareos
Versions}{upgrading} in the Tips chapter of this manual.
\section{Releases Numbering}
\index[general]{Release Numbering}
\index[general]{Version Numbering}
Every Bareos release whether beta or production has a different number
as well as the date of the release build. The numbering system follows
traditional Open Source conventions in that it is of the form.
\begin{verbatim}
major.minor.release
\end{verbatim}
For example:
\begin{verbatim}
1.38.11
\end{verbatim}
where each component (major, minor, patch) is a number.
The major number is currently 1 and normally does not change
very frequently. The minor number starts at 0 and increases
each for each production release by 2 (i.e. it is always an
even number for a production release), and the patch number is
starts at zero each time the minor number changes. The patch
number is increased each time a bug fix (or fixes) is released
to production.
So, as of this date (10 September 2006), the current production Bareos
release is version 1.38.11. If there are bug fixes, the next release
will be 1.38.12 (i.e. the patch number has increased by one).
For all patch releases where the minor version number does not change,
the database and all the daemons will be compatible. That means that
you can safely run a 1.38.0 Director with a 1.38.11 Client. Of course,
in this case, the Director may have bugs that are not fixed. Generally,
within a minor release (some minor releases are not so minor), all
patch numbers are officially released to production. This means that while
the current Bareos version is 1.38.11, versions 1.38.0, 1.38.1, ... 1.38.10
have all been previously released.
When the minor number is odd, it indicates that the package is under
development and thus may not be stable. For example, while the current
production release of Bareos is currently 1.38.11, the current development
version is 1.39.22. All patch versions of the development code are
available in the SVN (source repository). However, not all patch versions
of the development code (odd minor version) are officially released. When
they are released, they are released as beta versions (see below for a
definition of what beta means for Bareos releases).
In general when the minor number increases from one production release
to the next (i.e. 1.38.x to 1.40.0), the catalog database must be upgraded,
the Director and Storage daemon must always be on the same minor release
number, and often (not always), the Clients must also be on the same minor
release. As often as possible, we attempt to make new releases that are
downwards compatible with prior clients, but this is not always possible.
You must check the release notes. In general, you will have fewer problems
if you always run all the components on the same minor version number (i.e.
all either 1.38.x or 1.40.x but not mixed).
\label{BetaReleases}
\section*{Beta Releases}
\index[general]{Beta Releases}
Towards the end of the development cycle, which typically runs
one year from a major release to another, there will be several beta
releases of the development code prior to a production release.
As noted above, beta versions always have odd minor version numbers
(e.g 1.37.x or 1.39.x).
The purpose of the beta releases is to allow early adopter users to test
the new code. Beta releases are made with the following considerations:
\begin{itemize}
\item The code passes the regression testing on FreeBSD, Linux, and Solaris
machines.
\item There are no known major bugs, or on the rare occasion that
there are, they will be documented or already in the bugs database.
\item Some of the new code/features may not yet be tested.
\item Bugs are expected to be found, especially in the new
code before the final production release.
\item The code will have been run in production in at least one small
site (mine).
\item The Win32 client will have been run in production at least
one night at that small site.
\item The documentation in the manual is unlikely to be complete especially
for the new features, and the Release Notes may not be fully
organized.
\item Beta code is not generally recommended for everyone, but
rather for early adopters.
\end{itemize}
\label{Dependency}
\section{Dependency Packages}
\index[general]{Dependency Packages}
\index[general]{Packages!Dependency}
As discussed above, we have combined a number of third party packages that
Bareos might need into the {\bf depkgs} release. You can,
of course, get the latest packages from the original authors or
from your operating system supplier. The locations of
where we obtained the packages are in the README file in each package.
However, be aware that the packages in the depkgs files have been tested by us
for compatibility with Bareos.
Typically, a dependency package will be named {\bf depkgs-ddMMMyy.tar.gz}
where {\bf dd} is the day we release it, {\bf MMM}
is the abbreviated month (e.g. Jan), and {\bf yy} is the year. An actual
example is: {\bf depkgs-18Dec.tar.gz}. To install and build this package (if
needed), you do the following:
\begin{enumerate}
\item Create a {\bf bareos} directory, into which you will place both the
Bareos source as well as the dependency package.
\item Detar the {\bf depkgs} into the {\bf bareos} directory.
\item cd bareos/depkgs
\item make
\end{enumerate}
Although the exact composition of the dependency packages may change from time
to time, the current makeup is the following:
\addcontentsline{lot}{table}{Dependency Packages}
\begin{longtable}{|l|l|l|}
\hline
\multicolumn{1}{|c| }{\bf 3rd Party Package} & \multicolumn{1}{c| }{\bf depkgs}
& \multicolumn{1}{c| }{\bf depkgs-qt} \\
\hline {SQLite3 } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{ }\\
\hline {mtx } & \multicolumn{1}{c| }{X } & \multicolumn{1}{c| }{ } \\
\hline {qt4 } & \multicolumn{1}{c| }{ } & \multicolumn{1}{c| }{X } \\
\hline
\end{longtable}
Note, some of these packages are quite large, so that building them can be a
bit time consuming. The above instructions will build all the packages
contained in the directory. However, when building Bareos, it will take only
those pieces that it actually needs.
Alternatively, you can make just the packages that are needed. For example,
\footnotesize
\begin{verbatim}
cd bareos/depkgs
make sqlite
\end{verbatim}
\normalsize
will configure and build only the SQLite package.
You should build the packages that you will require in {\bf depkgs} a
prior to configuring and building Bareos, since Bareos will need
them during the build process.
Note, the {\bf depkgs-qt} package is required for building bat, because
bat is currently built with Qt version 4.3.4. It can be built with other
Qt versions, but that almost always creates problems or introduces
instabilities.
You can build the depkgs-qt with the following:
\footnotesize
\begin{verbatim}
cd bareos
tar xfvz depkgs-qt-28Jul09.tar.gz
cd depkgs-qt
make qt4
source qt4-path
\end{verbatim}
\normalsize
Doing the {\bf source qt4-path} defines the following environment
variables:
\footnotesize
\begin{verbatim}
QTDIR
QTLIB
QTINC
\end{verbatim}
\normalsize
Each one should point to a specific location in the depkgs-qt package
that you loaded. It also puts the depkgs-qt/qt4/bin directory
on your path before all other directories. This ensures that
the bat build will use your Qt 4.3.4 library rather than any that
might be on your system.
Before running your Bareos build, please make sure that
{\bf qmake-qt4} is not on your path. If it is please rename it. If
you don't do this, Bareos will attempt to build with any Qt4 package
installed on your system rather than the one you just built.
If you logoff and log back in, you must re-source the depkgs-qt/qt4-patch
file before attempting to rebuild the bat part of Bareos.
For more information on the {\bf depkgs-qt} package, please read the
INSTALL file in the main directory of that package. If you are going to
build Qt4 using {\bf depkgs-qt}, you must source the {\bf qt4-paths} file
included in the package prior to building Bareos. Please read the INSTALL
file for more details.
Even if you do not use SQLite, you might find it worthwhile to build {\bf mtx}
because the {\bf tapeinfo} program that comes with it can often provide you
with valuable information about your SCSI tape drive (e.g. compression,
min/max block sizes, ...). Note, most distros provide {\bf mtx} as part of
their release.
The {\bf depkgs1} package is depreciated and previously contained
readline, which should be available on all operating systems.
The {\bf depkgs-win32} package is deprecated and no longer used in
Bareos version 1.39.x and later. It was previously used to build
the native Win32 client program, but this program is now built on Linux
systems using cross-compiling. All the tools and third party libraries
are automatically downloaded by executing the appropriate scripts. See
src/win32/README.mingw32 for more details.
\section{Building Bareos from Source}
\label{Building}
\index[general]{Source!Building Bareos from}
\index[general]{Building Bareos from Source}
The basic installation is rather simple.
\begin{enumerate}
\item Install and build any {\bf depkgs} as noted above. This
should be unnecessary on most modern Operating Systems.
\item Configure and install MySQL or PostgreSQL (if desired).
\ilink{Installing and Configuring MySQL Phase I}{MySqlChapter} or
\ilink{Installing and Configuring PostgreSQL Phase
I}{PostgreSqlChapter}. If you are installing from rpms, and are
using MySQL, please be sure to install {\bf mysql-devel}, so that the MySQL
header files are available while compiling Bareos. In addition, the MySQL
client library {\bf mysqlclient} requires the gzip compression library {\bf
libz.a} or {\bf libz.so}. If you are using rpm packages, these libraries are
in the {\bf libz-devel} package. On Debian systems, you will need to load the
{\bf zlib1g-dev} package. If you are not using rpms or debs, you will need to
find the appropriate package for your system.
Note, if you already have a running MySQL or PostgreSQL on your system, you
can skip this phase provided that you have built the thread safe libraries.
And you have already installed the additional rpms noted above.
SQLite is not supported on Solaris. This is because it
frequently fails with bus errors. However SQLite3 may work.
\item Detar the Bareos source code preferably into the {\bf bareos} directory
discussed above.
\item {\bf cd} to the directory containing the source code.
\item ./configure (with appropriate options as described below). Any
path names you specify as options on the ./configure command line
must be absolute paths and not relative.
\item Check the output of ./configure very carefully, especially the Install
binaries and Install config directories. If they are not correct,
please rerun ./configure until they are. The output from ./configure is
stored in {\bf config.out} and can be re-displayed at any time without
rerunning the ./configure by doing {\bf cat config.out}.
\item If after running ./configure once, you decide to change options and
re-run it, that is perfectly fine, but before re-running it, you should run:
\footnotesize
\begin{verbatim}
make distclean
\end{verbatim}
\normalsize
so that you are sure to start from scratch and not have a mixture of the two
options. This is because ./configure caches much of the information. The {\bf
make distclean} is also critical if you move the source directory from one
machine to another. If the {\bf make distclean} fails, just ignore it and
continue on.
\item make
If you get errors while linking in the Storage daemon directory
(src/stored), it is probably because you have not loaded the static
libraries on your system. I noticed this problem on a Solaris system.
To correct it, make sure that you have not added {\bf
{-} {-}enable-static-tools} to the {\bf ./configure} command.
If you skip this step ({\bf make}) and proceed immediately to the {\bf
make install} you are making two serious errors: 1. your install will
fail because Bareos requires a {\bf make} before a {\bf make install}.
2. you are depriving yourself of the chance to make sure there are no
errors before beginning to write files to your system directories.
\item make install
Please be sure you have done a {\bf make} before entering this command,
and that everything has properly compiled and linked without errors.
\item If you are new to Bareos, we {\bf strongly} recommend that you skip
the next step and use the default configuration files, then run the
example program in the next chapter, then come back and modify your
configuration files to suit your particular needs.
\item Customize the configuration files for each of the three daemons
(Directory, File, Storage) and for the Console program. For the details
of how to do this, please see \ilink{Setting Up Bareos Configuration
Files}{ConfigureChapter} in the Configuration chapter of this manual. We
recommend that you start by modifying the default configuration files
supplied, making the minimum changes necessary. Complete customization
can be done after you have Bareos up and running. Please take care when
modifying passwords, which were randomly generated, and the {\bf Name}s
as the passwords and names must agree between the configuration files
for security reasons.
\label{CreateDatabase}
\item Create the Bareos MySQL database and tables
(if using MySQL)
\ilink{Installing and Configuring MySQL Phase II}{mysql_phase2} or
create the Bareos PostgreSQL database and tables
\ilink{Configuring PostgreSQL
II}{PostgreSQL_configure} or alternatively if you are using
SQLite \ilink{Installing and Configuring SQLite Phase II}{phase2}.
\item Start Bareos ({\bf ./bareos start}) Note. the next chapter shows you
how to do this in detail.
\item Interface with Bareos using the Console program
\item For the previous two items, please follow the instructions in the
\ilink{Running Bareos}{TutorialChapter} chapter of this manual,
where you will run a simple backup and do a restore. Do this before you make
heavy modifications to the configuration files so that you are sure that
Bareos works and are familiar with it. After that changing the conf files
will be easier.
\item If after installing Bareos, you decide to "move it", that is to
install it in a different set of directories, proceed as follows:
\footnotesize
\begin{verbatim}
make uninstall
make distclean
./configure (your-new-options)
make
make install
\end{verbatim}
\normalsize
\end{enumerate}
If all goes well, the {\bf ./configure} will correctly determine which
operating system you are running and configure the source code appropriately.
Currently, FreeBSD, Linux (Red Hat), and Solaris are supported. The Bareos
client (File daemon) is reported to work with MacOS X 10.3 is if
readline support is not enabled (default) when building the client.
If you install Bareos on more than one system, and they are identical, you can
simply transfer the source tree to that other system and do a "make
install". However, if there are differences in the libraries or OS versions,
or you wish to install on a different OS, you should start from the original
compress tar file. If you do transfer the source tree, and you have previously
done a ./configure command, you MUST do:
\footnotesize
\begin{verbatim}
make distclean
\end{verbatim}
\normalsize
prior to doing your new ./configure. This is because the GNU autoconf tools
cache the configuration, and if you re-use a configuration for a Linux machine
on a Solaris, you can be sure your build will fail. To avoid this, as
mentioned above, either start from the tar file, or do a "make distclean".
In general, you will probably want to supply a more complicated {\bf
configure} statement to ensure that the modules you want are built and that
everything is placed into the correct directories.
For example, on Fedora, Red Hat, or SuSE one could use the following:
\footnotesize
\begin{verbatim}
CFLAGS="-g -Wall" \
./configure \
--sbindir=$HOME/bareos/bin \
--sysconfdir=$HOME/bareos/bin \
--with-pid-dir=$HOME/bareos/bin/working \
--with-subsys-dir=$HOME/bareos/bin/working \
--with-mysql \
--with-working-dir=$HOME/bareos/bin/working \
--with-dump-email=$USER
\end{verbatim}
\normalsize
The advantage of using the above configuration to start is that
everything will be put into a single directory, which you can later delete
once you have run the examples in the next chapter and learned how Bareos
works. In addition, the above can be installed and run as non-root.
For the developer's convenience, I have added a {\bf defaultconfig} script to
the {\bf examples} directory. This script contains the statements that you
would normally use, and each developer/user may modify them to suit his needs.
You should find additional useful examples in this directory as well.
The {\bf \verb:--:enable-conio} or {\bf \verb:--:enable-readline} options are
useful because they provide a command line history, editing capability for the
Console program and tab completion on various option. If you have included
either option in the build, either the {\bf termcap} or the {\bf ncurses}
package will be needed to link. On most systems, including Red Hat and SuSE,
you should include the ncurses package. If Bareos's configure process finds
the ncurses libraries, it will use those rather than the termcap library. On
some systems, such as SuSE, the termcap library is not in the standard library
directory. As a consequence, the option may be disabled or you may get an
error message such as:
\footnotesize
\begin{verbatim}
/usr/lib/gcc-lib/i586-suse-linux/3.3.1/.../ld:
cannot find -ltermcap
collect2: ld returned 1 exit status
\end{verbatim}
\normalsize
while building the Bareos Console. In that case, you will need to set the {\bf
LDFLAGS} environment variable prior to building.
\footnotesize
\begin{verbatim}
export LDFLAGS="-L/usr/lib/termcap"
\end{verbatim}
\normalsize
The same library requirements apply if you wish to use the readline subroutines
for command line editing, history and tab completion or if you are using a
MySQL library that requires encryption. If you need encryption, you can either
export the appropriate additional library options as shown above or,
alternatively, you can include them directly on the ./configure line as in:
\footnotesize
\begin{verbatim}
LDFLAGS="-lssl -lcyrpto" \
./configure <your-options>
\end{verbatim}
\normalsize
On some systems such as Mandriva, readline tends to
gobble up prompts, which makes it totally useless. If this happens to you, use
the disable option, or if you are using version 1.33 and above try using {\bf
\verb:--:enable-conio} to use a built-in readline replacement. You will still need
either the termcap or the ncurses library, but it is unlikely that the {\bf conio}
package will gobble up prompts.
readline is no longer supported after version 1.34. The code within Bareos
remains, so it should be usable, and if users submit patches for it, we will
be happy to apply them. However, due to the fact that each version of
readline seems to be incompatible with previous versions, and that there
are significant differences between systems, we can no longer afford to
support it.
\section{What Database to Use?}
\label{DB}
\index[general]{What Database to Use?}
\index[general]{Use!What Database to}
Before building Bareos you need to decide if you want to use SQLite, MySQL, or
PostgreSQL. If you are not already running MySQL or PostgreSQL, you might
want to start by testing with SQLite (not supported on Solaris).
This will greatly simplify the setup for you
because SQLite is compiled into Bareos an requires no administration. It
performs well and is suitable for small to medium sized installations (maximum
10-20 machines). However, we should note that a number of users have
had unexplained database corruption with SQLite. For that reason, we
recommend that you install either PostgreSQL or MySQL for production
work.
If you wish to use MySQL as the Bareos catalog, please see the
\ilink{Installing and Configuring MySQL}{MySqlChapter} chapter of this
manual. You will need to install MySQL prior to continuing with the
configuration of Bareos. MySQL is a high quality database that is very
efficient and is suitable for small and medium sized installation (up to
2,000,000 files per job). It is slightly more complicated than SQLite to setup
and administer because it has a number of sophisticated features such as
userids and passwords. It runs as a separate process, is truly professional and
can manage a database of any size.
If you wish to use PostgreSQL as the Bareos catalog, please see the
\ilink{Installing and Configuring PostgreSQL}{PostgreSqlChapter} chapter of
this manual. You will need to install PostgreSQL prior to continuing with the
configuration of Bareos. PostgreSQL is very similar to MySQL, though it tends
to be slightly more SQL92 compliant and has many more advanced features such as
transactions, stored procedures, and the such. It requires a certain knowledge
to install and maintain. PostgreSQL is suitable for any sized installation
(some sites have much more than 1 billion objects in the Catalog). Bareos uses
many optimized PostgreSQL functions, and can run more than 10 time faster on
jobs having millions of files than MySQL (Specially in during restore, accurate
mode, bvfs queries and when the database server is not on the same host than
the Director). It's possible to switch from MySQL/SQLite to PostgreSQL, but it
requires some DBA knowledge.
If you wish to use SQLite as the Bareos catalog, please see
\ilink{Installing and Configuring SQLite}{SqlLiteChapter} chapter of
this manual. SQLite is not supported on Solaris.
\section{Quick Start}
\index[general]{Quick Start}
\index[general]{Start!Quick}
There are a number of options and important considerations given below
that you can skip for the moment if you have not had any problems building
Bareos with a simplified configuration as shown above.
If the ./configure process is unable to find specific libraries (e.g.
libintl, you should ensure that the appropriate package is installed on
your system. Alternatively, if the package is installed in a non-standard
location (as far as Bareos is concerned), then there is generally an
option listed below (or listed with "./configure {-} {-}help" that will
permit you to specify the directory that should be searched. In other
cases, there are options that will permit you to disable to feature
(e.g. {-} {-}disable-nls).
If you want to dive right into it, we recommend you skip to the next chapter,
and run the example program. It will teach you a lot about Bareos and as an
example can be installed into a single directory (for easy removal) and run as
non-root. If you have any problems or when you want to do a real installation,
come back to this chapter and read the details presented below.
\section{Configure Options}
\label{Options}
\index[general]{Options!Configure}
\index[general]{Configure Options}
The following command line options are available for {\bf configure} to
customize your installation.
\begin{description}
\item [ \--prefix={\textless}patch{\textgreater}] \hfill \\
\index[general]{{-}prefix}
This option is meant to allow you to direct where the architecture
independent files should be placed. However, we find this a somewhat
vague concept, and so we have not implemented this option other than
to use any explicit prefix that you may define. If you do not
explicitly specify a prefix, Bareos's configure routine will not use
the default value that ./configure --help prints.
As a consequence, we suggest that
you avoid it. We have provided options that allow you to explicitly
specify the directories for each of the major categories of installation
files.
\item [ {-}{\-}sbindir={\textless}binary-path{\textgreater}] \hfill \\
\index[general]{{-}{\-}sbindir}
Defines where the Bareos binary (executable) files will be placed during a
{\bf make install} command.
\item [ {-}{\-}sysconfdir={\textless}config-path{\textgreater}] \hfill \\
\index[general]{{-}{\-}sysconfdir}
Defines where the Bareos configuration files should be placed during a
{\bf make install} command.
\item [ {-}{\-}mandir={\textless}path{\textgreater}] \hfill \\
\index[general]{{-}{\-}mandir}
Note, as of Bareos version 1.39.14, the meaning of any path
specified on this option is change from prior versions. It
now specifies the top level man directory.
Previously the mandir specified the full path to where you
wanted the man files installed.
The man files will be installed in gzip'ed format under
mandir/man1 and mandir/man8 as appropriate.
For the install to succeed you must have {\bf gzip} installed
on your system.
By default, Bareos will install the Unix man pages in
/usr/share/man/man1 and /usr/share/man/man8.
If you wish the man page to be installed in
a different location, use this option to specify the path.
Note, the main HTML and PDF Bareos documents are in a separate
tar file that is not part of the source distribution.
\item [ {-}{\-}datadir={\textless}path{\textgreater}] \hfill \\
\index[general]{{-}{\-}datadir}
If you translate Bareos or parts of Bareos into a different language
you may specify the location of the po files using the {\bf
{-}{\-}datadir} option. You must manually install any po files as
Bareos does not (yet) automatically do so.
\item [ {-}{\-}disable-ipv6] \hfill \\
\index[general]{{-}{\-}disable-ipv6}
\item [ {-}{\-}enable-smartalloc]
\index[general]{{-}{\-}enable-smartalloc}
This enables the inclusion of the Smartalloc orphaned buffer detection
code. This option is highly recommended. Because we never build
without this option, you may experience problems if it is not enabled.
In this case, simply re-enable the option. We strongly recommend
keeping this option enabled as it helps detect memory leaks. This
configuration parameter is used while building Bareos
\item [ {-}{\-}enable-bat] \hfill \\
\label{enablebat}
\index[general]{{-}{\-}enable-bat}
If you have Qt4 >= 4.3.4 installed on your computer including the
libqt4 and libqt4-devel (libqt4-dev on Debian) libraries, and you want
to use the Bareos Administration Tool (bat) GUI Console interface to
Bareos, you must specify this option. Doing so will build everything in
the {\bf src/qt-console} directory. The build with enable-bat will work
only with a full Bareos build (i.e. it will not work with a client-only
build).
Qt4 is available on OpenSUSE 10.2, CentOS 5, Fedora, and Debian. If it
is not available on your system, you can download the {\bf depkgs-qt}
package from the Bareos Source Forge download area and build it.
See the INSTALL file in that package for more details. In particular
to use the Qt4 built by {\bf depkgs-qt} you {\bf must} source the file
{\bf qt4-paths}.
\item [ {-}{\-}enable-batch-insert] \hfill \\
\index[general]{{-}{\-}enable-batch-insert}
This option enables batch inserts of the attribute records (default) in
the catalog database, which is much faster (10 times or more) than
without this option for large numbers of files. However, this option
will automatically be disabled if your SQL libraries are not
thread safe. If you find that batch mode is not enabled on your Bareos
installation, then your database most likely does not support threads.
On most systems, MySQL, PostgreSQL and SQLite3 are thread safe.
To verify that your PostgreSQL is thread safe, you can try this
(change the path to point to your particular installed libpq.a;
these commands were issued on FreeBSD 6.2):
\begin{verbatim}
$ nm /usr/local/lib/libpq.a | grep PQputCopyData
00001b08 T PQputCopyData
$ nm /usr/local/lib/libpq.a | grep mutex
U pthread_mutex_lock
U pthread_mutex_unlock
U pthread_mutex_init
U pthread_mutex_lock
U pthread_mutex_unlock
\end{verbatim}
The above example shows a libpq that contains the required function
PQputCopyData and is thread enabled (i.e. the pthread\_mutex* entries).
If you do not see PQputCopyData, your version of PostgreSQL is too old
to allow batch insert. If you do not see the mutex entries, then thread
support has not been enabled. Our tests indicate you usually need to
change the configuration options and recompile/reinstall the PostgreSQL
client software to get thread support.
Bareos always links to the thread safe MySQL libraries.
Running with Batch Insert turned on is recommended because it can
significantly improve attribute insertion times. However, it does
put a significantly larger part of the work on your SQL engine, so
you may need to pay more attention to tuning it. In particular,
Batch Insert can require large temporary table space, and consequently,
the default location (often /tmp) may run out of space causing errors.
For MySQL, the location is set in my.conf with "tmpdir". You may also
want to increase the memory available to your SQL engine to further
improve performance during Batch Inserts.
\item [ {-}{\-}enable-ndmp] \hfill \\
\index[general]{{-}{\-}enable-ndmp}
This switch enables the build of NDMP (Network Data Management Protocol)
support.
\item [ {-}{\-}enable-scsi-crypto] \hfill \\
\index[general]{{-}{\-}enable-scsi-crypto}
This switch enables the support for low level SCSI crypto support.
Modern tape drives (e.g. LTO4+) have the ability to encrypt the data
on the tape with hardware support at full writing speed.
With the scsi crypto support Bareos supports this feature and manages
the keys that are needed for the tape encryption.
\item [ {-}{\-}enable-tray-monitor] \hfill \\
\index[general]{{-}{\-}enable-tray-monitor}
If you have GTK installed on your computer, you run a graphical
environment or a window manager compatible with the FreeDesktop system
tray standard (like KDE and GNOME) and you want to use a GUI to monitor
Bareos daemons, you must specify this option. Doing so will build
everything in the {\bf src/tray-monitor} directory. Note, due to
restrictions on what can be linked with GPLed code, we were forced to
remove the egg code that dealt with the tray icons and replace it by
calls to the GTK+ API, and unfortunately, the tray icon API necessary
was not implemented until GTK version 2.10 or later.
\item [ {-}{\-}enable-static-tools] \hfill \\
\index[general]{{-}{\-}enable-static-tools}
This option causes the linker to link the Storage daemon utility tools
({\bf bls}, {\bf bextract}, and {\bf bscan}) statically. This permits
using them without having the shared libraries loaded. If you have
problems linking in the {\bf src/stored} directory, make sure you have
not enabled this option, or explicitly disable static linking by adding
{\bf \verb:--:disable-static-tools}.
\item [ {-}{\-}enable-static-fd] \hfill \\
\index[general]{{-}{\-}enable-static-fd}
This option causes the make process to build a {\bf static-bareos-fd} in
addition to the standard File daemon. This static version will include
statically linked libraries and is required for the Bare Metal recovery.
This option is largely superseded by using {\bf make static-bareos-fd}
from with in the {\bf src/filed} directory. Also, the {\bf
\verb:--:enable-client-only} option described below is useful for just
building a client so that all the other parts of the program are not
compiled.
When linking a static binary, the linker needs the static versions
of all the libraries that are used, so frequently users will
experience linking errors when this option is used. The first
thing to do is to make sure you have the static glibc library
installed on your system. The second thing to do is the make sure
you do not specify {\bf {-}{\-}openssl} or {\bf {-}{\-}with-python}
on your ./configure statement as these options require additional
libraries. You may be able to enable those options, but you will
need to load additional static libraries.
\item [ {-}{\-}enable-static-sd] \hfill \\
\index[general]{{-}{\-}enable-static-sd}
This option causes the make process to build a {\bf static-bareos-sd} in
addition to the standard Storage daemon. This static version will
include statically linked libraries and could be useful during a Bare
Metal recovery.
When linking a static binary, the linker needs the static versions
of all the libraries that are used, so frequently users will
experience linking errors when this option is used. The first
thing to do is to make sure you have the static glibc library
installed on your system. The second thing to do is the make sure
you do not specify {\bf {-}{\-}openssl} or {\bf {-}{\-}with-python}
on your ./configure statement as these options require additional
libraries. You may be able to enable those options, but you will
need to load additional static libraries.
\item [ {-}{\-}enable-static-dir] \hfill \\
\index[general]{{-}{\-}enable-static-dir}
This option causes the make process to build a {\bf static-bareos-dir}
in addition to the standard Director. This static version will include
statically linked libraries and could be useful during a Bare Metal
recovery.
When linking a static binary, the linker needs the static versions
of all the libraries that are used, so frequently users will
experience linking errors when this option is used. The first
thing to do is to make sure you have the static glibc library
installed on your system. The second thing to do is the make sure
you do not specify {\bf {-}{\-}openssl} or {\bf {-}{\-}with-python}
on your ./configure statement as these options require additional
libraries. You may be able to enable those options, but you will
need to load additional static libraries.
\item [ {-}{\-}enable-static-cons] \hfill \\
\index[general]{{-}{\-}enable-static-cons}
This option causes the make process to build a {\bf static-console} in
addition to the standard console. This static version will include
statically linked libraries and could be useful during a Bare Metal
recovery.
When linking a static binary, the linker needs the static versions
of all the libraries that are used, so frequently users will
experience linking errors when this option is used. The first
thing to do is to make sure you have the static glibc library
installed on your system. The second thing to do is the make sure
you do not specify {\bf {-}{\-}openssl} or {\bf {-}{\-}with-python}
on your ./configure statement as these options require additional
libraries. You may be able to enable those options, but you will
need to load additional static libraries.
\item [ {-}{\-}enable-client-only] \hfill \\
\index[general]{{-}{\-}enable-client-only}
This option causes the make process to build only the File daemon and
the libraries that it needs. None of the other daemons, storage tools,
nor the console will be built. Likewise a {\bf make install} will then
only install the File daemon. To cause all daemons to be built, you
will need to do a configuration without this option. This option
greatly facilitates building a Client on a client only machine.
When linking a static binary, the linker needs the static versions
of all the libraries that are used, so frequently users will
experience linking errors when this option is used. The first
thing to do is to make sure you have the static glibc library
installed on your system. The second thing to do is the make sure
you do not specify {\bf {-}{\-}openssl} or {\bf {-}{\-}with-python}
on your ./configure statement as these options require additional
libraries. You may be able to enable those options, but you will
need to load additional static libraries.
\item [ {-}{\-}enable-build-dird] \hfill \\
\index[general]{{-}{\-}enable-build-dird}
This option causes the make process to build the Director and the
Director's tools. By default, this option is on, but you may turn
it off by using {\bf {-}{\-}disable-build-dird} to prevent the
Director from being built.
\item [ {-}{\-}enable-build-stored] \hfill \\
\index[general]{{-}{\-}enable-build-stored}
This option causes the make process to build the Storage daemon.
By default, this option is on, but you may turn
it off by using {\bf {-}{\-}disable-build-stored} to prevent the
Storage daemon from being built.
\item [ {-}{\-}enable-largefile] \hfill \\
\index[general]{{-}{\-}enable-largefile}
This option (default) causes Bareos to be built with 64 bit file address
support if it is available on your system. This permits Bareos to read and
write files greater than 2 GBytes in size. You may disable this feature and
revert to 32 bit file addresses by using {\bf \verb:--:disable-largefile}.
\item [ {-}{\-}disable-nls] \hfill \\
\index[general]{{-}{\-}disable-nls}
By default, Bareos uses the GNU Native Language Support (NLS) libraries. On
some machines, these libraries may not be present or may not function
correctly (especially on non-Linux implementations). In such cases, you
may specify {\bf {-}{\-}disable-nls} to disable use of those libraries.
In such a case, Bareos will revert to using English.
\item [ {-}{\-}disable-ipv6] \hfill \\
\index[general]{{-}{\-}disable-ipv6}
By default, Bareos enables IPv6 protocol. On some systems, the files
for IPv6 may exist, but the functionality could be turned off in the
kernel. In that case, in order to correctly build Bareos, you will
explicitly need to use this option so that Bareos does not attempt
to reference OS function calls that do not exist.
\item [ {-}{\-}with-sqlite3={\textless}sqlite3-path{\textgreater}] \hfill \\
\index[general]{{-}{\-}with-sqlite3}
This enables use of the SQLite version 3.x database. The {\bf
sqlite3-path} is not normally specified as Bareos looks for the
necessary components in a standard location ({\bf depkgs/sqlite3}). See
\ilink{Installing and Configuring SQLite}{SqlLiteChapter} chapter of
this manual for more details. SQLite3 is not supported on Solaris.
\item [ {-}{\-}with-mysql={\textless}mysql-path{\textgreater}] \hfill \\
\index[general]{{-}{\-}with-mysql}
This enables building of the Catalog services for Bareos. It assumes
that MySQL is running on your system, and expects it to be installed in
the {\bf mysql-path} that you specify. Normally, if MySQL is installed
in a standard system location, you can simply use {\bf {-}{\-}with-mysql}
with no path specification. If you do use this option, please proceed
to installing MySQL in the \ilink{Installing and Configuring
MySQL}{MySqlChapter} chapter before proceeding with the configuration.
See the note below under the {-}{\-}with-postgresql item.
\item [ {-}{\-}with-postgresql={\textless}path{\textgreater}] \hfill \\
\index[general]{{-}{\-}with-postgresql}
This provides an explicit path to the PostgreSQL libraries if Bareos