]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Make database name and user configurable
authorKern Sibbald <kern@sibbald.com>
Fri, 30 Mar 2007 21:46:04 +0000 (21:46 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 30 Mar 2007 21:46:04 +0000 (21:46 +0000)
     --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

49 files changed:
bacula/Makefile.in
bacula/autoconf/bacula-macros/db.m4
bacula/autoconf/configure.in
bacula/configure
bacula/platforms/gentoo/bacula-init.in
bacula/platforms/suse/bacula-dir-suse-sqlite.patch
bacula/platforms/suse/bacula-dir.in
bacula/src/cats/Makefile.in
bacula/src/cats/create_bacula_database.in
bacula/src/cats/create_mysql_database.in
bacula/src/cats/create_postgresql_database.in
bacula/src/cats/create_sqlite3_database.in
bacula/src/cats/create_sqlite_database.in
bacula/src/cats/delete_catalog_backup.in
bacula/src/cats/drop_bacula_database.in
bacula/src/cats/drop_bacula_tables.in
bacula/src/cats/drop_mysql_database.in
bacula/src/cats/drop_mysql_tables.in
bacula/src/cats/drop_postgresql_database.in
bacula/src/cats/drop_postgresql_tables.in
bacula/src/cats/drop_sqlite3_database.in
bacula/src/cats/drop_sqlite3_tables.in
bacula/src/cats/drop_sqlite_database.in
bacula/src/cats/drop_sqlite_tables.in
bacula/src/cats/grant_bacula_privileges.in
bacula/src/cats/grant_mysql_privileges.in
bacula/src/cats/grant_postgresql_privileges.in
bacula/src/cats/make_bacula_tables.in
bacula/src/cats/make_catalog_backup.in
bacula/src/cats/make_catalog_backup.in.patch
bacula/src/cats/make_mysql_tables.in
bacula/src/cats/make_postgresql_tables.in
bacula/src/cats/make_sqlite3_tables.in
bacula/src/cats/make_sqlite_tables.in
bacula/src/cats/mysql.in
bacula/src/cats/postgresql.in
bacula/src/cats/sqlite.in
bacula/src/cats/update_bacula_tables.in
bacula/src/cats/update_mysql_tables.in
bacula/src/cats/update_postgresql_tables.in
bacula/src/cats/update_sqlite3_tables.in
bacula/src/cats/update_sqlite_tables.in
bacula/src/cats/update_sqlite_tables.in.patch
bacula/src/dird/bacula-dir.conf.in
bacula/src/dird/dird.c
bacula/src/lib/message.c
bacula/src/lib/protos.h
bacula/src/version.h
bacula/technotes-2.1

index 21e76034dab7ee017ce59dd1b8970a1be6445de7..68aba65dc7d59e037770e8f5c493c6cbaff3d5c4 100755 (executable)
@@ -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:
index aa11d0c8293fc31d4f5f953a7ae1dd55adef0645..df90d7cc69a601b8541c0f09c1c5c0d1d086fbc8 100644 (file)
@@ -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)
index 006287616cfb1303456d5fab7775d2879d64f583..0527c694dedc65cd69338a91ef64383eea48cdf1 100644 (file)
@@ -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}
index f7f2b9266af76ae7612f5e2cd1b68569bd87e607..3692440ba4be1bbf7275726cbeeef8668df76bbd 100755 (executable)
@@ -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
 
 
 
 
+#
+# 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}
index fa9068dcea2218129db512237ec4fffb202bfc48..b3ddaa1a8f0690b17f81165fb9b1b3064f44649a 100755 (executable)
@@ -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}"
index 44c3f6646b770e87144b6f9762dd2e10d12c2e6f..b49ca62f3220e608ff038ea30e32b99cdc6d65c6 100644 (file)
@@ -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 <barninger at fairfieldcomputers.com>
  # Added LSB init info 10/14/2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
  #
-+# 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
index c4d17bb90395cc04f926ddb0fe8df47c10a78bd9..b583d043bd87bcef1b4c481e85a66447e757773a 100755 (executable)
@@ -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.
 # Added LSB init info 10/14/2004 D. Scott Barninger <barninger at fairfieldcomputers.com>
 #
 ### 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
