Skip to content

Commit

Permalink
added storage device example configuration files
Browse files Browse the repository at this point in the history
added configuration files for the Storage Daemon backends tape and fifo.
Also setting file permissions properly.

Signed-off-by: Marco van Wieringen <marco.van.wieringen@bareos.com>
  • Loading branch information
joergsteffens authored and Marco van Wieringen committed Sep 17, 2014
1 parent 77ffcf3 commit d5588ed
Show file tree
Hide file tree
Showing 11 changed files with 189 additions and 20 deletions.
6 changes: 3 additions & 3 deletions autoconf/configure.in
Expand Up @@ -4207,12 +4207,12 @@ AC_SUBST(BUILD_SD_BACKENDS)

dnl install storage backend config files

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

Expand Down
1 change: 1 addition & 0 deletions debian/bareos-storage-fifo.install.in
@@ -1 +1,2 @@
/etc/bareos/bareos-sd.d/device-fifo.conf
@backenddir@/libbareossd-fifo*.so
45 changes: 45 additions & 0 deletions debian/bareos-storage-fifo.postinst
@@ -0,0 +1,45 @@
#!/bin/sh
# postinst script for bareos
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

daemon_user=bareos
daemon_group=bareos

permissions()
{
chown root:${daemon_group} /etc/bareos/bareos-sd.d/device-fifo.conf
}

case "$1" in
configure)
permissions
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
1 change: 1 addition & 0 deletions debian/bareos-storage-tape.install.in
@@ -1,4 +1,5 @@
/etc/bareos/mtx-changer.conf
/etc/bareos/bareos-sd.d/device-tape-with-autoloader.conf
@backenddir@/libbareossd-gentape*.so
@backenddir@/libbareossd-tape*.so
@plugindir@/scsitapealert-sd.so
Expand Down
45 changes: 45 additions & 0 deletions debian/bareos-storage-tape.postinst
@@ -0,0 +1,45 @@
#!/bin/sh
# postinst script for bareos
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

daemon_user=bareos
daemon_group=bareos

permissions()
{
chown root:${daemon_group} /etc/bareos/bareos-sd.d/device-tape-with-autoloader.conf
}

case "$1" in
configure)
permissions
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
14 changes: 8 additions & 6 deletions platforms/packaging/bareos.spec
Expand Up @@ -800,20 +800,22 @@ echo "This is a meta package to install a full bareos system" > %{buildroot}%{_d
%config(noreplace) %{_sysconfdir}/bareos/mtx-changer.conf
%{_mandir}/man8/btape.8.gz
%{_sbindir}/btape
%attr(0640, %{storage_daemon_user}, %{daemon_group}) %config(noreplace) %{_sysconfdir}/bareos/bareos-sd.d/device-tape-with-autoloader.conf
%{plugin_dir}/scsitapealert-sd.so

%files storage-fifo
%defattr(-, root, root)
%{backend_dir}/libbareossd-fifo*.so
%attr(0640, %{storage_daemon_user}, %{daemon_group}) %config(noreplace) %{_sysconfdir}/bareos/bareos-sd.d/device-fifo.conf

%if 0%{?glusterfs}
%files storage-glusterfs
%defattr(-, root, root)
%{backend_dir}/libbareossd-gfapi*.so
%{_sysconfdir}/bareos/bareos-sd.d/device-gluster.conf
%attr(0640, %{storage_daemon_user}, %{daemon_group}) %config(noreplace) %{_sysconfdir}/bareos/bareos-sd.d/device-gluster.conf
%endif

%files storage-fifo
%defattr(-, root, root)
%{backend_dir}/libbareossd-fifo*.so

%endif # client_only
%endif # not client_only

%files filedaemon
# fd package (bareos-fd, plugins)
Expand Down
10 changes: 5 additions & 5 deletions src/defaultconfigs/bareos-sd.d/device-ceph-rados.conf
Expand Up @@ -14,12 +14,12 @@

Device {
Name = RadosStorage
Archive Device = /etc/ceph/ceph.conf:hostname
Device Type = rados
Media Type = RadosFile
Archive Device = /etc/ceph/ceph.conf:hostname
LabelMedia = yes
Label Media = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Automatic Mount = yes
Removable Media = no
Always Open = no
}
26 changes: 26 additions & 0 deletions src/defaultconfigs/bareos-sd.d/device-fifo.conf
@@ -0,0 +1,26 @@
#
# example of a Storage daemon dummy device to test the backup.
# This example is write-only, so obviously, there is no way to restore data.
# In other cases, Fifo backends are often combined this by RunBeforeJobs,
# to start a corresponding reader/writer program.
#

#
# Preparations:
#
# include this configuration file in bareos-sd.conf by
# @/etc/bareos/bareos-sd.d/device-fifo.conf
#

Device {
Name = NULL
Archive Device = /dev/null
Device Type = fifo
Media Type = null
Label Media = yes
Random Access = no
Automatic Mount = no
Removable Media = no
Always Open = no
MaximumOpenWait = 60
}
10 changes: 5 additions & 5 deletions src/defaultconfigs/bareos-sd.d/device-gluster.conf
Expand Up @@ -7,12 +7,12 @@

Device {
Name = GlusterStorage
Archive Device = gluster://server.example.com/volumename/bareos
Device Type = gfapi
Media Type = GlusterFile
Archive Device = gluster://server.example.com/volumename/bareos
LabelMedia = yes
Label Media = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Automatic Mount = yes
Removable Media = no
Always Open = no
}
49 changes: 49 additions & 0 deletions src/defaultconfigs/bareos-sd.d/device-tape-with-autoloader.conf
@@ -0,0 +1,49 @@
#
# Preparations:
#
# include this configuration file in bareos-sd.conf by
# @/etc/bareos/bareos-sd.d/device-tape-with-autoloader.conf
#

# on Linux use "lsscsi --generic"
# to get a list of your SCSI devices.
# However, normaly you should access your devices by-id
# (eg. /dev/tape/by-id/scsi-350011d00018a5f03-nst),
# because the short device names like /dev/nst1
# might change on reboot.

Device {

Name = "tapedrive-0"
DeviceType = tape

# default:0, only required if the autoloader have multiple drives.
DriveIndex = 0

# if only one drive is available, this is normally /dev/nst0.
# However, it is advised to access it via id (/dev/tape/by-id/...).
ArchiveDevice = /dev/nst0
#ArchiveDevice = /dev/tape/by-id/scsi-350011d00018a5f03-nst

# arbitrary string that descripes the the storage media.
# Bareos uses this to determine, which device can be handle what media.
MediaType = lto

AutoChanger = yes # default: no
AutomaticMount = yes # default: no
MaximumFileSize = 10GB # default: 1000000000 (1GB)
}



Autochanger {
Name = "autochanger-0"
# adapt this, to match your storage loader
Changer Device = /dev/tape/by-id/scsi-1TANDBERGStorageLoader_AA45JC001732

# an Autochanger can contain multiple drive devices
Device = tapedrive-0
#Device = tapedrive-1

Changer Command = "/usr/lib/bareos/scripts/mtx-changer %c %o %S %a %d"
}
2 changes: 1 addition & 1 deletion src/defaultconfigs/diskonly/bareos-sd.conf.in
Expand Up @@ -45,7 +45,7 @@ Device {
Media Type = File
Archive Device = @archivedir@
LabelMedia = yes; # lets Bareos label unlabeled media
Random Access = Yes;
Random Access = yes;
AutomaticMount = yes; # when device opened, read it
RemovableMedia = no;
AlwaysOpen = no;
Expand Down

0 comments on commit d5588ed

Please sign in to comment.