[pkg-bacula-commits] [SCM] Bacula, a network backup, recovery and verification program branch, master, updated. debian/5.0.3-1-109-ga0cfd0f
Alexander Golovko
alexandro at ankalagon.ru
Sun May 27 00:35:19 UTC 2012
The following commit has been merged in the master branch:
commit 085033851704fca24d9fcb159e7275032c8c9c1c
Merge: c1e43ff2714993b2dcfa6ed01aa5521983f1b0d8 a3ab56ab609039f6522e0514774f2be9a6bdc30c
Author: Alexander Golovko <alexandro at ankalagon.ru>
Date: Fri May 25 00:44:39 2012 +0400
Merge commit 'a3ab56a'
a3ab56a - applied
5c32749 - applied (no bashism in this scripts)
e7da5dc - applied
+ add description to patch
diff --combined debian/bacula-common.postinst
index 7f49059,edc0595..c245ede
--- a/debian/bacula-common.postinst
+++ b/debian/bacula-common.postinst
@@@ -1,27 -1,21 +1,27 @@@
--#! /bin/sh
++#!/bin/sh
+
set -e
. /usr/share/debconf/confmodule
db_version 2.0
+
case "$1" in
configure)
- mkdir -p /var/lib/bacula /var/log/bacula
chown bacula:bacula /var/lib/bacula
chmod 700 /var/lib/bacula
chown bacula:adm /var/log/bacula
chmod 750 /var/log/bacula
- . /usr/share/bacula-common/common-functions
+ . /usr/share/bacula-common/common-functions.dpkg
readOrCreatePasswords # create our common passwords if needed
;;
esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
#DEBHELPER#
+
+exit 0
diff --combined debian/bacula-common.preinst
index 62c6e32,f802996..f5c8fb7
--- a/debian/bacula-common.preinst
+++ b/debian/bacula-common.preinst
@@@ -1,35 -1,15 +1,35 @@@
- #! /bin/bash
-#! /bin/sh
++#!/bin/sh
+
set -e
+
case "$1" in
install)
if ! getent passwd bacula >/dev/null; then
echo -n "Adding user 'bacula'... "
- adduser --system --home=/var/lib/bacula --group bacula 2>&1 > /dev/null
- adduser bacula tape
+ adduser --system --no-create-home --group bacula 2>&1 > /dev/null
+ usermod -c "Bacula" bacula
+ usermod -G tape bacula
echo "Ok."
+ usermod -d /var/lib/bacula bacula
fi
;;
+
+ upgrade)
+ # Before 1.38.9-2, logs were in the wrong place. Fix.
+ if dpkg --compare-versions "$2" lt 1.38.9-2 &&
+ test -h /var/log/bacula/log &&
+ test -f /var/lib/bacula/log; then
+ rm /var/log/bacula/log
+ mv /var/lib/bacula/log /var/log/bacula/log
+ fi
+ ;;
esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
#DEBHELPER#
+
+exit 0
diff --combined debian/bacula-console-qt.postinst
index 2b99d97,0000000..fe2040c
mode 100644,000000..100644
--- a/debian/bacula-console-qt.postinst
+++ b/debian/bacula-console-qt.postinst
@@@ -1,61 -1,0 +1,61 @@@
- #! /bin/sh
++#!/bin/sh
+# postinst script for bacula
+#
+# 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>
+# * <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
+#
+# 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"
+CFGFILE="bat.conf"
+
+case "$1" in
+ configure)
+
+ if [ ! -f $DSTDIR/$CFGFILE ]; then
+ TARGET=$DSTDIR/$CFGFILE
+ else
+ TARGET=$DSTDIR/$CFGFILE.dist
+ fi
+
+ # bconsole & wx-console use the same config file ;)
+ sed -e "s~@debian_hostname@~localhost~" < $SRCDIR/$CFGFILE > $TARGET
+
+ chown root: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
diff --combined debian/bacula-console.postinst
index a457fcd,0000000..c3708ed
mode 100644,000000..100644
--- a/debian/bacula-console.postinst
+++ b/debian/bacula-console.postinst
@@@ -1,33 -1,0 +1,33 @@@
- #! /bin/sh
++#!/bin/sh
+
+set -e
+
+
+SRCDIR="/usr/share/bacula-common/defconfig"
+DSTDIR="/etc/bacula"
+CONFIG="bconsole.conf"
+CONSOLE=/usr/sbin/bacula-console
+
+
+case "$1" in
+ configure)
+ if [ ! -f $DSTDIR/$CONFIG ]; then
+ TARGET=$DSTDIR/$CONFIG
+ else
+ TARGET=$DSTDIR/$CONFIG.dist
+ fi
+
+ sed -e "s~@debian_hostname@~localhost~" < $SRCDIR/$CONFIG > $TARGET
+
+ chown root:bacula $TARGET
+ chmod 640 $TARGET
+ ;;
+esac
+
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --combined debian/bacula-director-db.bacula-director.init.in
index ca03266,777d1ef..8dcb96c
--- a/debian/bacula-director-db.bacula-director.init.in
+++ b/debian/bacula-director-db.bacula-director.init.in
@@@ -7,6 -7,7 +7,7 @@@
# Should-Stop: bacula-fd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
+ # Short-Description: Start Bacula Director at boot time
### END INIT INFO
# bacula-director SysV init script for Bacula-Director.
#
@@@ -32,12 -33,12 +33,12 @@@ f
PIDFILE=/var/run/bacula/$NAME.$PORT.pid
. /lib/lsb/init-functions
-. /usr/share/bacula-common/common-functions
-if [ -r /etc/default/bacula-dir ]; then
- . /etc/default/bacula-dir
+. /usr/share/bacula-common/common-functions.init
+if [ -r /etc/default/$NAME ]; then
+ . /etc/default/$NAME
fi
-CONFIG="${CONFIG:-/etc/bacula/bacula-fd.conf}"
+CONFIG="${CONFIG:-/etc/bacula/$NAME.conf}"
create_var_run_dir
@@@ -92,8 -93,13 +93,8 @@@ do_stop(
case "$1" in
start)
- if [ -f /etc/bacula/do_not_run ]; then
- log_failure_msg "Not starting $DESC: disabled via /etc/bacula/do_not_run"
- exit 0
- fi
-
if [ "$ENABLED" = "no" ]; then
- log_failure_msg "Not starting $DESC: disabled via /etc/default/bacula-dir"
+ log_failure_msg "Not starting $DESC: disabled via /etc/default/$NAME"
exit 0
fi
diff --combined debian/bacula-director-mysql.postinst
index a3b0a86,0000000..2710595
mode 100644,000000..100644
--- a/debian/bacula-director-mysql.postinst
+++ b/debian/bacula-director-mysql.postinst
@@@ -1,85 -1,0 +1,85 @@@
- #! /bin/bash
++#!/bin/sh
+# postinst script for bacula-director-mysql
+#
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+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>
+# * <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
+#
+# 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'.
+
+dbc_first_version=1.38.9-3
+# set in config, must not be set here: dbc_dbuser=bacula
+# set in config, must not be set here: dbc_dbname=bacula
+
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/config.mysql ]; then
+ . /usr/share/dbconfig-common/dpkg/postinst.mysql
+ dbc_go bacula-director-mysql $@
+fi
+
+LOGDIR="/var/log/bacula"
+POSTINST_COMMON="/usr/share/bacula-director/postinst-common"
+DEFCONFIG="/usr/share/bacula-common/defconfig"
+CFGFILE="/etc/bacula/bacula-dir.conf"
+
+
+. /usr/share/bacula-common/common-functions.dpkg
+readOrCreatePasswords
+setup_etc_default bacula-director-mysql $@
+
+case "$1" in
+configure)
+
+ echo -n "Processing configuration..."
+ . /etc/dbconfig-common/bacula-director-mysql.conf
+ TARGET=$CFGFILE.dpkg-tmp
+ # FIXME: should this tweak make_catalog_backup like bacula-director-pgsql.postinst does?
+ sed -e "s/dbname = \"XXX_DBNAME_XXX\";/dbname = \"$dbc_dbname\"; DB Address = \"$dbc_dbserver\";/" \
+ -e "s~/XXX_DBNAME_XXX~/$dbc_dbname~" \
+ -e "s/XXX_DBUSER_XXX/$dbc_dbuser/" -e "s/XXX_DBPASSWORD_XXX/$dbc_dbpass/" \
+ -e s~XXX_DIRPASSWORD_XXX~$DIRPASSWD~ \
+ -e s~XXX_MONDIRPASSWORD_XXX~$DIRMPASSWD~ \
+ -e s~XXX_SDPASSWORD_XXX~$SDPASSWD~ \
+ -e s~XXX_FDPASSWORD_XXX~$FDPASSWD~ \
+ $DEFCONFIG/bacula-dir.conf > $TARGET
+
+ /bin/bash $POSTINST_COMMON
+
+ echo "Ok."
+ ;;
+
+abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+*)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# Do start daemon
+db_stop
+
+
+#DEBHELPER#
+
+exit 0
diff --combined debian/bacula-director-pgsql.postinst
index 66acf85,0000000..9eb3c86
mode 100644,000000..100644
--- a/debian/bacula-director-pgsql.postinst
+++ b/debian/bacula-director-pgsql.postinst
@@@ -1,95 -1,0 +1,95 @@@
- #! /bin/bash
++#!/bin/sh
+# postinst script for bacula-director-pgsql
+#
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+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>
+# * <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
+#
+# 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'.
+
+dbc_first_version=1.38.9-2
+# set in config, must not be set here: dbc_dbuser=bacula
+# set in config, must not be set here: dbc_dbname=bacula
+
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/postinst.pgsql ]; then
+ . /usr/share/dbconfig-common/dpkg/postinst.pgsql
+ dbc_pgsql_createdb_encoding="SQL_ASCII"
+ dbc_sql_substitutions="1"
+ dbc_go bacula-director-pgsql $@
+fi
+
+LOGDIR="/var/log/bacula"
+POSTINST_COMMON="/usr/share/bacula-director/postinst-common"
+DEFCONFIG="/usr/share/bacula-common/defconfig"
+CFGFILE="/etc/bacula/bacula-dir.conf"
+CATALOG=bacula
+PGSQL=/usr/bin/psql
+GRANT_SQL_PRIVS="/usr/share/bacula-director/grant_pgsql_privileges"
+AUTHFILE=`getent passwd bacula | cut -d ':' -f 6`/.pgpass
+
+
+. /usr/share/bacula-common/common-functions.dpkg
+readOrCreatePasswords
+setup_etc_default bacula-director-pgsql $@
+
+case "$1" in
+configure)
+
+ echo -n "Processing configuration..."
+ . /etc/dbconfig-common/bacula-director-pgsql.conf
+ TARGET=$CFGFILE.dpkg-tmp
+
+ if [ "$dbc_install" = "true" ] ; then
+ sed -e "s/make_catalog_backup bacula bacula/make_catalog_backup -h '$dbc_dbserver' -U $dbc_dbuser/" \
+ -e "s/dbname = \"XXX_DBNAME_XXX\";/dbname = \"$dbc_dbname\"; DB Address = \"$dbc_dbserver\";/" \
+ -e "s~/XXX_DBNAME_XXX~/$dbc_dbname~" \
+ -e "s/XXX_DBUSER_XXX/$dbc_dbuser/" -e "s/XXX_DBPASSWORD_XXX/$dbc_dbpass/" \
+ -e s~XXX_DIRPASSWORD_XXX~$DIRPASSWD~ \
+ -e s~XXX_MONDIRPASSWORD_XXX~$DIRMPASSWD~ \
+ -e s~XXX_SDPASSWORD_XXX~$SDPASSWD~ \
+ -e s~XXX_FDPASSWORD_XXX~$FDPASSWD~ \
+ $DEFCONFIG/bacula-dir.conf > $TARGET
+ fi
+
+ /bin/sh $POSTINST_COMMON
+ echo "Ok."
+ ;;
+
+abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+*)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+
+
+# Do start daemon
+db_stop
+
+
+#DEBHELPER#
+
+exit 0
diff --combined debian/bacula-director-sqlite3.postinst
index 00520d1,0000000..c286381
mode 100644,000000..100644
--- a/debian/bacula-director-sqlite3.postinst
+++ b/debian/bacula-director-sqlite3.postinst
@@@ -1,90 -1,0 +1,90 @@@
- #! /bin/bash
++#!/bin/sh
+# postinst script for bacula-director-sqlite3
+#
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+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>
+# * <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
+#
+# 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'.
+
+dbc_first_version=3.0.3-3
+dbc_dbfile_owner=bacula:bacula
+# set in config, must not be set here: dbc_dbuser=bacula
+# set in config, must not be set here: dbc_dbname=bacula.db
+# set in config, must not be set here: dbc_basepath=/var/lib/bacula
+
+
+# source dbconfig-common shell library, and call the hook function
+if [ -f /usr/share/dbconfig-common/dpkg/config.sqlite3 ]; then
+ . /usr/share/dbconfig-common/dpkg/postinst.sqlite3
+ dbc_go bacula-director-sqlite3 $@
+fi
+
+LOGDIR="/var/log/bacula"
+POSTINST_COMMON="/usr/share/bacula-director/postinst-common"
+DEFCONFIG="/usr/share/bacula-common/defconfig"
+CFGFILE="/etc/bacula/bacula-dir.conf"
+
+. /usr/share/bacula-common/common-functions.dpkg
+readOrCreatePasswords
+setup_etc_default bacula-director-sqlite3 $@
+
+case "$1" in
+configure)
+
+ echo -n "Processing configuration..."
+ . /etc/dbconfig-common/bacula-director-sqlite3.conf
+ TARGET=$CFGFILE.dpkg-tmp
+ # FIXME: should this tweak make_catalog_backup like bacula-director-pgsql.postinst does?
+ BACULADBNAME=`echo "$dbc_dbname" | sed 's/.db$//'`
+
+ sed -e s~XXX_DIRPASSWORD_XXX~$DIRPASSWD~ \
+ -e s~XXX_MONDIRPASSWORD_XXX~$DIRMPASSWD~ \
+ -e s~XXX_SDPASSWORD_XXX~$SDPASSWD~ \
+ -e s~XXX_FDPASSWORD_XXX~$FDPASSWD~ \
+ -e "s~/XXX_DBNAME_XXX~/$BACULADBNAME~" \
+ -e "s~\"XXX_DBNAME_XXX~\"$BACULADBNAME~" \
+ -e s~XXX_DBUSER_XXX~~ \
+ -e s~XXX_DBPASSWORD_XXX~~ \
+ $DEFCONFIG/bacula-dir.conf > $TARGET
+
+ /bin/bash $POSTINST_COMMON
+
+ echo "Ok."
+ ;;
+
+abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+*)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# Do start daemon
+db_stop
+
+
+#DEBHELPER#
+
+exit 0
diff --combined debian/bacula-fd.init
index 676b1bd,bfcf960..ba86099
--- a/debian/bacula-fd.init
+++ b/debian/bacula-fd.init
@@@ -7,6 -7,7 +7,7 @@@
# Should-Stop: bacula-sd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
+ # Short-Description: Start Bacula File Daemon at boot time
### END INIT INFO
#
# bacula-fd SysV init script for Bacula-FD.
@@@ -30,12 -31,12 +31,12 @@@ if [ -n "`getent services bacula-fd`" ]
fi
. /lib/lsb/init-functions
-. /usr/share/bacula-common/common-functions
-if [ -r /etc/default/bacula-fd ]; then
- . /etc/default/bacula-fd
+. /usr/share/bacula-common/common-functions.init
+if [ -r /etc/default/$NAME ]; then
+ . /etc/default/$NAME
fi
-CONFIG="${CONFIG:-/etc/bacula/bacula-fd.conf}"
+CONFIG="${CONFIG:-/etc/bacula/$NAME.conf}"
create_var_run_dir
@@@ -56,8 -57,13 +57,8 @@@ do_stop(
case "$1" in
start)
- if [ -f /etc/bacula/do_not_run ]; then
- log_failure_msg "Not starting $DESC: disabled via /etc/bacula/do_not_run"
- exit 0
- fi
-
if [ "$ENABLED" = "no" ]; then
- log_failure_msg "Not starting $DESC: disabled via /etc/default/bacula-fd"
+ log_failure_msg "Not starting $DESC: disabled via /etc/default/$NAME"
exit 0
fi
diff --combined debian/bacula-fd.postinst
index cf19a84,aa57dec..f078df3
--- a/debian/bacula-fd.postinst
+++ b/debian/bacula-fd.postinst
@@@ -1,72 -1,34 +1,72 @@@
- #! /bin/bash
+ #!/bin/sh
-set -e
+# postinst script for bacula-fd
+#
. /usr/share/debconf/confmodule
+db_version 2.0
+
+set -e
-PKG=bacula-fd
-
-CONFDIR=/etc/bacula
-PW_FILE=$PKG-password.conf
-MONPW_FILE=$PKG-mon-password.conf
-DEFAULTFILE=/etc/default/$PKG
+# 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>
+# * <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
+#
+# 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'.
-DEFAULT_TEXT="No password has been provided.\nThe daemon is thus deactivated for your safety via\n$DEFAULTFILE.\n"
-COMMON_TEXT="# This file is sourced by the daemon's main config file."
+SRCDIR="/usr/share/bacula-common/defconfig"
+DSTDIR="/etc/bacula"
+CONFIG="bacula-fd.conf"
-# Create files with passwords that can be sourced from the main config
-if [ "$1" = "configure" ]; then
- db_get $PKG/password && PW="$RET"
- db_get $PKG/mon-password && MONPW="$RET"
+. /usr/share/bacula-common/common-functions.dpkg
+readOrCreatePasswords
+setup_etc_default bacula-fd $@
- printf "$COMMON_TEXT\n\nPassword = \"$PW\"" > $CONFDIR/$PW_FILE
- printf "$COMMON_TEXT\n\nPassword = \"$MONPW\"" > $CONFDIR/$MONPW_FILE
+case "$1" in
+ configure)
- # if this is a new installation and the user didn't provide passwords,
- # deactivate daemon for the user's safety
- if [ -z "$2" ]; then
- if [ -z "$PW" -o -z "$MONPW" ]; then
- printf "$DEFAULT_TEXT"
- sed -i -e 's/^ENABLED=.*$/ENABLED=no/' $DEFAULTFILE
- fi
+ if [ ! -f $DSTDIR/$CONFIG ]; then
+ TARGET=$DSTDIR/$CONFIG
+ else
+ TARGET=$DSTDIR/$CONFIG.dist
fi
-fi
+
+ sed -e s~@debian_hostname@~`hostname`~ \
+ -e s~XXX_FDPASSWORD_XXX~$FDPASSWD~ \
+ -e s~XXX_MONFDPASSWORD_XXX~$FDMPASSWD~ < $SRCDIR/$CONFIG > $TARGET
+
+
+ # Harden permissions, so that passwords can not be looked at
+ chown root:root $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
+
+
diff --combined debian/bacula-sd.init
index 334704b,a0e587e..22a67fa
--- a/debian/bacula-sd.init
+++ b/debian/bacula-sd.init
@@@ -5,6 -5,7 +5,7 @@@
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
+ # Short-Description: Start Bacula Storage Daemon at boot time
### END INIT INFO
#
# bacula-fd SysV init script for Bacula-FD.
@@@ -28,12 -29,12 +29,12 @@@ if [ -n "`getent services bacula-sd`" ]
fi
. /lib/lsb/init-functions
-. /usr/share/bacula-common/common-functions
-if [ -r /etc/default/bacula-sd ]; then
- . /etc/default/bacula-sd
+. /usr/share/bacula-common/common-functions.init
+if [ -r /etc/default/$NAME ]; then
+ . /etc/default/$NAME
fi
-CONFIG="${CONFIG:-/etc/bacula/bacula-fd.conf}"
+CONFIG="${CONFIG:-/etc/bacula/$NAME.conf}"
create_var_run_dir
@@@ -53,8 -54,13 +54,8 @@@ do_stop(
case "$1" in
start)
- if [ -f /etc/bacula/do_not_run ]; then
- log_failure_msg "Not starting $DESC: disabled via /etc/bacula/do_not_run"
- exit 0
- fi
-
if [ "$ENABLED" = "no" ]; then
- log_failure_msg "Not starting $DESC: disabled via /etc/default/bacula-sd"
+ log_failure_msg "Not starting $DESC: disabled via /etc/default/$NAME"
exit 0
fi
diff --combined debian/bacula-sd.postinst
index 422afc0,665e49e..474089d
--- a/debian/bacula-sd.postinst
+++ b/debian/bacula-sd.postinst
@@@ -1,71 -1,34 +1,71 @@@
- #! /bin/bash
+ #!/bin/sh
-set -e
+# postinst script for bacula-sd
+#
. /usr/share/debconf/confmodule
+db_version 2.0
+
+set -e
-PKG=bacula-sd
+# 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>
+# * <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
+#
+# 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'.
-CONFDIR=/etc/bacula
-PW_FILE=$PKG-password.conf
-MONPW_FILE=$PKG-mon-password.conf
-DEFAULTFILE=/etc/default/$PKG
+SRCDIR="/usr/share/bacula-common/defconfig"
+DSTDIR="/etc/bacula"
+CONFIG="bacula-sd.conf"
-DEFAULT_TEXT="No password has been provided.\nThe daemon is thus deactivated for your safety via\n$DEFAULTFILE.\n"
-COMMON_TEXT="# This file is sourced by the daemon's main config file."
+. /usr/share/bacula-common/common-functions.dpkg
+readOrCreatePasswords
+setup_etc_default bacula-sd $@
-# Create files with passwords that can be sourced from the main config
-if [ "$1" = "configure" ]; then
- db_get $PKG/password && PW="$RET"
- db_get $PKG/mon-password && MONPW="$RET"
+case "$1" in
+ configure)
+
+ if [ ! -f $DSTDIR/$CONFIG ]; then
+ TARGET=$DSTDIR/$CONFIG
+ else
+ TARGET=$DSTDIR/$CONFIG.dist
+ fi
- printf "$COMMON_TEXT\n\nPassword = \"$PW\"" > $CONFDIR/$PW_FILE
- printf "$COMMON_TEXT\n\nPassword = \"$MONPW\"" > $CONFDIR/$MONPW_FILE
+ 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
+ ;;
- # if this is a new installation and the user didn't provide passwords,
- # deactivate daemon for the user's safety
- if [ -z "$2" ]; then
- if [ -z "$PW" -o -z "$MONPW" ]; then
- printf "$DEFAULT_TEXT"
- sed -i -e 's/^ENABLED=.*$/ENABLED=no/' $DEFAULTFILE
- fi
- fi
-fi
+ 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
+
+
diff --combined debian/bacula-traymonitor.postinst
index d5cfec6,0000000..f12fc1a
mode 100644,000000..100644
--- a/debian/bacula-traymonitor.postinst
+++ b/debian/bacula-traymonitor.postinst
@@@ -1,64 -1,0 +1,64 @@@
- #! /bin/sh
++#!/bin/sh
+# postinst script for bacula
+#
+# 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>
+# * <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
+#
+# 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="tray-monitor.conf"
+
+CONSOLE=/usr/sbin/bacula-console
+
+case "$1" in
+ configure)
+
+ if [ ! -f $DSTDIR/$CONFIG ]; then
+ TARGET=$DSTDIR/$CONFIG
+ else
+ TARGET=$DSTDIR/$CONFIG.dist
+ fi
+
+ sed -e "s~@debian_hostname@~localhost~" < $SRCDIR/$CONFIG > $TARGET
+ chown root: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
+
+
diff --combined debian/patches/fix-example-script-syntax
index 0000000,2b8e564..78004b7
mode 000000,100644..100644
--- a/debian/patches/fix-example-script-syntax
+++ b/debian/patches/fix-example-script-syntax
@@@ -1,0 -1,11 +1,16 @@@
++Description: fix syntax in example script for tape autochanger
++Author: Jan Hauke Rahm <jhr at debian.org>
++Reviewed-by: Alexander Golovko <alexandro at ankalagon.ru>
++Last-Update: 2012-05-25
++
+ --- a/examples/autochangers/locking-mtx-changer
+ +++ b/examples/autochangers/locking-mtx-changer
+ @@ -61,7 +61,7 @@
+ done
+ }
+
+ -LOCKFILE="${LOCKDIR}/mtx-changer:`echo $ctl | tr / _'"
+ +LOCKFILE="${LOCKDIR}/mtx-changer:`echo $ctl | tr / _`"
+
+ changer_lock() {
+ echo "$$" >$LOCKFILE.$$
diff --combined debian/patches/series
index ee6861f,6799749..876f8a9
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,8 -1,6 +1,9 @@@
-fix-binutils-gold
+upstream-1623_debian-591293___file_jpfid_idx.patch
fix-default-config
fix-sql-bindir
+switch-nonfree-sha1-to-openssl.patch
+fix-binutils-gold-linking.patch
+fix-mysql-autoconf.patch
+fix-readline-ncurses-depends.patch
remove-use-statement-for-mysql
-fix-mysql-upgrade
+ fix-example-script-syntax
--
Bacula, a network backup, recovery and verification program
More information about the pkg-bacula-commits
mailing list