Skip to content

Commit

Permalink
dbconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
joergsteffens committed May 7, 2014
1 parent 264f0a4 commit 87f72ae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
6 changes: 3 additions & 3 deletions README.dbconfig
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
23 changes: 3 additions & 20 deletions debian/bareos-database-common.config.in
Expand Up @@ -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
Expand Down Expand Up @@ -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
;;
*)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions debian/bareos-database-common.postinst.in
Expand Up @@ -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

Expand Down
5 changes: 0 additions & 5 deletions platforms/debian/set_dbconfig_vars.sh.in
Expand Up @@ -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

0 comments on commit 87f72ae

Please sign in to comment.