index 562488f707e53359d53a5c36483d6bec18280ae3..8016395416bb353c560b8455f03d7f34bdfbb89b 100644 (file)
@@ -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)
index 7ee767b133fb6ded05e9289d07d1d6ee9ce70df3..77f9bfc41978b611be3907261523e1fa4e970419 100644 (file)
@@ -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
index 88753cf6961a975c0fb9a1e97f0935c346312650..52a8606f750a18105f98fb093ed801f81f8a26f4 100644 (file)
@@ -4,13 +4,14 @@
 #
 
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
 if $bindir/mysql $* -f <<END-OF-DATA
-CREATE DATABASE bacula;
+CREATE DATABASE ${db_name};
 END-OF-DATA
 then
-   echo "Creation of bacula database succeeded."
+   echo "Creation of ${db_name} database succeeded."
 else
-   echo "Creation of bacula database failed."
+   echo "Creation of ${db_name} database failed."
 fi
 exit 0
index 8ee437d85f695d74a59819fb44857e30d7fc5b99..5b82375c887c867db7524fc5576be9d1186fae37 100644 (file)
@@ -4,6 +4,7 @@
 #
 
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
 # use SQL_ASCII to be able to put any filename into
 #  the database even those created with unusual character sets
@@ -15,12 +16,12 @@ ENCODING="ENCODING 'SQL_ASCII'"
      
 
 if $bindir/psql -f - -d template1 $* <<END-OF-DATA
-CREATE DATABASE bacula $ENCODING;
-ALTER DATABASE bacula SET datestyle TO 'ISO, YMD';
+CREATE DATABASE ${db_name} $ENCODING;
+ALTER DATABASE ${db_name} SET datestyle TO 'ISO, YMD';
 END-OF-DATA
 then
-   echo "Creation of bacula database succeeded."
+   echo "Creation of ${db_name} database succeeded."
 else
-   echo "Creation of bacula database failed."
+   echo "Creation of ${db_name} database failed."
 fi
 exit 0
index 3d7ba64644ef2f4be479442b1f7d6cbee13856e2..89802f043f9ab9914b83fd9f2123e121c41ca0e3 100644 (file)
@@ -4,8 +4,9 @@
 
 bindir=@SQL_BINDIR@
 cd @working_dir@
-sqlite=@DB_NAME@
+sqlite=@DB_TYPE@
+db_name=@db_name@
 
