From 0810710845cdf24f5c93c840d1f0058ec16d2077 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 30 Mar 2007 21:46:04 +0000 Subject: [PATCH] kes Make database name and user configurable --with-db-name=xxx --with-db-user=xxx kes Add back database type to message.c for debugging. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4463 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/Makefile.in | 4 +- bacula/autoconf/bacula-macros/db.m4 | 24 +++--- bacula/autoconf/configure.in | 41 ++++++++-- bacula/configure | 77 ++++++++++++++----- bacula/platforms/gentoo/bacula-init.in | 8 +- .../suse/bacula-dir-suse-sqlite.patch | 22 +++--- bacula/platforms/suse/bacula-dir.in | 16 ++-- bacula/src/cats/Makefile.in | 26 +++---- bacula/src/cats/create_bacula_database.in | 6 +- bacula/src/cats/create_mysql_database.in | 7 +- bacula/src/cats/create_postgresql_database.in | 9 ++- bacula/src/cats/create_sqlite3_database.in | 5 +- bacula/src/cats/create_sqlite_database.in | 3 +- bacula/src/cats/delete_catalog_backup.in | 4 +- bacula/src/cats/drop_bacula_database.in | 6 +- bacula/src/cats/drop_bacula_tables.in | 6 +- bacula/src/cats/drop_mysql_database.in | 9 ++- bacula/src/cats/drop_mysql_tables.in | 7 +- bacula/src/cats/drop_postgresql_database.in | 7 +- bacula/src/cats/drop_postgresql_tables.in | 3 +- bacula/src/cats/drop_sqlite3_database.in | 6 +- bacula/src/cats/drop_sqlite3_tables.in | 3 +- bacula/src/cats/drop_sqlite_database.in | 6 +- bacula/src/cats/drop_sqlite_tables.in | 5 +- bacula/src/cats/grant_bacula_privileges.in | 8 +- bacula/src/cats/grant_mysql_privileges.in | 9 ++- .../src/cats/grant_postgresql_privileges.in | 7 +- bacula/src/cats/make_bacula_tables.in | 6 +- bacula/src/cats/make_catalog_backup.in | 8 +- bacula/src/cats/make_catalog_backup.in.patch | 8 +- bacula/src/cats/make_mysql_tables.in | 3 +- bacula/src/cats/make_postgresql_tables.in | 3 +- bacula/src/cats/make_sqlite3_tables.in | 7 +- bacula/src/cats/make_sqlite_tables.in | 7 +- bacula/src/cats/mysql.in | 3 +- bacula/src/cats/postgresql.in | 3 +- bacula/src/cats/sqlite.in | 3 +- bacula/src/cats/update_bacula_tables.in | 8 +- bacula/src/cats/update_mysql_tables.in | 3 +- bacula/src/cats/update_postgresql_tables.in | 3 +- bacula/src/cats/update_sqlite3_tables.in | 5 +- bacula/src/cats/update_sqlite_tables.in | 5 +- bacula/src/cats/update_sqlite_tables.in.patch | 6 +- bacula/src/dird/bacula-dir.conf.in | 2 +- bacula/src/dird/dird.c | 2 + bacula/src/lib/message.c | 12 +-- bacula/src/lib/protos.h | 3 +- bacula/src/version.h | 4 +- bacula/technotes-2.1 | 4 + 49 files changed, 267 insertions(+), 175 deletions(-) diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 21e76034da..68aba65dc7 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -184,8 +184,8 @@ Makefiles: (cd src/cats; \ chmod 755 create_bacula_database update_bacula_tables make_bacula_tables; \ chmod 755 grant_bacula_privileges drop_bacula_tables drop_bacula_database; \ - chmod 755 create_@DB_NAME@_database update_@DB_NAME@_tables make_@DB_NAME@_tables; \ - chmod 755 grant_@DB_NAME@_privileges drop_@DB_NAME@_tables drop_@DB_NAME@_database; \ + chmod 755 create_@DB_TYPE@_database update_@DB_TYPE@_tables make_@DB_TYPE@_tables; \ + chmod 755 grant_@DB_TYPE@_privileges drop_@DB_TYPE@_tables drop_@DB_TYPE@_database; \ chmod 755 make_catalog_backup delete_catalog_backup) clean: diff --git a/bacula/autoconf/bacula-macros/db.m4 b/bacula/autoconf/bacula-macros/db.m4 index aa11d0c829..df90d7cc69 100644 --- a/bacula/autoconf/bacula-macros/db.m4 +++ b/bacula/autoconf/bacula-macros/db.m4 @@ -93,8 +93,8 @@ AC_ARG_WITH(mysql, AC_MSG_RESULT(yes) db_found=yes support_mysql=yes - db_name=MySQL - DB_NAME=mysql + db_type=MySQL + DB_TYPE=mysql else AC_MSG_RESULT(no) @@ -185,8 +185,8 @@ AC_ARG_WITH(embedded-mysql, AC_MSG_RESULT(yes) db_found=yes support_mysql=yes - db_name=MySQL - DB_NAME=mysql + db_type=MySQL + DB_TYPE=mysql else AC_MSG_RESULT(no) @@ -268,8 +268,8 @@ AC_ARG_WITH(sqlite, AC_MSG_RESULT(yes) db_found=yes support_sqlite=yes - db_name=SQLite - DB_NAME=sqlite + db_type=SQLite + DB_TYPE=sqlite else AC_MSG_RESULT(no) @@ -349,8 +349,8 @@ AC_ARG_WITH(sqlite3, AC_MSG_RESULT(yes) db_found=yes support_sqlite3=yes - db_name=SQLite3 - DB_NAME=sqlite3 + db_type=SQLite3 + DB_TYPE=sqlite3 else AC_MSG_RESULT(no) @@ -446,8 +446,8 @@ AC_ARG_WITH(postgresql, AC_MSG_RESULT(yes) db_found=yes support_postgresql=yes - db_name=PostgreSQL - DB_NAME=postgresql + db_type=PostgreSQL + DB_TYPE=postgresql else AC_MSG_RESULT(no) fi @@ -470,7 +470,7 @@ dnl# -------------------------------------------------------------------------- dnl Check for some DBMS backend dnl NOTE: we can use only one backend at a time db_found=no -db_name=none +DB_TYPE=none if test x$support_mysql = xyes; then cats=cats @@ -516,7 +516,7 @@ AC_ARG_WITH(berkeleydb, AC_MSG_RESULT(yes) have_db=yes support_mysql=yes - db_name=BerkelyDB + DB_TYPE=BerkelyDB else AC_MSG_RESULT(no) diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 006287616c..0527c694de 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -212,8 +212,8 @@ build_client_only=no build_dird=yes build_stored=yes cats= -db_name=Internal -DB_NAME=bdb +db_type=Internal +DB_TYPE=bdb dnl# -------------------------------------------------------------------------- dnl# CHECKING COMMAND LINE OPTIONS @@ -432,8 +432,8 @@ AC_ARG_ENABLE(client-only, [ --enable-client-only build client (File daemon) only [disabled]], [if test x$enableval = xyes; then build_client_only=yes - db_name=None - DB_NAME=none + db_type=None + DB_TYPE=none fi]) if test x$build_client_only = xno; then ALL_DIRS="subdirs" @@ -1121,6 +1121,31 @@ AC_SUBST(mon_dir_password) AC_SUBST(mon_fd_password) AC_SUBST(mon_sd_password) +# +# Pickup any database name +# +db_name=bacula +AC_ARG_WITH(db_name, + [ --with-db-name=DBNAME specify database name (default bacula)], + [ + if test "x$withval" != "x" ; then + db_name=$withval + fi + ] +) +AC_SUBST(db_name) + +db_user=bacula +AC_ARG_WITH(db_user, + [ --with-db-user=UNAME specify database user (default bacula)], + [ + if test "x$withval" != "x" ; then + db_user=$withval + fi + ] +) +AC_SUBST(db_user) + # # Handle users and groups for each daemon @@ -1222,7 +1247,7 @@ BA_CHECK_SQLITE3_DB BA_CHECK_SQLITE_DB AC_SUBST(cats) -AC_SUBST(DB_NAME) +AC_SUBST(DB_TYPE) AC_DEFINE(PROTOTYPES) @@ -2140,7 +2165,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then exit 1 fi -if test "x${db_name}" = "xInternal" ; then +if test "x${db_type}" = "xInternal" ; then echo " " echo " " echo "You have not specified either --enable-client-only or one of the" @@ -2177,8 +2202,10 @@ Configuration on `date`: Statically Linked SD: ${support_static_sd} Statically Linked DIR: ${support_static_dir} Statically Linked CONS: ${support_static_cons} - Database type: ${db_name} + Database type: ${db_type} Database lib: ${DB_LIBS} + Database name: ${db_name} + Database user: ${db_user} Job Output Email: ${job_email} Traceback Email: ${dump_email} diff --git a/bacula/configure b/bacula/configure index f7f2b9266a..3692440ba4 100755 --- a/bacula/configure +++ b/bacula/configure @@ -799,6 +799,8 @@ sd_password mon_dir_password mon_fd_password mon_sd_password +db_name +db_user dir_user dir_group sd_user @@ -810,7 +812,7 @@ SQL_LFLAGS SQL_INCLUDE SQL_BINDIR cats -DB_NAME +DB_TYPE GETCONF XMKMF X_CFLAGS @@ -1479,6 +1481,8 @@ Optional Packages: --with-mon-dir-password=PASSWORD specify Director's password used by the monitor --with-mon-fd-password=PASSWORD specify Client's password used by the monitor --with-mon-sd-password=PASSWORD specify Storage daemon's password used by the monitor + --with-db-name=DBNAME specify database name (default bacula) + --with-db-user=UNAME specify database user (default bacula) --with-dir-user=USER specify user for Director daemon --with-dir-group=GROUP specify group for Director daemon --with-sd-user=USER specify user for Storage daemon @@ -14634,8 +14638,8 @@ build_client_only=no build_dird=yes build_stored=yes cats= -db_name=Internal -DB_NAME=bdb +db_type=Internal +DB_TYPE=bdb # ------------------------------------------- @@ -14885,8 +14889,8 @@ fi if test "${enable_client_only+set}" = set; then enableval=$enable_client_only; if test x$enableval = xyes; then build_client_only=yes - db_name=None - DB_NAME=none + db_type=None + DB_TYPE=none fi fi @@ -18539,6 +18543,37 @@ fi +# +# Pickup any database name +# +db_name=bacula + +# Check whether --with-db_name was given. +if test "${with_db_name+set}" = set; then + withval=$with_db_name; + if test "x$withval" != "x" ; then + db_name=$withval + fi + + +fi + + + +db_user=bacula + +# Check whether --with-db_user was given. +if test "${with_db_user+set}" = set; then + withval=$with_db_user; + if test "x$withval" != "x" ; then + db_user=$withval + fi + + +fi + + + # # Handle users and groups for each daemon @@ -18927,8 +18962,8 @@ _ACEOF echo "${ECHO_T}yes" >&6; } db_found=yes support_postgresql=yes - db_name=PostgreSQL - DB_NAME=postgresql + db_type=PostgreSQL + DB_TYPE=postgresql else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } @@ -19053,8 +19088,8 @@ _ACEOF echo "${ECHO_T}yes" >&6; } db_found=yes support_mysql=yes - db_name=MySQL - DB_NAME=mysql + db_type=MySQL + DB_TYPE=mysql else { echo "$as_me:$LINENO: result: no" >&5 @@ -19159,8 +19194,8 @@ _ACEOF echo "${ECHO_T}yes" >&6; } db_found=yes support_mysql=yes - db_name=MySQL - DB_NAME=mysql + db_type=MySQL + DB_TYPE=mysql else { echo "$as_me:$LINENO: result: no" >&5 @@ -19252,8 +19287,8 @@ _ACEOF echo "${ECHO_T}yes" >&6; } db_found=yes support_sqlite3=yes - db_name=SQLite3 - DB_NAME=sqlite3 + db_type=SQLite3 + DB_TYPE=sqlite3 else { echo "$as_me:$LINENO: result: no" >&5 @@ -19347,8 +19382,8 @@ _ACEOF echo "${ECHO_T}yes" >&6; } db_found=yes support_sqlite=yes - db_name=SQLite - DB_NAME=sqlite + db_type=SQLite + DB_TYPE=sqlite else { echo "$as_me:$LINENO: result: no" >&5 @@ -34830,6 +34865,8 @@ sd_password!$sd_password$ac_delim mon_dir_password!$mon_dir_password$ac_delim mon_fd_password!$mon_fd_password$ac_delim mon_sd_password!$mon_sd_password$ac_delim +db_name!$db_name$ac_delim +db_user!$db_user$ac_delim dir_user!$dir_user$ac_delim dir_group!$dir_group$ac_delim sd_user!$sd_user$ac_delim @@ -34841,7 +34878,7 @@ SQL_LFLAGS!$SQL_LFLAGS$ac_delim SQL_INCLUDE!$SQL_INCLUDE$ac_delim SQL_BINDIR!$SQL_BINDIR$ac_delim cats!$cats$ac_delim -DB_NAME!$DB_NAME$ac_delim +DB_TYPE!$DB_TYPE$ac_delim GETCONF!$GETCONF$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim @@ -34868,7 +34905,7 @@ DISTVER!$DISTVER$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 46; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 48; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -35480,7 +35517,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then exit 1 fi -if test "x${db_name}" = "xInternal" ; then +if test "x${db_type}" = "xInternal" ; then echo " " echo " " echo "You have not specified either --enable-client-only or one of the" @@ -35517,8 +35554,10 @@ Configuration on `date`: Statically Linked SD: ${support_static_sd} Statically Linked DIR: ${support_static_dir} Statically Linked CONS: ${support_static_cons} - Database type: ${db_name} + Database type: ${db_type} Database lib: ${DB_LIBS} + Database name: ${db_name} + Database user: ${db_user} Job Output Email: ${job_email} Traceback Email: ${dump_email} diff --git a/bacula/platforms/gentoo/bacula-init.in b/bacula/platforms/gentoo/bacula-init.in index fa9068dcea..b3ddaa1a8f 100755 --- a/bacula/platforms/gentoo/bacula-init.in +++ b/bacula/platforms/gentoo/bacula-init.in @@ -6,7 +6,7 @@ depend() { need net - use @DB_NAME@ + use @DB_TYPE@ } opts="test" @@ -25,7 +25,7 @@ start() { OPTIONS='' if [ "${SD_USER}" != '' ]; then OPTIONS="${OPTIONS} -u ${SD_USER}" - fi + fi if [ "${SD_GROUP}" != '' ]; then OPTIONS="${OPTIONS} -g ${SD_GROUP}" @@ -38,7 +38,7 @@ start() { OPTIONS='' if [ "${FD_USER}" != '' ]; then OPTIONS="${OPTIONS} -u ${FD_USER}" - fi + fi if [ "${FD_GROUP}" != '' ]; then OPTIONS="${OPTIONS} -g ${FD_GROUP}" @@ -52,7 +52,7 @@ start() { OPTIONS='' if [ "${DIR_USER}" != '' ]; then OPTIONS="${OPTIONS} -u ${DIR_USER}" - fi + fi if [ "${DIR_GROUP}" != '' ]; then OPTIONS="${OPTIONS} -g ${DIR_GROUP}" diff --git a/bacula/platforms/suse/bacula-dir-suse-sqlite.patch b/bacula/platforms/suse/bacula-dir-suse-sqlite.patch index 44c3f6646b..b49ca62f32 100644 --- a/bacula/platforms/suse/bacula-dir-suse-sqlite.patch +++ b/bacula/platforms/suse/bacula-dir-suse-sqlite.patch @@ -1,16 +1,16 @@ ---- bacula-1.36.0/platforms/suse/bacula-dir.in 2004-10-19 09:35:09.000000000 -0400 -+++ bacula-1.36.0/platforms/suse/bacula-dir.sqlite.in 2004-10-31 09:17:40.000000000 -0500 +--- bacula-1.36.0/platforms/suse/bacula-dir.in 2004-10-19 09:35:09.000000000 -0400 ++++ bacula-1.36.0/platforms/suse/bacula-dir.sqlite.in 2004-10-31 09:17:40.000000000 -0500 @@ -11,10 +11,11 @@ # Added rc.status functions 3/13/2004 D. Scott Barninger # Added LSB init info 10/14/2004 D. Scott Barninger # -+# Configured for @DB_NAME@ support ++# Configured for @DB_TYPE@ support ### BEGIN INIT INFO - # Provides: bacula-dir --# Required-Start: $local_fs $network @DB_NAME@ --# Required-Stop: $local_fs $network @DB_NAME@ -+# Required-Start: $local_fs $network -+# Required-Stop: $local_fs $network - # Default-Start: 3 5 - # Default-Stop: 0 1 2 6 - # Short-Description: bacula director + # Provides: bacula-dir +-# Required-Start: $local_fs $network @DB_TYPE@ +-# Required-Stop: $local_fs $network @DB_TYPE@ ++# Required-Start: $local_fs $network ++# Required-Stop: $local_fs $network + # Default-Start: 3 5 + # Default-Stop: 0 1 2 6 + # Short-Description: bacula director diff --git a/bacula/platforms/suse/bacula-dir.in b/bacula/platforms/suse/bacula-dir.in index c4d17bb903..b583d043bd 100755 --- a/bacula/platforms/suse/bacula-dir.in +++ b/bacula/platforms/suse/bacula-dir.in @@ -1,7 +1,7 @@ #! /bin/sh # # bacula This shell script takes care of starting and stopping -# the bacula Director daemon +# the bacula Director daemon # # chkconfig: 2345 90 9 # description: It comes by night and sucks the vital essence from your computers. @@ -12,13 +12,13 @@ # Added LSB init info 10/14/2004 D. Scott Barninger # ### BEGIN INIT INFO -# Provides: bacula-dir -# Required-Start: $local_fs $network @DB_NAME@ -# Required-Stop: $local_fs $network @DB_NAME@ -# Default-Start: 3 5 -# Default-Stop: 0 1 2 6 -# Short-Description: bacula director -# Description: Bacula network backup system director daemon +# Provides: bacula-dir +# Required-Start: $local_fs $network @DB_TYPE@ +# Required-Stop: $local_fs $network @DB_TYPE@ +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: bacula director +# Description: Bacula network backup system director daemon ### END INIT INFO # source process status functions diff --git a/bacula/src/cats/Makefile.in b/bacula/src/cats/Makefile.in index 562488f707..8016395416 100644 --- a/bacula/src/cats/Makefile.in +++ b/bacula/src/cats/Makefile.in @@ -84,7 +84,7 @@ realclean: clean $(RMF) grant_sqlite_privileges drop_sqlite_tables drop_sqlite_database $(RMF) create_sqlite3_database update_sqlite3_tables make_sqlite3_tables - $(RMF) grant_sqlite3_privileges drop_sqlite3_tables drop_sqlite3_database + $(RMF) grant_sqlite3_privileges drop_sqlite3_tables drop_sqlite3_database $(RMF) mysql sqlite postgresql $(RMF) make_catalog_backup delete_catalog_backup @@ -98,12 +98,12 @@ devclean: realclean (cd $(srcdir); $(RMF) Makefile) install: - $(INSTALL_SCRIPT) create_@DB_NAME@_database $(DESTDIR)$(scriptdir)/create_@DB_NAME@_database - $(INSTALL_SCRIPT) update_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/update_@DB_NAME@_tables - $(INSTALL_SCRIPT) make_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/make_@DB_NAME@_tables - $(INSTALL_SCRIPT) grant_@DB_NAME@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_NAME@_privileges - $(INSTALL_SCRIPT) drop_@DB_NAME@_tables $(DESTDIR)$(scriptdir)/drop_@DB_NAME@_tables - $(INSTALL_SCRIPT) drop_@DB_NAME@_database $(DESTDIR)$(scriptdir)/drop_@DB_NAME@_database + $(INSTALL_SCRIPT) create_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/create_@DB_TYPE@_database + $(INSTALL_SCRIPT) update_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/update_@DB_TYPE@_tables + $(INSTALL_SCRIPT) make_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/make_@DB_TYPE@_tables + $(INSTALL_SCRIPT) grant_@DB_TYPE@_privileges $(DESTDIR)$(scriptdir)/grant_@DB_TYPE@_privileges + $(INSTALL_SCRIPT) drop_@DB_TYPE@_tables $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_tables + $(INSTALL_SCRIPT) drop_@DB_TYPE@_database $(DESTDIR)$(scriptdir)/drop_@DB_TYPE@_database $(INSTALL_SCRIPT) create_bacula_database $(DESTDIR)$(scriptdir)/create_bacula_database $(INSTALL_SCRIPT) update_bacula_tables $(DESTDIR)$(scriptdir)/update_bacula_tables @@ -132,12 +132,12 @@ install: ${INSTALL_SCRIPT} $$filename ${DESTDIR}${scriptdir}/$$destname uninstall: - (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_NAME@_database) - (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_NAME@_tables) - (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_NAME@_tables) - (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_NAME@_privileges) - (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_NAME@_tables) - (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_NAME@_database) + (cd $(DESTDIR)$(scriptdir); $(RMF) create_@DB_TYPE@_database) + (cd $(DESTDIR)$(scriptdir); $(RMF) update_@DB_TYPE@_tables) + (cd $(DESTDIR)$(scriptdir); $(RMF) make_@DB_TYPE@_tables) + (cd $(DESTDIR)$(scriptdir); $(RMF) grant_@DB_TYPE@_privileges) + (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_tables) + (cd $(DESTDIR)$(scriptdir); $(RMF) drop_@DB_TYPE@_database) (cd $(DESTDIR)$(scriptdir); $(RMF) create_bacula_database) (cd $(DESTDIR)$(scriptdir); $(RMF) update_bacula_tables) diff --git a/bacula/src/cats/create_bacula_database.in b/bacula/src/cats/create_bacula_database.in index 7ee767b133..77f9bfc419 100644 --- a/bacula/src/cats/create_bacula_database.in +++ b/bacula/src/cats/create_bacula_database.in @@ -3,11 +3,11 @@ # This routine creates the Bacula database # using PostgreSQL, MySQL, or SQLite. # -if test xsqlite = x@DB_NAME@ -o xsqlite3 = x@DB_NAME@ ; then +if test xsqlite = x@DB_TYPE@ -o xsqlite3 = x@DB_TYPE@ ; then echo "Creating SQLite database" - @scriptdir@/create_@DB_NAME@_database + @scriptdir@/create_@DB_TYPE@_database else - if test xmysql = x@DB_NAME@ ; then + if test xmysql = x@DB_TYPE@ ; then echo "Creating MySQL database" @scriptdir@/create_mysql_database $* else diff --git a/bacula/src/cats/create_mysql_database.in b/bacula/src/cats/create_mysql_database.in index 88753cf696..52a8606f75 100644 --- a/bacula/src/cats/create_mysql_database.in +++ b/bacula/src/cats/create_mysql_database.in @@ -4,13 +4,14 @@ # bindir=@SQL_BINDIR@ +db_name=@db_name@ if $bindir/mysql $* -f <$1.sql else - if test xmysql = x@DB_NAME@ ; then + if test xmysql = x@DB_TYPE@ ; then if test $# -gt 2; then MYSQLPASSWORD=" --password=$3" else @@ -26,7 +26,7 @@ else fi ${BINDIR}/mysqldump -u $2$MYSQLPASSWORD -f --opt $1 >$1.sql else - if test xpostgresql = x@DB_NAME@ ; then + if test xpostgresql = x@DB_TYPE@ ; then if test $# -gt 2; then PGPASSWORD=$3 export PGPASSWORD diff --git a/bacula/src/cats/make_catalog_backup.in.patch b/bacula/src/cats/make_catalog_backup.in.patch index 2706746ca3..7279dc005b 100644 --- a/bacula/src/cats/make_catalog_backup.in.patch +++ b/bacula/src/cats/make_catalog_backup.in.patch @@ -1,13 +1,13 @@ ---- make_catalog_backup.in 2006-12-09 10:17:05.000000000 -0500 -+++ make_catalog_backup.in.fixed 2006-12-09 10:24:40.000000000 -0500 +--- make_catalog_backup.in 2006-12-09 10:17:05.000000000 -0500 ++++ make_catalog_backup.in.fixed 2006-12-09 10:24:40.000000000 -0500 @@ -16,7 +16,7 @@ cd @working_dir@ rm -f bacula.sql - if test xsqlite = x@DB_NAME@ ; then + if test xsqlite = x@DB_TYPE@ ; then - echo ".dump" | ${BINDIR}/sqlite $1.db >$1.sql + echo ".dump" | /usr/lib/bacula/sqlite/sqlite $1.db >$1.sql else - if test xmysql = x@DB_NAME@ ; then + if test xmysql = x@DB_TYPE@ ; then if test $# -gt 2; then @@ -33,7 +33,7 @@ fi diff --git a/bacula/src/cats/make_mysql_tables.in b/bacula/src/cats/make_mysql_tables.in index 0c1ce16324..513e5da2c4 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -3,9 +3,10 @@ # shell script to create Bacula MySQL tables # bindir=@SQL_BINDIR@ +db_name=@db_name@ if $bindir/mysql $* -f <