User Tools

Site Tools


This is an old revision of the document!

To create the RPM packages of Bacula 5.0.2 on CentOS5 or RHEL5, perform this steps:

Build Script

For convenience you can download the script attached to this page. It performs all necessary steps described below.

OS, required packages

Do a base install of CentOS5 (i386 or x86_64 supported)

Now add some more packages (as root):

yum install autoconf automake e2fsprogs-devel gcc-c++ glibc-devel glibc-headers krb5-devel libacl-devel libgomp libstdc++-devel libtermcap-devel libxml2-devel m4 make mysql mysql-devel mysql-server ncurses ncurses-devel openssl-devel perl-DBI php qt4 qt4-devel readline-devel redhat-rpm-config rpm-build screen zlib-devel

Additional packages

To build the wzconsole, you must install additional packages. If you do not need wzconsole, you can skip this step. In this case, you must set “build_wzconsole 0” when performing the rpmbuild command (see below). Install the epel repo

rpm -Uvh

Install the additional packages:

yum install qwt qwt-devel wxGTK

Setup rpm_build environment

As a regular (non-root) user, setup your private rpm_build environment. Simply copy over the default rpm-build structure:

cp -r /usr/src/redhat ~/rpm_build

Create a .rpmmacros file in your home dir, with at least this content:

      %_topdir    %(echo ${HOME}/rpm_build)
      %_tmppath   %{_topdir}/tmp
      %packager   <Your_Firstname> <Your_LastName> <Your_Email_Address>
      # if you got your own rpm gpg key, add this two lines:
      #%_signature gpg
      #%_gpg_name  <Your_Firstname> <Your_LastName>

Build bacula rpms

Download the bacula .src.rpm files to a directory in the user folder structure (not as root!)

Then in that directory, as that non root user

rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql 1" --define "build_bat 1" --define "build_wzconsole 1" bacula-5.0.2-1.src.rpm
rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql 1" --define "build_bat 1" --define "build_wzconsole 1" bacula-bat-5.0.2-1.src.rpm
rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql 1" --define "build_bat 1" --define "build_wzconsole 1" bacula-mtx-5.0.2-1.src.rpm
rpmbuild --rebuild --define "build_centos5 1" --define "build_mysql 1" --define "build_bat 1" --define "build_wzconsole 1" bacula-docs-5.0.2-1.src.rpm

Install bacula (Bacula Server)

To install, copy the created rpm files (to be found in rpm_build/RPMS/<architecture> to your server and install using:

      rpm -Uvh bacula-libs-5.0.2-1.<arch>.rpm
      rpm -Uvh bacula-mysql-5.0.2-1.<arch>.rpm
      rpm -Uvh bacula-bat-5.0.2-1.<arch>.rpm

Setup the MySQL Database

Add the bacula user to MySQL. Allow connection from localhost only. (Adding “%” as the host part might lead to security issues.)

mysql -p

set password for 'bacula'@'localhost' = password ('YourPassword');

Modify the bacula sql scripts

Now you need to edit the bacula sql scripts to allow for a MySQL administrator level password

cd /usr/lib/bacula/
vi grant_mysql_privileges
vi create_mysql_database
vi make_mysql_tables

Original line:

if $bindir/mysql $* -u root -f <<END-OF-DATA

Modified line:

if $bindir/mysql -p $* -u root -f <<END-OF-DATA

Execute the bacula sql install scripts

WARNING! If you already got a bacula database, you must execute the update scripts NOT this install scripts. Otherwise you corrupt your current bacula database!

cd /usr/lib/bacula/

Configure bacula

Configure bacula director, file daemon, and storage daemon. Consult the Bacula documentation for this.

Start the services

      service bacula-sd start
      service bacula-dir start
      service bacula-fd start

You should now have a working installation of bacula server.

Install bacula on a client

On a client, you must install the bacula-client rpm package, only and configure the file /etc/bacula/bacula-fd.conf. Normally this means, pointing the daemon to your director and setting the client password.

Then start the fd daemon:

      service bacula-fd start


If you plan for a large bacula installation, it might be better to build the PostgreSQL version of bacula. Please consult the documentation on what rpmbuild settings and packages you need.

This document is based on howto_install_bacula_5.0.0_from_src.rpm_on_rhel_5_or_centos_5 .

howto_install_bacula_5.0.2_from_src.rpm_on_rhel_5_or_centos_5.1275473405.txt.gz · Last modified: 2010/06/02 11:10 by roos