-${bindir}/${sqlite} $* bacula.db <<END-OF-DATA
+${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
 END-OF-DATA
 exit 0
index 5b3a6401e6b73442f086b1d70b75bcd999fb3d9c..e23d06eee28747f6277b2b81f9d9a13a3f490c63 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/sh
 #
 # shell script to create Bacula SQLite tables
+db_name=@db_name@
 
-touch @working_dir@/bacula.db
+touch @working_dir@/${db_name}.db
 exit 0
index afeeb7985ebd5f3a02d2bc6af0a1da98c6a8ebb0..20647373d38451a8ef1dba92ad0c72a52b0964d3 100755 (executable)
@@ -2,4 +2,6 @@
 #
 # This script deletes a catalog dump
 #
-rm -f @working_dir@/bacula.sql
+db_name=@db_name@
+
+rm -f @working_dir@/${db_name}.sql
index d77908c162272ff0e2687ae1a9d1464d584d1b0e..89dd7c8c887f16c8fa677a59080579082372a2b0 100755 (executable)
@@ -3,10 +3,10 @@
 #  Drop Bacula database -- works for whatever is configured,
 #    MySQL, SQLite, PostgreSQL
 #
-if test xsqlite = x@DB_NAME@ -o xsqlite3 = x@DB_NAME@ ; then
-  @scriptdir@/drop_@DB_NAME@_database $*
+if test xsqlite = x@DB_TYPE@ -o xsqlite3 = x@DB_TYPE@ ; then
+  @scriptdir@/drop_@DB_TYPE@_database $*
 else
-  if test xmysql = x@DB_NAME@ ; then 
+  if test xmysql = x@DB_TYPE@ ; then 
     echo "Making MySQL database"
     @scriptdir@/drop_mysql_database $*
   else
index 3707765cc92d8ee38f8cefd3b0582c2e0bb74f81..6ae1003a34dda5855f0e6611e6900b099abd8c76 100755 (executable)
@@ -3,11 +3,11 @@
 #  Drop Bacula tables -- works for whatever is configured,
 #    MySQL, SQLite, or PostgreSQL
 #
-if test xsqlite = x@DB_NAME@ -o xsqlite3 = x@DB_NAME@ ; then
-  @scriptdir@/drop_@DB_NAME@_tables $*
+if test xsqlite = x@DB_TYPE@ -o xsqlite3 = x@DB_TYPE@ ; then
+  @scriptdir@/drop_@DB_TYPE@_tables $*
   echo "Dropped SQLite tables"
 else
-  if test xmysql = x@DB_NAME@ ; then 
+  if test xmysql = x@DB_TYPE@ ; then 
     echo "Making MySQL tables"
     @scriptdir@/drop_mysql_tables $*
     echo "Dropped MySQL tables"
index aa447bc3bf6deaf65ee540c8ec718fe07316d2d0..e91818c033e9a045352915b2314eda8b7f800d8e 100644 (file)
@@ -4,15 +4,16 @@
 #
 
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-if test xmysql = x@DB_NAME@ ; then 
+if test xmysql = x@DB_TYPE@ ; then 
   $bindir/mysql $* -f <<END-OF-DATA
-    DROP DATABASE bacula;
+    DROP DATABASE ${db_name};
 END-OF-DATA
   if test $? -eq 0 ; then
-    echo "Drop of bacula database succeeded."
+    echo "Drop of ${db_name} database succeeded."
   else
-    echo "Drop of bacula database failed."
+    echo "Drop of ${db_name} database failed."
   fi
 else
   echo "Bacula is not configured for a MySQL database."
index fbe87274075011c8fa8e5a3d4e5e91e5aa292eb5..e291759cbde6bb78708a1a4baae027e3ba363eef 100644 (file)
@@ -3,9 +3,10 @@
 # shell script to delete Bacula tables for MySQL
 
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
 if $bindir/mysql $* <<END-OF-DATA
-USE bacula;
+USE ${db_name};
 DROP TABLE IF EXISTS Filename;
 DROP TABLE IF EXISTS Path;
 DROP TABLE IF EXISTS LongName;
@@ -33,8 +34,8 @@ DROP TABLE IF EXISTS Location;
 DROP TABLE IF EXISTS LocationLog;
 END-OF-DATA
 then
-   echo "Deletion of Bacula MySQL tables succeeded."
+   echo "Deletion of ${db_name} MySQL tables succeeded."
 else
-   echo "Deletion of Bacula MySQL tables failed."
+   echo "Deletion of ${db_name} MySQL tables failed."
 fi
 exit 0
index bb4a1499aeff052c2e54c913f888c710fea2a4ef..3fe920cd0cf2c1bb0bc1b0dd3d17a541c8b6a23e 100644 (file)
@@ -4,11 +4,12 @@
 #
 
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-if $bindir/dropdb bacula
+if $bindir/dropdb ${db_name}
 then
-   echo "Drop of bacula database succeeded."
+   echo "Drop of ${db_name} database succeeded."
 else
-   echo "Drop of bacula database failed."
+   echo "Drop of ${db_name} database failed."
 fi
 exit 0
index ab5f59a1375eb6780221f214fd162ac4546d19ac..a0da7e391ea4507da4ae122ae5d9f989e4289b34 100644 (file)
@@ -3,8 +3,9 @@
 # shell script to delete Bacula tables for PostgreSQL
 
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-$bindir/psql -f - -d bacula $* <<END-OF-DATA
+$bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 drop table unsavedfiles;
 drop table basefiles;
 drop table jobmedia;
index 4af81af0ba92f24865a8462f79124f83c7f0f4f3..b405a7b46a9c83b2e9c0d8d71f2db2f9e0bc187a 100644 (file)
@@ -1,10 +1,12 @@
 #!/bin/sh
 #
 # shell script to drop Bacula SQLite tables
+db_name=@db_name@
 
-if test xsqlite = x@DB_NAME@ -o xsqlite3 = x@DB_NAME@ ; then 
+
+if test xsqlite = x@DB_TYPE@ -o xsqlite3 = x@DB_TYPE@ ; then 
   cd @working_dir@
-  rm -rf bacula.db
+  rm -rf ${db_name}.db
   echo "SQLite database dropped."
 else
   echo "Bacula is not configured for an SQLite database."
index 1365db6f5d81a67f733adab1721069327dd68f96..9cd8d39b33fe341b914ed3c92904cec396f1014b 100644 (file)
@@ -3,5 +3,6 @@
 # shell script to Delete the SQLite Bacula database (same as deleting 
 #  the tables)
 #
+db_name=@db_name@
 
-rm -f @working_dir@/bacula.db
+rm -f @working_dir@/${db_name}.db
index 4af81af0ba92f24865a8462f79124f83c7f0f4f3..b405a7b46a9c83b2e9c0d8d71f2db2f9e0bc187a 100644 (file)
@@ -1,10 +1,12 @@
 #!/bin/sh
 #
 # shell script to drop Bacula SQLite tables
+db_name=@db_name@
 
-if test xsqlite = x@DB_NAME@ -o xsqlite3 = x@DB_NAME@ ; then 
+
+if test xsqlite = x@DB_TYPE@ -o xsqlite3 = x@DB_TYPE@ ; then 
   cd @working_dir@
-  rm -rf bacula.db
+  rm -rf ${db_name}.db
   echo "SQLite database dropped."
 else
   echo "Bacula is not configured for an SQLite database."
index 87fe38fdaf9b5053945907db1b398581c85953b1..f966f875defb066166e5cfb637fc687f3a6157b7 100644 (file)
@@ -3,6 +3,7 @@
 # shell script to Delete the SQLite tables, we simply delete and recreate
 #  the database.
 #
+db_name=@db_name@
 
-rm -f @working_dir@/bacula.db
-touch @working_dir@/bacula.db
+rm -f @working_dir@/${db_name}.db
+touch @working_dir@/${db_name}.db
index b064553c14d0ed325c9162ae4166aacaa30aa8c0..5e9f4e735f1d985f5f66e7fb42f7b47a15e09be5 100755 (executable)
@@ -4,17 +4,17 @@
 #  Bacula tables for PostgreSQL or MySQL.
 # SQLite does not have permissions.
 #
-if test xmysql = x@DB_NAME@ ; then 
+if test xmysql = x@DB_TYPE@ ; then 
   echo "Granting MySQL privileges"
   @scriptdir@/grant_mysql_privileges $*
 else
-  if test xpostgresql = x@DB_NAME@ ; then 
+  if test xpostgresql = x@DB_TYPE@ ; then 
     echo "Granting PostgreSQL privileges"
     @scriptdir@/grant_postgresql_privileges $*
   else
-    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 "Granting SQLite privileges"
-      @scriptdir@/grant_@DB_NAME@_privileges $*
+      @scriptdir@/grant_@DB_TYPE@_privileges $*
     fi
   fi
 fi
index aeafd65f1c32b6bcb44cc710708b1bf8ec339753..bf89fe060ad3a567daad37078498bb1209bfb4c2 100644 (file)
@@ -2,18 +2,19 @@
 #
 # shell script to grant privileges to the bacula database
 #
-USER=bacula
+USER=@db_user@
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
 if $bindir/mysql $* -u root -f <<END-OF-DATA
 use mysql
-grant all privileges on bacula.* to ${USER}@localhost;
-grant all privileges on bacula.* to ${USER}@"%";
+grant all privileges on ${db_name}.* to ${USER}@localhost;
+grant all privileges on ${db_name}.* to ${USER}@"%";
 select * from user;
 flush privileges;
 END-OF-DATA
 then
-   echo "Privileges for ${USER} granted."
+   echo "Privileges for ${USER} granted on ${db_name}."
    exit 0
 else
    echo "Error creating privileges."
index 20039116336841219f0a95fc93711731fbf30f11..ab582e859f1929a88dc0cc143027079b01c6cf82 100644 (file)
@@ -2,10 +2,11 @@
 #
 # shell script to grant privileges to the bacula database
 #
-USER=bacula
+USER=@db_user@
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-if $bindir/psql -f - -d bacula $* <<END-OF-DATA
+if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 
 create user ${USER};
 
@@ -53,7 +54,7 @@ grant select, update on log_logid_seq            to ${USER};
 
 END-OF-DATA
 then
-   echo "Privileges for ${USER} granted."
+   echo "Privileges for ${USER} granted on ${db_name}."
    exit 0
 else
    echo "Error creating privileges."
index a71462d2308e5b6163160b2632d12835a2b1911f..0c6dd12eb6663df175f0fdacf809c59953c128e5 100755 (executable)
@@ -3,11 +3,11 @@
 # This routine makes the appropriately configured
 #  Bacula tables for 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 "Making SQLite tables"
-  @scriptdir@/make_@DB_NAME@_tables $*
+  @scriptdir@/make_@DB_TYPE@_tables $*
 else
-  if test xmysql = x@DB_NAME@ ; then 
+  if test xmysql = x@DB_TYPE@ ; then 
     echo "Making MySQL tables"
     @scriptdir@/make_mysql_tables $*
   else
index 1a5d2370b85ff8dcedaaa868f62e8521b69bcbd5..8d638113204e9adf8267b0bdfc67dde521c292cb 100755 (executable)
 BINDIR=@SQL_BINDIR@
 
 cd @working_dir@
-rm -f bacula.sql
-if test xsqlite = x@DB_NAME@ ; then
+rm -f $1.sql
+if test xsqlite = x@DB_TYPE@ ; then
   echo ".dump" | ${BINDIR}/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
       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
index 2706746ca3345291cf5dac6b5c7d4e8c0f1fcaee..7279dc005b5e1bf49e4c6a77bdd08f2be6a5f802 100644 (file)
@@ -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
index 0c1ce16324ca4d61c60392cd4ccbe1b6de53e3be..513e5da2c472afc95dbf90ed2f9cea1f53ffcc0b 100644 (file)
@@ -3,9 +3,10 @@
 # shell script to create Bacula MySQL tables
 #
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
 if $bindir/mysql $* -f <<END-OF-DATA
-USE bacula;
+USE ${db_name};
 --
 -- Note, we use BLOB rather than TEXT because in MySQL,
 --  BLOBs are identical to TEXT except that BLOB is case
index 6f24d6b377c2ccb5ba9efe51aaf7808a36322c63..70aee44084cb5e2f9fc10a175242d2f74e00bb61 100644 (file)
@@ -3,8 +3,9 @@
 # shell script to create Bacula PostgreSQL tables
 #
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-$bindir/psql -f - -d bacula $* <<END-OF-DATA
+$bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 
 CREATE TABLE filename
 (
index 9fcbb6c6c8e14bbf5bbcb1ef24136cd44cafa6f1..813cce2601d114f900803d4aa66ab14b4bcbe433 100644 (file)
@@ -4,9 +4,10 @@
 
 bindir=@SQL_BINDIR@
 cd @working_dir@
-sqlite=@DB_NAME@
+sqlite=@DB_TYPE@
+db_name=@db_name@
 
-${bindir}/${sqlite} $* bacula.db <<END-OF-DATA
+${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
 CREATE TABLE Filename (
   FilenameId INTEGER,
   Name TEXT DEFAULT "",
@@ -357,5 +358,5 @@ PRAGMA default_cache_size = 10000;
 
 END-OF-DATA
 
-chmod 640 bacula.db
+chmod 640 ${db_name}.db
 exit 0
index 9fcbb6c6c8e14bbf5bbcb1ef24136cd44cafa6f1..813cce2601d114f900803d4aa66ab14b4bcbe433 100644 (file)
@@ -4,9 +4,10 @@
 
 bindir=@SQL_BINDIR@
 cd @working_dir@
-sqlite=@DB_NAME@
+sqlite=@DB_TYPE@
+db_name=@db_name@
 
-${bindir}/${sqlite} $* bacula.db <<END-OF-DATA
+${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
 CREATE TABLE Filename (
   FilenameId INTEGER,
   Name TEXT DEFAULT "",
@@ -357,5 +358,5 @@ PRAGMA default_cache_size = 10000;
 
 END-OF-DATA
 
-chmod 640 bacula.db
+chmod 640 ${db_name}.db
 exit 0
index 094e3b28b47a6177fa3362c9026a739138d450a7..c3c62ff1e34a0f10fb780c0a06d53c7ec583a220 100644 (file)
@@ -3,5 +3,6 @@
 # shell script to create Bacula MySQL tables
 #
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-$bindir/mysql $* bacula
+$bindir/mysql $* ${db_name}
index 39c3fe6bfb976ad3ae0a0fc841ae799e60bfa5d7..46fdeabe749b6db2a326c6f50f7c49934cd817a3 100644 (file)
@@ -3,5 +3,6 @@
 # shell script to create Bacula PostgreSQL tables
 #
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-$bindir/psql $* bacula
+$bindir/psql $* ${db_name}
index 89160b5e9fa9057275db550d6f86f72e24a37234..40121544fd12c83ddfa933301688ba0531237f55 100644 (file)
@@ -3,4 +3,5 @@
 # shell script to invoke SQLite on Bacula database
 
 bindir=@SQL_BINDIR@
-$bindir/sqlite @working_dir@/bacula.db
+db_name=@db_name@
+$bindir/sqlite @working_dir@/${db_name}.db
index d640da17c31f67d0833e73c3873dbc834b1b051f..1e7edbadd30d3c06481ef26980e0b43b94cb8a32 100755 (executable)
@@ -3,15 +3,15 @@
 # This routine alters the appropriately configured
 #  Bacula tables for 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 "Altering SQLite tables"
-  @scriptdir@/update_@DB_NAME@_tables $*
+  @scriptdir@/update_@DB_TYPE@_tables $*
 fi
-if test xmysql = x@DB_NAME@ ; then
+if test xmysql = x@DB_TYPE@ ; then
   echo "Altering MySQL tables"
   @scriptdir@/update_mysql_tables $*
 fi
-if test xpostgresql = x@DB_NAME@ ; then
+if test xpostgresql = x@DB_TYPE@ ; then
   echo "Altering PostgreSQL tables"
   @scriptdir@/update_postgresql_tables $*
 fi
index 6ce5469c7669caf31d0d297f493d734fc3390b32..ce2fd2a62e8827e67205b47fb4fac53653fc3567 100755 (executable)
@@ -9,9 +9,10 @@ echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 echo " "
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
 if $bindir/mysql $* -f <<END-OF-DATA
-USE bacula;
+USE ${db_name};
 
 DROP TABLE IF EXISTS MAC;
 DROP TABLE IF EXISTS Log;
index e6149ae54d9c276649f25c9d49b91a3b12fa65bf..97ecee2650bce3c55cffc0729fd966a21441b8a1 100755 (executable)
@@ -9,8 +9,9 @@ echo "Depending on the size of your database,"
 echo "this script may take several minutes to run."
 echo " "
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-if $bindir/psql -f - -d bacula $* <<END-OF-DATA
+if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 
 ALTER TABLE media ADD COLUMN DeviceId integer;
 UPDATE media SET DeviceId=0;
index 7712d35a5592e634e00533eff681c17aa4187de5..852859554a48b8ad305854162a82a0d02aed9080 100755 (executable)
@@ -11,9 +11,10 @@ echo " "
 
 bindir=@SQL_BINDIR@
 cd @working_dir@
-sqlite=@DB_NAME@
+sqlite=@DB_TYPE@
+db_name=@db_name@
 
-${bindir}/${sqlite} $* bacula.db <<END-OF-DATA
+${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
 BEGIN TRANSACTION;
 
 CREATE TEMPORARY TABLE Media_backup (
index 7712d35a5592e634e00533eff681c17aa4187de5..852859554a48b8ad305854162a82a0d02aed9080 100755 (executable)
@@ -11,9 +11,10 @@ echo " "
 
 bindir=@SQL_BINDIR@
 cd @working_dir@
-sqlite=@DB_NAME@
+sqlite=@DB_TYPE@
+db_name=@db_name@
 
-${bindir}/${sqlite} $* bacula.db <<END-OF-DATA
+${bindir}/${sqlite} $* ${db_name}.db <<END-OF-DATA
 BEGIN TRANSACTION;
 
 CREATE TEMPORARY TABLE Media_backup (
index a06ff14a2a75bcff2575202533e1d63c68c9c6d9..2c6cc1ebbf274971386457c9994717906fa73311 100644 (file)
@@ -1,5 +1,5 @@
---- update_sqlite_tables.in    2006-08-05 10:20:06.000000000 -0400
-+++ update_sqlite_tables.in.fixed      2006-08-05 10:18:23.000000000 -0400
+--- update_sqlite_tables.in     2006-08-05 10:20:06.000000000 -0400
++++ update_sqlite_tables.in.fixed       2006-08-05 10:18:23.000000000 -0400
 @@ -9,7 +9,7 @@
  echo "this script may take several minutes to run."
  echo " "
@@ -7,5 +7,5 @@
 -bindir=@SQL_BINDIR@
 +bindir=/usr/lib/bacula/sqlite
  cd @working_dir@
- sqlite=@DB_NAME@
+ sqlite=@DB_TYPE@
  
index 2a5f4356ef853291b150ef913bb4600ddaebbd68..e4abd5bee4be45e17512c18e60b8e105c037de49 100644 (file)
@@ -227,7 +227,7 @@ Storage {
 # Generic catalog service
 Catalog {
   Name = MyCatalog
-  dbname = bacula; user = bacula; password = ""
+  dbname = @db_name@; user = @db_user@; password = ""
 }
 
 # Reasonable message delivery -- send most everything to email address
index 733b8dcfc1cf0d83707712f4d5ee8825d821c491..4f2e337100e6597df8871987024b86a87db1abc3 100644 (file)
@@ -959,5 +959,7 @@ static bool check_catalog()
       }
       db_close_database(NULL, db);
    }
+   /* Set type in global for debugging */
+   set_db_type(db_get_type());
    return OK;
 }
index e4cef4e6ac1a5f005b7117d59c7443eba21a5940..028d68f9580a016b1a07334d861c278eee2ba5a0 100644 (file)
@@ -1,11 +1,3 @@
-/*
- * Bacula message handling routines
- *
- *   Kern Sibbald, April 2000
- *
- *   Version $Id$
- *
- */
 /*
    Bacula® - The Network Backup Solution
 
@@ -163,11 +155,9 @@ get_db_type(void)
 void
 set_db_type(const char *name)
 {
-   if (catalog_db != NULL)
-   {
+   if (catalog_db != NULL) {
       free(catalog_db);
    }
-
    catalog_db = bstrdup(name);
 }
 
index de121260b9dd8cb9f8820e7d1b96d98f5056fad3..a3582099438ad48a723f1d9fb98edbb477fb06df 100644 (file)
@@ -86,7 +86,7 @@ bool       bnet_sig              (BSOCK *bs, int sig);
 bool       bnet_tls_server       (TLS_CONTEXT *ctx, BSOCK *bsock,
                                   alist *verify_list);
 bool       bnet_tls_client       (TLS_CONTEXT *ctx, BSOCK *bsock,
-                                 alist *verify_list);
+                                  alist *verify_list);
 BSOCK *    bnet_connect          (JCR *jcr, int retry_interval,
                utime_t max_retry_time, const char *name, char *host, char *service,
                int port, int verbose);
@@ -223,6 +223,7 @@ void       init_console_msg      (const char *wd);
 void       free_msgs_res         (MSGS *msgs);
 void       dequeue_messages      (JCR *jcr);
 void       set_trace             (int trace_flag);
+void       set_db_type           (const char *name);
 
 /* bnet_server.c */
 void       bnet_thread_server(dlist *addr, int max_clients, workq_t *client_wq,
index 42c5c5b7fcca95845ae080c60c8ac5f9b94907d9..dee01dbcdbc0e60a22873b08246bb00ee2c2bd74 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "2.1.6"
-#define BDATE   "28 March 2007"
-#define LSMDATE "28Mar07"
+#define BDATE   "30 March 2007"
+#define LSMDATE "30Mar07"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2007"       /* year for copyright messages in progs */
index 3face52a51aa9613f5019ee253365db65333eeea..aa6c8c493a954a25efbb1dad878f02e50e5efda8 100644 (file)
@@ -1,6 +1,10 @@
               Technical notes on version 2.1
 
 General:
+30Mar07
+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.
 29Mar07
 kes  Implement dir_sql() which issues an SQL query.
 kes  Modify bat medialist to use dir_sql() and do some minor C++