Skip to content

Commit

Permalink
add config include files for storage backends
Browse files Browse the repository at this point in the history
Different configuration backends require different configurations.
With this patch, backend specific include files can be installed
at /etc/bareos/bareos-sd.d/.
If they should be used, they have to be included in the main configuration file.
The configuration files bareos-sd.conf and bareos-dir.conf
have been twice in git. One version is replaced by a link.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
joergsteffens authored and Marco van Wieringen committed Feb 17, 2015
1 parent 99e0098 commit e985170
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 404 deletions.
15 changes: 15 additions & 0 deletions autoconf/configure.in
Expand Up @@ -4203,6 +4203,21 @@ fi

AC_SUBST(BUILD_SD_BACKENDS)



dnl install storage backend config files

INSTALL_SD_CONFS=""
if test X"$have_glusterfs" = "Xyes" ; then
INSTALL_SD_CONFS="${INSTALL_SD_BACKEND_CONFS} device-gluster.conf"
fi
if test X"$have_ceph_rados" = "Xyes" ; then
INSTALL_SD_CONFS="${INSTALL_SD_BACKEND_CONFS} device-ceph-rados.conf"
fi
AC_SUBST(INSTALL_SD_CONFS)



dnl Insanity check
if test "x${subsysdir}" = "x${sbindir}" ; then
echo " "
Expand Down
1 change: 1 addition & 0 deletions debian/bareos-common.dirs
@@ -1,2 +1,3 @@
/etc/bareos/bareos-dir.d
/var/lib/bareos
/var/log/bareos
1 change: 1 addition & 0 deletions debian/bareos-common.postinst
Expand Up @@ -22,6 +22,7 @@ daemon_group=bareos

permissions()
{
chown ${daemon_user}:${daemon_group} /etc/bareos/bareos-dir.d
chown ${daemon_user}:${daemon_group} /var/lib/bareos/
chown ${daemon_user}:${daemon_group} /var/log/bareos/
}
Expand Down
1 change: 1 addition & 0 deletions debian/bareos-storage.dirs
@@ -1 +1,2 @@
/etc/bareos/bareos-sd.d
/var/lib/bareos/storage
1 change: 1 addition & 0 deletions debian/bareos-storage.postinst
Expand Up @@ -29,6 +29,7 @@ storage_daemon_group=$daemon_group
permissions()
{
chown ${storage_daemon_user}:${daemon_group} /etc/bareos/bareos-sd.conf
chown ${storage_daemon_user}:${daemon_group} /etc/bareos/bareos-sd.d
chown ${storage_daemon_user}:${daemon_group} /var/lib/bareos/storage/
}

