From 87f72aefbf8625e88bbb330c0a204a20bbc3018f Mon Sep 17 00:00:00 2001 From: Joerg Steffens Date: Wed, 7 May 2014 17:57:58 +0200 Subject: [PATCH] dbconfig --- README.dbconfig | 6 +++--- debian/bareos-database-common.config.in | 23 +++-------------------- debian/bareos-database-common.postinst.in | 4 ++-- platforms/debian/set_dbconfig_vars.sh.in | 5 ----- 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/README.dbconfig b/README.dbconfig index cdc689748ff..62095eaa64b 100644 --- a/README.dbconfig +++ b/README.dbconfig @@ -84,7 +84,7 @@ postgresql * /etc/dbconfig-common/bareos-database-common.conf created * db: setup * update from 12.4: - * ? + * updates db_version from 2001 to 2002. * update from 13.2: * db_version is already 2002. It detects, nothing to do. * update dbconfig already configured @@ -98,7 +98,7 @@ mysql * db: setup * dbpass must be set to bareos-dir.conf * update from 12.4: - * ? + * updates db_version from 2001 to 2002. * update from 13.2: * db_version is already 2002. It detects, nothing to do. * update dbconfig already configured @@ -112,7 +112,7 @@ sqlite3 * db: setup * creates link from /var/lib/bareos/bareos.db to bareos * update from 12.4: - * ? + * updates db_version from 2001 to 2002. * update from 13.2: * db_version is already 2002. It detects, nothing to do. * creates link from /var/lib/bareos/bareos.db to bareos diff --git a/debian/bareos-database-common.config.in b/debian/bareos-database-common.config.in index 8c2a1c0a455..f29804e287f 100644 --- a/debian/bareos-database-common.config.in +++ b/debian/bareos-database-common.config.in @@ -5,7 +5,7 @@ set -e . /usr/share/debconf/confmodule #set -x -echo "bareos-database-common.config: $@" >&2 +#echo "bareos-database-common.config: $@" >&2 if [ -r @scriptdir@/bareos-config-lib.sh ]; then . @scriptdir@/bareos-config-lib.sh @@ -58,25 +58,6 @@ if [ -r @scriptdir@/bareos-config-lib.sh ]; then dbc_load_include="sh:/usr/lib/bareos/scripts/set_dbconfig_vars.sh" # empty passwords require special treatment, see below bareos_database_password=`get_database_password` || true -# case "`get_database_driver`" in -# postgresql) -# if [ -z "${bareos_database_password}" ]; then -# dbc_authmethod_user="ident" -# fi -# ;; -# mysql) -# -# sqlite3) -# # dbconfig expects sqlite files as "dbname.db" -# # while Bareos expects them as "dbname". -# # A link is created, so that both names maps. -# if [ -e "${dbc_basepath}/${dbc_dbname}.db" ]; then -# if ! [ -e "${dbc_basepath}/${dbc_dbname}" ]; then -# ln -s "${dbc_basepath}/${dbc_dbname}.db" "${dbc_basepath}/${dbc_dbname}" -# fi -# fi -# ;; -# esac fi ;; *) @@ -86,6 +67,8 @@ if [ -r @scriptdir@/bareos-config-lib.sh ]; then dbc_go bareos-database-common $param1 $param2 $@ if [ "$bareos_migrate_to_dbconfig" = "yes" ]; then + # TODO: check if settings app-pass to "" is really required. + # Only required for DEBIAN_FRONTEND=noninteractive? case "`get_database_driver`" in postgresql) if [ -z "${bareos_database_password}" ]; then diff --git a/debian/bareos-database-common.postinst.in b/debian/bareos-database-common.postinst.in index c441c0be0e9..87e0be383e5 100644 --- a/debian/bareos-database-common.postinst.in +++ b/debian/bareos-database-common.postinst.in @@ -14,8 +14,8 @@ set -e # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package -set -x -echo "bareos-database-common.postinst: $@" >&2 +#set -x +#echo "bareos-database-common.postinst: $@" >&2 . /usr/share/debconf/confmodule diff --git a/platforms/debian/set_dbconfig_vars.sh.in b/platforms/debian/set_dbconfig_vars.sh.in index 43479acd037..7c35760e188 100755 --- a/platforms/debian/set_dbconfig_vars.sh.in +++ b/platforms/debian/set_dbconfig_vars.sh.in @@ -19,18 +19,13 @@ else case "`get_database_driver`" in postgresql) dbtype="pgsql" - # if Bareos config password is defined, set dbpass - #[ "$bareos_database_password" ] && dbpass="$bareos_database_password" ;; mysql) dbtype="mysql" - # set dbpass, even if empty - #dbpass="$bareos_database_password" ;; sqlite3) dbtype="sqlite3" basepath="`get_working_dir`" - # dbpass: not required ;; esac fi