In which directory should I compile from source?

Hi
The release was baculum, not bacula :wink:

I see no reason to be root as any user options can be set during
configure, which could be root…

@heyjoe here is the list of configure options…


 ./configure --help
`configure' configures bacula 7.1.0 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/bacula]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

X features:
  --x-includes=DIR    X include files are in DIR
  --x-libraries=DIR   X library files are in DIR

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE=ARG]  include FEATURE [ARG=yes]
  --enable-libtool        enable building using GNU libtool [default=yes]
  --enable-shared=PKGS]  build shared libraries [default=yes]
  --enable-static=PKGS]  build static libraries [default=no]
  --enable-fast-install=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-includes       enable installing of include files [default=no]
  --disable-nls           do not use Native Language Support
  --disable-rpath         do not hardcode runtime library paths
  --enable-bat            enable build of bat Qt4 GUI [default=no]
  --enable-smartalloc     enable smartalloc debugging support [default=no]
  --enable-lockmgr        enable lock manager support [default=no]
  --enable-static-tools   enable static tape tools [default=no]
  --enable-static-fd      enable static File daemon [default=no]
  --enable-static-sd      enable static Storage daemon [default=no]
  --enable-static-dir     enable static Director [default=no]
  --enable-static-cons    enable static Console [default=no]
  --enable-client-only    build client (File daemon) only [default=no]
  --enable-build-dird     enable building of dird (Director) [default=yes]
  --enable-build-stored   enable building of stored (Storage daemon)
                          [default=yes]
  --disable-conio         disable conio support [default=no]
  --enable-ipv6           enable ipv6 support [default=yes]
  --disable-readline      disable readline support [default=yes]
  --enable-batch-insert   enable the DB batch insert code [default=yes]
  --disable-largefile     omit support for large files
  --disable-afs           disable afs support [default=auto]
  --disable-lzo           disable lzo support [default=yes]
  --disable-acl           disable acl support [default=auto]
  --disable-xattr         disable xattr support [default=auto]

Optional Packages:
  --with-PACKAGE=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic=PKGS]       try to use only PIC/non-PIC objects [default=use
                          both]
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot=DIR Search for dependent libraries within DIR
                        (or the compiler's sysroot if not specified).
  --with-gnu-ld           assume the C compiler uses GNU ld default=no
  --with-libiconv-prefix=DIR]  search for libiconv in DIR/include and DIR/lib
  --without-libiconv-prefix     don't search for libiconv in includedir and libdir
  --with-libintl-prefix=DIR]  search for libintl in DIR/include and DIR/lib
  --without-libintl-prefix     don't search for libintl in includedir and libdir
  --with-included-gettext use the GNU gettext library included here
  --with-readline=DIR]   specify readline library directory
  --with-tcp-wrappers=DIR]
                          enable tcpwrappers support
  --with-openssl=DIR]    Include OpenSSL support. DIR is the OpenSSL base
  --with-working-dir=PATH specify path of Bacula working directory
  --with-archivedir=PATH  specify path of SD archive directory
  --with-basename=RESNAME specify base resource name for daemons
  --with-hostname=RESNAME specify host name for daemons
  --with-scriptdir=PATH   specify path of Bacula scripts directory
  --with-bsrdir=PATH      specify path of Bacula bsrs directory
  --with-logdir=PATH      specify path of Bacula logs directory
  --with-plugindir=PATH   specify path of Bacula plugins directory
  --with-dump-email=EMAIL dump email address
  --with-job-email=EMAIL  job output email address
  --with-smtp-host=HOST   SMTP mail host address
  --with-pid-dir=PATH     specify location of Bacula pid files
  --with-subsys-dir=PATH  specify location of Bacula subsys file
  --with-baseport=PORT    specify base port address for daemons
  --with-dir-password=PASSWORD
                          specify Director's password
  --with-fd-password=PASSWORD
                          specify Client's password
  --with-sd-password=PASSWORD
                          specify Storage daemon's password
  --with-mon-dir-password=PASSWORD
                          specify Director's password used by the monitor
  --with-mon-fd-password=PASSWORD
                          specify Client's password used by the monitor
  --with-mon-sd-password=PASSWORD
                          specify Storage daemon's password used by the
                          monitor
  --with-db-name=DBNAME   specify database name [default=bacula]
  --with-db-user=UNAME    specify database user [default=bacula]
  --with-db-password=PWD  specify database password [default=*none*]
  --with-db-port=DBPORT   specify a database port [default=null]
  --with-dir-user=USER    specify user for Director daemon
  --with-dir-group=GROUP  specify group for Director daemon
  --with-sd-user=USER     specify user for Storage daemon
  --with-sd-group=GROUP   specify group for Storage daemon
  --with-fd-user=USER     specify user for File daemon
  --with-fd-group=GROUP   specify group for File daemon
  --with-sbin-perm=MODE   specify permissions for sbin binaries [default=0750]
  --with-postgresql=DIR] Include PostgreSQL support. DIR is the PostgreSQL
                          base install directory, [default=/usr/local/pgsql]
  --with-mysql=DIR]      Include MySQL support. DIR is the MySQL base install
                          directory, default is to search through a number of
                          common places for the MySQL files.
  --with-embedded-mysql=DIR]
                          Include MySQL support. DIR is the MySQL base install
                          directory, default is to search through a number of
                          common places for the MySQL files.
  --with-sqlite3=DIR]    Include SQLite3 support. DIR is the SQLite3 base
                          install directory, default is to search through a
                          number of common places for the SQLite3 files.
  --with-x                use the X Window System
  --with-afsdir=DIR]     Directory holding AFS includes/libs
  --with-lzo=DIR]        specify lzo library directory
  --with-systemd=UNITDIR]
                          Include systemd support. UNITDIR is where systemd
                          system .service files are located, default is to ask
                          systemctl.

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CPP         C preprocessor
  CXXCPP      C++ preprocessor
  XMKMF       Path to xmkmf, Makefile generator for X Window System

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to the package provider.

These are the options that the OBS uses;



  532s]  $ ./configure  '--host=x86_64-suse-linux-gnu' '--build=x86_64-suse-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/lib' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--sysconfdir=/etc/bacula' '--disable-static' '--enable-readline' '--disable-conio' '--with-working-dir=/var/spool/bacula' '--with-archivedir=/var/spool/bacula' '--with-scriptdir=/usr/lib/bacula' '--with-bsrdir=/etc/bacula/bsr' '--with-logdir=/var/log/bacula' '--with-plugindir=/usr/lib64/bacula' '--with-postgresql' '--with-mysql' '--with-sqlite3' '--with-dir-user=bacula' '--with-dir-group=bacula' '--with-sd-user=bacula' '--with-sd-group=bacula' '--with-systemd=/usr/lib/systemd/system' '--enable-bat' 'CFLAGS=-pipe -O2 -march=core2 -mmmx -mssse3 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -flto' 'CXXFLAGS=-pipe -O2 -march=core2 -mmmx -mssse3 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -flto' 'build_alias=x86_64-suse-linux-gnu' 'host_alias=x86_64-suse-linux-gnu'

I would use the above and tweak/add as required.

Thank you for explaining guys.

Just a few questions before I run the ./configure:

  1. I read about the dependency packages:
  • mtx
  • I already have this one installed - sqlite3
  • surely I can install it through YaST but do I really have to considering I am using a mysql DB for bacula? I notice that in the options you show there is ‘–with-postgresql’ and ‘–with-sqlite3’. Should I remove them? - qt4
  • searching in YaST I don’t find a package named qt4 but there is libqt4 installed. Is that enough or is there anything else I need?
  1. The section Auto Starting the Daemons

Do I have to use what they suggest considering that normally in openSUSE we configure the autostarting of services in YaST > Service Manager?

  1. Regarding system requirements:

I see I have gcc installed. Should I simply install gcc-c++ and that’s it?

  1. How can I create RPM packages similar to those we see on other repos, so that I don’t need to recompile on another openSUSE Leap computer? Is that what OBS does? How can I use it?

IMO

  1. Stay with your mysql if that’s already installed. It may be overkill, for a small number of backups but that’s OK. Or, switch to sqlite3 if you wish.

As for qt4, in general when you’re compiling you may be required to also install the development headers. Look for something like “qt4-devel”

  1. There are many ways to configure auto-starting daemons. Whatever works. On openSUSE we generally use either YAST as you describe or configure “systemctl enable servicename

  2. That may be all that’s required as far as compilers go. If your compile fails, it’ll display an exact error which can be fixed before running again. A failed compile is typically “no harm, no foul.” Fix the problem and try again without penalty.

  3. When you build from source, just note the target install location. If you want to update in the future, just delete the target location, upgrade your source (if using git, you only need to execute “git pull”) and re-run your compile steps.

TSU

Ok. I removed the postgre and sqlite options from the configure line and added --enable-tray-monitor. Also installed libqt4-devel.

I am getting errors: http://paste.opensuse.org/f25a4d9d

It seems it is looking for trunk/depkgs and it is not available although I followed the instructions to make a git clone.

What should I do?

Hi
You need mysql-devel package for the missing header. Also readline-devel…

Just before getting your reply I found and downloaded the depkgs and depkgs-qt in Bacula - Browse Files at SourceForge.net and ran the make commands as shown here. Did I do wrong? Should I fix something before proceeding?

I am doing everything as normal user (not root) for the moment. Am I supposed to become root only when running ‘make install’?

BTW I can’t find package mysql-dev in YaST. Might that be because I am using MariaDB?

Hi
In openSUSE we always use <somefile>-devel so if you come across <somefile>-dev substitute :wink: Ahhh ok, so you need libmysqlclient-devel.

Yes, run the configure and make as your user for the moment…

Thanks. I found that while waiting for you. Now ./configure completed without problems. There was only 1 warning that --disable-dependency-tracking and --enable-tray-monitor were unrecognized options.

Yes, run the configure and make as your user for the moment…

Argh… I ran them both as root. Did I break something?

Actually now Bacula works! 2 strange things though:

  1. It says it is version 7.0.6 (from Nov.2014) - why is that? I got it using git clone Bacula Community Edition / Bacula Community · GitLab trunk

  2. Just as 5.2.13 it doesn’t respect the conf option Exclude Dir Containing :frowning: I was hoping that in a newer version it would be fixed. This more or less makes all efforts somewhat useless (apart from the learning).

Does all that mean that the git clone doesn’t provide the latest version? Maybe it works just because it is 7.0.6 and not 7.2.0 (where something might be broken)? Or is the reported version wrong? Should I rather downgrade to the RPM’ed 5.2.13? I am getting quite confused.

Correction: I ran only make and make install as root.

Update:

I downloaded the source files from sourceforge.net and repeated the same procudure.

Result: Now Bacula is 7.2.0 … with all the issues or Director not working which makes it unusable just as like installing it from RPM before. I guess this confirms my speculation that 7.0.6 simply doesn’t have the issue which 7.2.0 does.

As for the Exclude Dir Containing option not working I found in the ChangeLog that it has been fixed in 09Sep09, i.e. more than 3 years before 7.0.6 was released. Unfortunately the ChangeLog doesn’t say in which later version the bug has re-appeared.

I am starting to feel quite helpless with all that.

Hi
You didn’t switch to the 7.2 branch…


 git describe --tags
Release-7.0.5-115-g682a75f

git status
On branch Branch-7.0
Your branch is up-to-date with 'origin/Branch-7.0'.

nothing to commit, working directory clean

git checkout Branch-7.2
Branch Branch-7.2 set up to track remote branch Branch-7.2 from origin.
Switched to a new branch 'Branch-7.2'

git branch
  Branch-7.0
* Branch-7.2

git status
On branch Branch-7.2
Your branch is up-to-date with 'origin/Branch-7.2'.

nothing to commit, working directory clean

Ah… thanks. I didn’t know I had to do that. The documentation doesn’t say anything about “checkout branch”.

I will recompile one more time then.

All right :slight_smile: Now 7.2.0 director works however there are new issues:

  1. systemd services are not created by the installer.

# systemctl status bacula-*
bacula-dir.conf.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)




bacula-fd.conf.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)




bacula-sd.conf.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

I tried to run make install-autostart as the docs suggest but that didn’t help. The output of the command is: http://paste.opensuse.org/435ec119
Any idea how to create the services properly? Is that normally a manual process or should the installer take care of it?

  1. The bug of Exclude Dir Containing not working is still here. I have filed a bug report about that.

Hi
You didn’t tell it where…


From spec file
make install-autostart DESTDIR=%{buildroot} DISTNAME=systemd

Your build
make install-autostart DESTDIR=/usr/lib/systemd/system DISTNAME=systemd

Hm. Where did you find this? I don’t see it in the installation doc.

It is giving me an error too. Could you please have a look:

http://paste.opensuse.org/07c34ff8

Hi
OK, use;


make install-autostart DISTNAME=systemd

Errors again:

http://paste.opensuse.org/4039ac40

Hi
OK, so it’s installed, just not working;

Can you SUSE Paste the contents of the service file /usr/lib/systemd/system/bacula-sd.service and /etc/bacula/bacula-sd.conf.

Here is the paste:

http://paste.opensuse.org/905cbb54

BTW after reboot I am also getting this in journal:


Jan 09 10:51:34 i7 systemd[2556]: Failed at step EXEC spawning /usr/sbin/bacula-sd: Permission denied
Jan 09 10:51:34 i7 systemd[1]: Failed to start Bacula Storage Daemon service.

also 2 of the services have started automatically:


# bacula status
bacula-sd is stopped
bacula-fd (pid 2576) is running...
bacula-dir (pid 2951) is running...

which is strange because there is no service file for bacula-dir:

# l /usr/lib/systemd/system/bacula-*
-rw-r--r-- 1 root root 825 Jan  9 02:33 /usr/lib/systemd/system/bacula-fd.service
-rw-r--r-- 1 root root 841 Jan  9 02:33 /usr/lib/systemd/system/bacula-sd.service

However I notice there are links in /etc/init.rd:

# l /etc/init.d/rc5.d/*bacula*
lrwxrwxrwx 1 root root 13 Jan  9 00:09 /etc/init.d/rc5.d/K50bacula-dir -> ../bacula-dir*
lrwxrwxrwx 1 root root 12 Jan  9 00:09 /etc/init.d/rc5.d/K50bacula-fd -> ../bacula-fd*
lrwxrwxrwx 1 root root 12 Jan  9 00:09 /etc/init.d/rc5.d/K50bacula-sd -> ../bacula-sd*
lrwxrwxrwx 1 root root 13 Jan  9 00:09 /etc/init.d/rc5.d/S50bacula-dir -> ../bacula-dir*
lrwxrwxrwx 1 root root 12 Jan  9 00:09 /etc/init.d/rc5.d/S50bacula-fd -> ../bacula-fd*
lrwxrwxrwx 1 root root 12 Jan  9 00:09 /etc/init.d/rc5.d/S50bacula-sd -> ../bacula-sd*

I have no idea why there are duplicate links and if it is appropriate to have them both as *.service files and in init.rd. How should I fix this?

Also right at this time attempting to run bacula-sd start as root does nothing. No message in journal or in bacula.log and the service doesn’t start. Why is this happening after the reboot?

It also seems the two running processes are running as user root and I checked the file permissions for the executable files:


# ps -U root -u root u | grep bacula
root      2576  0.0  0.0  41420  4472 ?        Ssl  10:51   0:00 /usr/sbin/bacula-fd -c /etc/bacula/bacula-fd.conf
root      2951  0.0  0.0  59868  7056 ?        Ssl  10:51   0:00 /usr/sbin/bacula-dir -c /etc/bacula/bacula-dir.conf
# l /usr/sbin/bacula*
-rwxr-x--- 1 root root   2329 Jan  9 00:01 /usr/sbin/bacula*
-rwxr-x--- 1 root root 646888 Jan  9 00:01 /usr/sbin/bacula-dir*
-rwxr-x--- 1 root root 263952 Jan  9 00:01 /usr/sbin/bacula-fd*
-rwxr-x--- 1 root root 459704 Jan  9 00:01 /usr/sbin/bacula-sd*

I remember when I was using Bareos that /usr/sbin/bareos-* had 755 and bareos-dir service was configured with User=root and there was no problem with permissions or service starting.

I tried manually to restart the 3 services and this time there was no error and all 3 started without problem (all commands executed as root):


# bacula stop
Stopping the Bacula File daemon
Stopping the Bacula Storage daemon
Stopping the Bacula Director daemon
# bacula start
Starting the Bacula Storage daemon
Starting the Bacula File daemon
Starting the Bacula Director daemon
# bacula status
bacula-sd (pid 4673) is running...
bacula-fd (pid 4680) is running...
bacula-dir (pid 4690) is running...

but now FD and DIR are running as user bacula and SD is running as root:

# ps -U root -u root u | grep bacula
root      4680  0.0  0.0  41420  4580 ?        Ssl  11:22   0:00 /usr/sbin/bacula-fd -v -c /etc/bacula/bacula-fd.conf
# ps -U bacula -u bacula u | grep bacula
bacula    4673  0.0  0.0 113644  4680 ?        Ssl  11:22   0:00 /usr/sbin/bacula-sd -u bacula -g bacula -v -c /etc/bacula/bacula-sd.conf
bacula    4690  0.0  0.0  60572  7184 ?        Ssl  11:22   0:00 /usr/sbin/bacula-dir -u bacula -g bacula -v -c /etc/bacula/bacula-dir.conf

I wonder what the actual problem is.

Another permission thing:

Last night (before the reboot) I ran a backup job successfully. However at the end of it, when the script emailing the bootstrap file runs, I am getting permission error in bacula’s log. I ran ls to check permissions but it seems bacula has them all.

Also bacula seems unable to send notification emails to root@localhost. I have no idea how to correct this.

I wonder: Can all these problems be fixed with a ./configure or make option? Or are any other steps necessary after compiling from source?