debian/0000775000000000000000000000000012255075424007176 5ustar debian/bacula-director-db.prerm.in0000664000000000000000000000072212224677133014277 0ustar #! /bin/sh set -e . /usr/share/debconf/confmodule db_version 2.0 THISDB=XX_DB_XX if [ -f /usr/share/dbconfig-common/dpkg/prerm.$THISDB ]; then . /usr/share/dbconfig-common/dpkg/prerm.$THISDB dbc_go bacula-director-$THISDB $@ fi if test "$1" = "remove" -o "$1" = "deconfigure"; then invoke-rc.d bacula-director stop || exit $?- fi # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0 debian/README.Debian0000664000000000000000000001410412224677133011240 0ustar Bacula, network-based backup, recovery & verification system http://www.bacula.org =============================================================================== The 'bacula-common' package provides some of the common infrastructure for Bacula. You can find Bacula READMEs and other documentation files there. DFSG-FREE PACKAGE ----------------- The SHA-1 implementation in upstream sources (src/lib/sha1.{h,c}) is directly taken from RFC 3174 "US Secure Hash Algorithm 1 (SHA1)". Given that the Debian considers RFCs non-free according to the Debian Free Software Guidelines 3 and 6, the offending files were removed from the upstream sources. Please note that thanks to a patch by Alexander Golovko there was no loss of functionality: luckily, the SHA-1 implementation provided by the OpenSSL library is compatible with the own in Bacula. The fact that Bacula is already linked with OpenSSL also means that nothing changed for the Debian package. Please see the following bug report for a complete explanation: BASIC INFORMATION ----------------- To use bacula you must install one of the flavors of director, depending on your preferred database, onto a server. You must also install bacula-sd on the machine where you will be storing your backed-up data. And you'll need bacula-fd on any machine that you want to back up. The installation will run the necessary daemons automatically, but to get any backups working you must customize the relevant configuration files in /etc/bacula as described in the bacula manual. Once you have edited the files you should issue an appropriate /etc/init.d/bacula-xx force-reload. NETWORK ENABLING ---------------- By default, Debian's Bacula packages install config files in which the servers listen only on localhost by default. If you want to be able to do backups over the network, you'll need to find the lines in bacula-dir.conf, bacula-sd.conf, and bacula-fd.conf that reference 127.0.0.1 and remove them. PACKAGES ======== The virtual package 'bacula-director' is provided by - bacula-director-sqlite3 - bacula-director-mysql - bacula-director-pgsql These binaries have been compiled against the database indicated in the package's name. CONSOLE ======= The package bacula-console provides the administration console for Bacula, so that users can contact the director. The BAT graphical admin console is contained in the bacula-console-qt package. There are no wrappers for bacula-console-qt since it will likely be run from the corresponding launchers with appropriate '-c /etc/bacula/.conf' arguments. The convenient '.menu' files are provided, too. USERS & SECURITY ================ Make sure you customize the passwords in the files in /etc/bacula. The installation will create a bacula user on the system, and the daemons and RunBefore/RunAfter jobs will run as that user. However, the file daemon run as root, as will your ClientRunBefore/After jobs. File daemon can use linux capabilities(7) for drop root privileges, but it require root privileges for correctly restore original files permissions. For run file daemon without root privileges you can add ARGS="-k -u " into /etc/default/bacula-fd. This is linux specific feature. Installation of a director will ask you for a database user to use. You can run Bacula consoles as any user, but the user you use will need to be able to read the console config files. These files are, by default, under /etc/bacula. You'll need to specify the config file with -c for any of the consoles. PERFORMANCE NOTES ================= This was announced on Bacula's website with the release of Bacula 5.0.1: Some of you have encountered performance problems with your database (mainly with MySQL) with Bacula version 5.0.0. This is mainly because we've changed the SQL query used for restore, accurate jobs and base jobs. We have extensively tested this change, and though it should be a little bit slower than the previous versions, on a well configured database it should run extremely well. We strongly recommend to avoid the temptation to add new indexes. In general, these will cause very significant performance problems in other areas. A better approch is to carefully check that all your MySQL memory configuation parameters are are suitable for the size of your installation. If you backup millions of files, you need to adapt the database memory configuration parameters concerning sorting, joining and global memory. By default, sort and join parameters are very small (sometimes 8Kb), and having sufficient memory specified by those parameters is extremely important to run fast. If adjusting your MySQL memory configuration values does not solve your problem, you can also consider switching to PostgreSQL, which performs much better with Bacula on big installations (many millions of files per Job). However for large installations, you will also need to adjust the default PostgreSQL memory configuration parameters. from http://www.bacula.org/en/?page=news POSTGRESQL NOTES ================ The PostgreSQL Bacula packages are designed to work with PostgreSQL 8.4. If you are using an older version, you may need to edit some scripts in /etc/bacula/scripts so that it uses the correct version of the PostgreSQL binaries. As it is possible to have multiple PostgreSQL versions on a single Debian system, we cannot handle this in a completely automated way. UPGRADES ======== Debian packages will, unless you have asked them not to, attempt to automatically upgrade your catalog during a major Bacula upgrade. However, please be sure to examine /usr/share/doc/bacula-common/ReleaseNotes for potential changes in the configuration files. CATALOG BACKUPS =============== Please see the comments in the bacula-dir.conf file regarding the make_catalog_backup script for information on tailoring it for your own particular environment. FURTHER READING =============== See the Bacula documentation on the upstream author's website, http://www.bacula.org. -- John Goerzen based on a file by Jose Luis Tallon -- Luca Capello , Fri, 18 May 2012 19:08:00 +0200 debian/bacula-common.examples0000664000000000000000000000001312224677133013446 0ustar examples/* debian/bacula-fd.dirs0000664000000000000000000000005512224677133011700 0ustar var/lib/bacula etc/bacula etc/bacula/scripts debian/source/0000775000000000000000000000000012224677136010502 5ustar debian/source/format0000664000000000000000000000001412224677133011705 0ustar 3.0 (quilt) debian/bacula-sd.postinst0000664000000000000000000000351012224677133012636 0ustar #!/bin/sh # postinst script for bacula-sd # set -e . /usr/share/debconf/confmodule db_version 2.0 # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # # quoting from the policy: # Any necessary prompting should almost always be confined to the # post-installation script, and should be protected with a conditional # so that unnecessary prompting doesn't happen if a package's # installation fails and the `postinst' is called with `abort-upgrade', # `abort-remove' or `abort-deconfigure'. SRCDIR="/usr/share/bacula-common/defconfig" DSTDIR="/etc/bacula" CONFIG="bacula-sd.conf" . /usr/share/bacula-common/common-functions.dpkg readOrCreatePasswords setup_etc_default bacula-sd $@ case "$1" in configure) if [ ! -f $DSTDIR/$CONFIG ]; then TARGET=$DSTDIR/$CONFIG else TARGET=$DSTDIR/$CONFIG.dist fi sed -e s~@debian_hostname@~`hostname`~ \ -e s~XXX_SDPASSWORD_XXX~$SDPASSWD~ \ -e s~XXX_MONSDPASSWORD_XXX~$SDMPASSWD~ < $SRCDIR/$CONFIG > $TARGET # Harden permissions, so that passwords can not be looked at chown bacula:bacula $TARGET chmod 640 $TARGET ;; 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 debian/bacula-common.install0000664000000000000000000000136312224677133013307 0ustar etc/bacula/scripts/btraceback.gdb usr/lib/bacula/libbaccfg*.so usr/lib/bacula/libbacfind*.so usr/lib/bacula/libbac.so usr/lib/bacula/libbac-*.so usr/lib/bacula/libbacpy*.so usr/sbin/btraceback usr/lib/bacula usr/sbin/bsmtp debian/additions/common-functions.init usr/share/bacula-common debian/additions/common-functions.dpkg usr/share/bacula-common etc/bacula/tray-monitor.conf usr/share/bacula-common/defconfig etc/bacula/bat.conf usr/share/bacula-common/defconfig etc/bacula/bconsole.conf usr/share/bacula-common/defconfig etc/bacula/bacula-sd.conf usr/share/bacula-common/defconfig etc/bacula/bacula-fd.conf usr/share/bacula-common/defconfig etc/bacula/bacula-dir.conf usr/share/bacula-common/defconfig platforms/systemd/bacula.conf etc/tmpfiles.d debian/bacula-director-db.config.in0000664000000000000000000000101012224677133014406 0ustar #!/bin/sh set -e . /usr/share/debconf/confmodule db_version 2.0 THISDB=XX_DB_XX case "$THISDB" in mysql) dbc_first_version=1.38.9-3 dbc_dbuser=bacula dbc_dbname=bacula ;; pgsql) dbc_first_version=1.38.9-2 dbc_dbuser=bacula dbc_dbname=bacula ;; sqlite3) dbc_first_version=3.0.3-3 dbc_dbname=bacula.db dbc_basepath=/var/lib/bacula ;; esac if [ -f /usr/share/dbconfig-common/dpkg/config.$THISDB ]; then . /usr/share/dbconfig-common/dpkg/config.$THISDB dbc_go bacula-director-$THISDB $@ fi debian/additions/0000775000000000000000000000000012224677136011160 5ustar debian/additions/postinst-common0000775000000000000000000000114012224677133014250 0ustar #!/bin/sh DEFCONFIGDIR="/usr/share/bacula-common/defconfig" DSTDIR="/etc/bacula" CONFIG="bacula-dir.conf" TMPCONFIG=$DSTDIR/$CONFIG.dpkg-tmp if [ -f $TMPCONFIG ]; then SOURCE=$TMPCONFIG else SOURCE=$DEFCONFIGDIR/$CONFIG fi if [ ! -f $DSTDIR/$CONFIG ]; then TARGET=$DSTDIR/$CONFIG else TARGET=$DSTDIR/$CONFIG.dist fi # Final config fix sed -e "s/@debian_hostname@/`hostname`/" < $SOURCE > $TARGET # get rid of now unnecessary file rm -f $TMPCONFIG # Harden permissions, so that passwords can not be looked at # Fixed by Philipp M Hahn chown root:bacula $TARGET chmod 640 $TARGET exit 0 debian/additions/pgsql/0000775000000000000000000000000012224677136012306 5ustar debian/additions/pgsql/make_catalog_backup_awk0000775000000000000000000000305512224677133017032 0ustar #!/usr/bin/gawk -f # extract.awk script expects Catalog definition in a form of: # Catalog { # Name = NameOfCatalog # dbname = ""; DB Address = ""; user = ""; password = ""; DB Socket = ""; DB Port = "" # } # BEGIN { RS= "}" ; FS="[;\n]+"} function trim(v) { ## Remove leading and trailing spaces sub(/^ */,"",v) sub(/ *$/,"",v) return v } $0 ~ /Catalog[[:space:]]*{/ { for ( i = 1; i <= NF ; i++) { split($i,a,"=") if (a[1] ~ /dbname/) dbname = trim(gensub("\"","","g",a[2])) # remove " char if (a[1] ~ /user/) user = trim(gensub("\"","","g",a[2])) if (a[1] ~ /Name/) catname = trim(gensub("\"","","g",a[2])) if (a[1] ~ /password/) password = trim(gensub("\"","","g",a[2])) if (a[1] ~ /DB Address/) dbaddress = trim(gensub("\"","","g",a[2])) if (a[1] ~ /DB Socket/) dbsocket = trim(gensub("\"","","g",a[2])) if (a[1] ~ /DB Port/) dbport = trim(gensub("\"","","g",a[2])) } if (catname == cat1 || catname == cat2 || catname == cat3 || catname == cat4) { if (dbaddress == "") #Not optional in the case of MySQL dbaddress = "localhost" system("rm -rf /var/lib/bacula/pg_service.conf") system("touch /var/lib/bacula/pg_service.conf") system("chmod 600 /var/lib/bacula/pg_service.conf") printf "[bacula]\n dbname=%s\n user=%s\n password=%s\n",dbname,user,password >> "/var/lib/bacula/pg_service.conf" if (dbport != "") printf " port=%s\n",dbport >> "/var/lib/bacula/pg_service.conf" system("HOME=/var/lib/bacula PGSERVICE=bacula PGSYSCONFDIR=/var/lib/bacula pg_dump > /var/lib/bacula/bacula.sql") } } debian/additions/pgsql/database/0000775000000000000000000000000012224677136014052 5ustar debian/additions/pgsql/database/pgsql0000664000000000000000000000007112224677133015116 0ustar ALTER DATABASE _DBC_DBNAME_ SET datestyle TO 'ISO, YMD'; debian/additions/sqlite3/0000775000000000000000000000000012224677136012544 5ustar debian/additions/sqlite3/make_catalog_backup_awk0000775000000000000000000000017512224677133017270 0ustar #!/usr/bin/gawk -f BEGIN {system("echo '.dump' | /usr/bin/sqlite3 /var/lib/bacula/bacula.db > /var/lib/bacula/bacula.sql")} debian/additions/sqlite3/delete_catalog_backup.md5sum0000664000000000000000000000006412224677133020156 0ustar 4046822bde52b5b6926d33b20b7e7b07 5.2.6+dfsg-[2345] debian/additions/mysql/0000775000000000000000000000000012224677136012325 5ustar debian/additions/mysql/make_catalog_backup_awk0000775000000000000000000000315612224677133017053 0ustar #!/usr/bin/gawk -f # extract.awk script expects Catalog definition in a form of: # Catalog { # Name = NameOfCatalog # dbname = ""; DB Address = ""; user = ""; password = ""; DB Socket = ""; DB Port = "" # } # BEGIN { RS= "}" ; FS="[;\n]+"} function trim(v) { ## Remove leading and trailing spaces sub(/^ */,"",v) sub(/ *$/,"",v) return v } $0 ~ /Catalog[[:space:]]*{/ { for ( i = 1; i <= NF ; i++) { split($i,a,"=") if (a[1] ~ /dbname/) dbname = trim(gensub("\"","","g",a[2])) # remove " char if (a[1] ~ /user/) user = trim(gensub("\"","","g",a[2])) if (a[1] ~ /Name/) catname = trim(gensub("\"","","g",a[2])) if (a[1] ~ /password/) password = trim(gensub("\"","","g",a[2])) if (a[1] ~ /DB Address/) dbaddress = trim(gensub("\"","","g",a[2])) if (a[1] ~ /DB Socket/) dbsocket = trim(gensub("\"","","g",a[2])) if (a[1] ~ /DB Port/) dbport = trim(gensub("\"","","g",a[2])) } if (catname == cat1 || catname == cat2 || catname == cat3 || catname == cat4) { if (dbaddress == "") #Not optional in the case of MySQL dbaddress = "localhost" system("rm -rf /var/lib/bacula/.my.cnf") system("touch /var/lib/bacula/.my.cnf") system("chmod 600 /var/lib/bacula/.my.cnf") printf "[client]\n host=%s\n user=%s\n password=%s\n",dbaddress,user,password >> "/var/lib/bacula/.my.cnf" if (dbport != "") printf " port=%s\n",dbport >> "/var/lib/bacula/.my.cnf" if (dbsocket != "") printf " socket=%s\n",dbsocket >> "/var/lib/bacula/.my.cnf" system(sprintf ("HOME=/var/lib/bacula mysqldump %s > /var/lib/bacula/bacula.sql",dbname)) } } debian/additions/common-functions.init0000664000000000000000000000027412224677133015343 0ustar # # Common functions, used from init scripts # create_var_run_dir() { if [ ! -d /var/run/bacula/ ]; then mkdir -p -m 0755 /var/run/bacula/ chown bacula:daemon /var/run/bacula/ fi } debian/additions/common-functions.dpkg0000664000000000000000000002407412224677133015331 0ustar # # Common functions, used from dpkg scripts # genRandomPassword() { cat /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c33 } readOrCreatePasswords() { BACULAPWFILE=/etc/bacula/common_default_passwords if [ -f $BACULAPWFILE ]; then . $BACULAPWFILE fi if [ -z "$DIRPASSWD" -o -z "$DIRMPASSWD" -o -z "$SDPASSWD" -o \ -z "$SDMPASSWD" -o -z "$FDPASSWD" -o -z "$FDMPASSWD" ] ; then # Create the passwords. DIRPASSWD=`genRandomPassword` DIRMPASSWD=`genRandomPassword` SDPASSWD=`genRandomPassword` SDMPASSWD=`genRandomPassword` FDPASSWD=`genRandomPassword` FDMPASSWD=`genRandomPassword` # Save the passwords. echo "# " > $BACULAPWFILE chown root:root $BACULAPWFILE chmod 0600 $BACULAPWFILE cat >>$BACULAPWFILE < # # will replace all occurance of XXX_var_XXX to value of environment variable `var' # substitute() { local TEMPLATE DEST HOSTNAME SUBST_VARIABLES SEDCMD TEMPLATE="$1" DEST="$2" HOSTNAME="${HOSTNAME:-`hostname --fqdn 2>/dev/null || hostname`}" SUBST_VARIABLES="${SUBST_VARIABLES:-HOSTNAME DBNAME DBUSER DBPASS \ DIRPASSWD DIRMPASSWD SDPASSWD SDMPASSWD FDPASSWD FDMPASSWD}" SEDCMD="sed" for var in $SUBST_VARIABLES; do value=$(eval echo "\$$var" |sed -e 's/[\/&]/\\&/g') SEDCMD="$SEDCMD -e s/XXX_${var}_XXX/$value/g" done $SEDCMD "$TEMPLATE" >"$DEST" } # # Function for check if config already registered by the same package for # other database type. # Usage: config_from_other_dbtype # config_from_other_dbtype() { local PACKAGE CONFIG base_package_name regex PACKAGE="$1" CONFIG="$2" base_package_name=$(echo "$PACKAGE" |sed -Ee 's/-(mysql|pgsql|sqlite3)$//') regex="^$CONFIG:$base_package_name-(mysql|pgsql|sqlite3):" ucfq -w "$CONFIG" |egrep -q "$regex" } # # Function for install config file from template # Usage: install_config [