Expand Down
3 changes: 3 additions & 0 deletions platforms/packaging/bareos.spec
Expand Up @@ -764,6 +764,7 @@ echo "This is a meta package to install a full bareos system" > %{buildroot}%{_d
# sd package (bareos-sd, bls, btape, bcopy, bextract)
%defattr(-, root, root)
%attr(0640, %{storage_daemon_user}, %{daemon_group}) %config(noreplace) %{_sysconfdir}/bareos/bareos-sd.conf
%attr(-, %{storage_daemon_user}, %{daemon_group}) %dir %{_sysconfdir}/bareos/bareos-sd.d
%if 0%{?suse_version}
%{_sysconfdir}/init.d/bareos-sd
%{_sbindir}/rcbareos-sd
Expand Down Expand Up @@ -801,6 +802,7 @@ echo "This is a meta package to install a full bareos system" > %{buildroot}%{_d
%files storage-glusterfs
%defattr(-, root, root)
%{backend_dir}/libbareossd-gfapi*.so
%{_sysconfdir}/bareos/bareos-sd.d/device-gluster.conf
%endif

%files storage-fifo
Expand Down Expand Up @@ -835,6 +837,7 @@ echo "This is a meta package to install a full bareos system" > %{buildroot}%{_d
# common shared libraries (without db)
%defattr(-, root, root)
%attr(-, root, %{daemon_group}) %dir %{_sysconfdir}/bareos
%attr(-, %{daemon_user}, %{daemon_group}) %dir %{_sysconfdir}/bareos/bareos-dir.d
%dir %{backend_dir}
%{library_dir}/libbareos-%{_libversion}.so
%{library_dir}/libbareoscfg-%{_libversion}.so
Expand Down
25 changes: 25 additions & 0 deletions src/defaultconfigs/bareos-sd.d/device-ceph-rados.conf
@@ -0,0 +1,25 @@
#
# Preparations:
#
# Copy ceph.conf and ceph.keyring from server /etc/ceph to clients /etc/ceph.
#
# Create a rados volume on the server:
# /usr/bin/rados lspools
# /usr/bin/rados mkpool bareos
# /usr/bin/rados df
#
# include this configuration file in bareos-sd.conf by
# @/etc/bareos/bareos-sd.d/device-ceph-rados.conf
#

Device {
Name = RadosStorage
Device Type = rados
Media Type = RadosFile
Archive Device = /etc/ceph/ceph.conf:hostname
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
}
18 changes: 18 additions & 0 deletions src/defaultconfigs/bareos-sd.d/device-gluster.conf
@@ -0,0 +1,18 @@
#
# Preparations:
#
# include this configuration file in bareos-sd.conf by
# @/etc/bareos/bareos-sd.d/device-gluster.conf
#

Device {
Name = GlusterStorage
Device Type = gfapi
Media Type = GlusterFile
Archive Device = gluster://server.example.com/volumename/bareos
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
}
18 changes: 9 additions & 9 deletions src/defaultconfigs/diskonly/bareos-dir.conf.in
Expand Up @@ -182,7 +182,7 @@ FileSet {
Options {
Signature = MD5 # calculate md5 checksum per file
}
File = @sbindir@
File = "@sbindir@"
}
}

Expand Down Expand Up @@ -254,11 +254,11 @@ Messages {
Name = Standard
mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: %t %e of %c %l\" %r"
operatorcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos: Intervention needed for %j\" %r"
mail = @job_email@ = all, !skipped # (#02)
mail = @job_email@ = all, !skipped, !audit # (#02)
operator = @job_email@ = mount # (#03)
console = all, !skipped, !saved
append = "@logdir@/bareos.log" = all, !skipped
catalog = all
console = all, !skipped, !saved, !audit
append = "@logdir@/bareos.log" = all, !skipped, !audit
catalog = all, !audit
}

#
Expand All @@ -267,12 +267,12 @@ Messages {
Messages {
Name = Daemon
mailcommand = "@bindir@/bsmtp -h @smtp_host@ -f \"\(Bareos\) \<%r\>\" -s \"Bareos daemon message\" %r"
mail = @job_email@ = all, !skipped # (#02)
console = all, !skipped, !saved
append = "@logdir@/bareos.log" = all, !skipped
mail = @job_email@ = all, !skipped, !audit # (#02)
console = all, !skipped, !saved, !audit
append = "@logdir@/bareos.log" = all, !skipped, !audit
append = "@logdir@/bareos-audit.log" = audit
}


#
# Full Pool definition
#
Expand Down
8 changes: 8 additions & 0 deletions src/defaultconfigs/diskonly/bareos-sd.conf.in
Expand Up @@ -51,6 +51,14 @@ Device {
AlwaysOpen = no;
}

#
# include additional configuration files, if required
#

# eg.
#@/etc/bareos/bareos-sd.d/device-gluster.conf


#
# Send all messages to the Director,
# mount messages also are sent to the email address
Expand Down
1 change: 1 addition & 0 deletions src/dird/Makefile.in
Expand Up @@ -134,6 +134,7 @@ install: all
$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bareos-dir $(DESTDIR)$(sbindir)/bareos-dir
$(LIBTOOL_INSTALL) $(INSTALL_PROGRAM) bareos-dbcheck $(DESTDIR)$(sbindir)/bareos-dbcheck
@srcconf=bareos-dir.conf; \
$(MKDIR) ${DESTDIR}${sysconfdir}/bareos-dir.d/; \
if test -f ${DESTDIR}${sysconfdir}/$$srcconf; then \
destconf=$$srcconf.new; \
echo " ==> Found existing $$srcconf, installing new conf file as $$destconf"; \
Expand Down

0 comments on commit e985170

Please sign in to comment.