scripts/mtx-changer \
scripts/disk-changer \
scripts/dvd-handler \
+ scripts/dvd-simulator \
scripts/bacula-tray-monitor.desktop \
scripts/logwatch/Makefile \
scripts/logwatch/logfile.bacula.conf \
cd scripts
chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
-chmod 755 dvd-handler
+chmod 755 dvd-handler dvd-simulator
chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
cd ..
if test -f $python_root/include/python2.2/Python.h; then
PYTHON_INCDIR=-I$python_root/include/python2.2
if test -d $python_root/lib64/python2.2/config; then
- PYTHON_LIBS="-L$python_root/lib64/python2.2/config -lpython2.2"
- else
- PYTHON_LIBS="-L$python_root/lib/python2.2/config -lpython2.2"
- fi
+ PYTHON_LIBS="-L$python_root/lib64/python2.2/config -lpython2.2"
+ else
+ PYTHON_LIBS="-L$python_root/lib/python2.2/config -lpython2.2"
+ fi
break
elif test -f $python_root/include/python2.3/Python.h; then
PYTHON_INCDIR=-I$python_root/include/python2.3
if test -d $python_root/lib64/python2.3/config; then
- PYTHON_LIBS="-L$python_root/lib64/python2.3/config -lpython2.3"
- else
- PYTHON_LIBS="-L$python_root/lib/python2.3/config -lpython2.3"
- fi
+ PYTHON_LIBS="-L$python_root/lib64/python2.3/config -lpython2.3"
+ else
+ PYTHON_LIBS="-L$python_root/lib/python2.3/config -lpython2.3"
+ fi
break
elif test -f $python_root/include/python2.4/Python.h; then
PYTHON_INCDIR=-I$python_root/include/python2.4
if test -d $python_root/lib64/python2.4/config; then
- PYTHON_LIBS="-L$python_root/lib64/python2.4/config -lpython2.4"
- else
- PYTHON_LIBS="-L$python_root/lib/python2.4/config -lpython2.4"
- fi
+ PYTHON_LIBS="-L$python_root/lib64/python2.4/config -lpython2.4"
+ else
+ PYTHON_LIBS="-L$python_root/lib/python2.4/config -lpython2.4"
+ fi
break
fi
done
if test -f $prefix/include/Python.h; then
PYTHON_INCDIR=-I$prefix/include
if test -d $prefix/lib64/config; then
- PYTHON_LIBS="-L$prefix/lib64/config -lpython"
- else
- PYTHON_LIBS="-L$prefix/lib/config -lpython"
- fi
+ PYTHON_LIBS="-L$prefix/lib64/config -lpython"
+ else
+ PYTHON_LIBS="-L$prefix/lib/config -lpython"
+ fi
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
elif test -f $withval/include/postgresql/libpq-fe.h; then
POSTGRESQL_INCDIR=$withval/include/postgresql
if test -d $withval/lib64; then
- POSTGRESQL_LIBDIR=$withval/lib64
+ POSTGRESQL_LIBDIR=$withval/lib64
else
- POSTGRESQL_LIBDIR=$withval/lib
+ POSTGRESQL_LIBDIR=$withval/lib
fi
POSTGRESQL_BINDIR=$withval/bin
else
fi
fi
SQL_INCLUDE=-I$MYSQL_INCDIR
- if test -f $MYSQL_LIBDIR/libmysqlclient_r.a; then
+ if test -f "$MYSQL_LIBDIR/libmysqlclient_r.a"; then
SQL_LFLAGS="-L$MYSQL_LIBDIR -lmysqlclient_r -lz"
cat >>confdefs.h <<\_ACEOF
#define HAVE_THREAD_SAFE_MYSQL 1
/usr/openwin/share/include'
if test "$ac_x_includes" = no; then
- # Guess where to find include files, by looking for Xlib.h.
+ # Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
sed 's/^/| /' conftest.$ac_ext >&5
for ac_dir in $ac_x_header_dirs; do
- if test -r "$ac_dir/X11/Xlib.h"; then
+ if test -r "$ac_dir/X11/Intrinsic.h"; then
ac_x_includes=$ac_dir
break
fi
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
int
main ()
{
-XrmInitialize ()
+XtMalloc (0)
;
return 0;
}
DISTVER=`uname -a |awk '{print $3}'`
VER=`echo $DISTVER | cut -c 1`
if test x$VER = x4 ; then
- PTHREAD_LIB="${PTHREAD_LIBS}"
- CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
+ PTHREAD_LIB="${PTHREAD_LIBS:--pthread}"
+ CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS:--pthread}"
fi
lld="qd"
llu="qu"
exit 1
fi
- ac_config_files="$ac_config_files autoconf/Make.common Makefile manpages/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf scripts/wxconsole.console_apps scripts/wxconsole.desktop.consolehelper scripts/wxconsole.desktop.xsu src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/pygtk-console/Makefile src/tools/Makefile po/Makefile.in $PFILES"
+ ac_config_files="$ac_config_files autoconf/Make.common Makefile manpages/Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/dvd-simulator scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf scripts/wxconsole.console_apps scripts/wxconsole.desktop.consolehelper scripts/wxconsole.desktop.xsu src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/pygtk-console/Makefile src/tools/Makefile po/Makefile.in $PFILES"
ac_config_commands="$ac_config_commands default"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
"scripts/mtx-changer" ) CONFIG_FILES="$CONFIG_FILES scripts/mtx-changer" ;;
"scripts/disk-changer" ) CONFIG_FILES="$CONFIG_FILES scripts/disk-changer" ;;
"scripts/dvd-handler" ) CONFIG_FILES="$CONFIG_FILES scripts/dvd-handler" ;;
+ "scripts/dvd-simulator" ) CONFIG_FILES="$CONFIG_FILES scripts/dvd-simulator" ;;
"scripts/bacula-tray-monitor.desktop" ) CONFIG_FILES="$CONFIG_FILES scripts/bacula-tray-monitor.desktop" ;;
"scripts/logwatch/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/logwatch/Makefile" ;;
"scripts/logwatch/logfile.bacula.conf" ) CONFIG_FILES="$CONFIG_FILES scripts/logwatch/logfile.bacula.conf" ;;
cd scripts
chmod 755 startmysql stopmysql bacula startit stopit btraceback mtx-changer
-chmod 755 dvd-handler
+chmod 755 dvd-handler dvd-simulator
chmod 755 bconsole gconsole mtx-changer devel_bacula logrotate
cd ..
gconsole
mtx-changer
dvd-handler
+dvd-simulator
Makefile
bacula
btraceback
#include "stored.h" /* pull in Storage Deamon headers */
/* Forward referenced functions */
-static void detach_dcr_from_dev(DCR *dcr);
+static void attach_dcr_to_dev(DCR *dcr);
/*********************************************************************
jcr->read_dcr = dcr;
dcr->device = new_dcr->device;
dcr->max_job_spool_size = dcr->device->max_job_spool_size;
- if (dev->fd != 0 && jcr && jcr->JobType != JT_SYSTEM) {
- dev->attached_dcrs->append(dcr); /* attach dcr to device */
- }
+ attach_dcr_to_dev(dcr);
new_dcr->VolumeName[0] = 0;
free_dcr(new_dcr);
dev->block(BST_DOING_ACQUIRE);
dcr->block = new_block(dev);
dcr->rec = new_record();
dcr->max_job_spool_size = dev->device->max_job_spool_size;
- /* Attach this dcr only if dev is initialized */
- if (dev->fd != 0 && jcr && jcr->JobType != JT_SYSTEM) {
- dev->attached_dcrs->append(dcr); /* attach dcr to device */
-// jcr->dcrs->append(dcr); /* put dcr in list for Job */
- }
+ attach_dcr_to_dev(dcr);
}
dcr->spool_fd = -1;
return dcr;
}
#endif
-static void detach_dcr_from_dev(DCR *dcr)
+static void attach_dcr_to_dev(DCR *dcr)
+{
+ DEVICE *dev = dcr->dev;
+ JCR *jcr = dcr->jcr;
+
+ if (!dcr->attached_to_dev && dev->is_open() && jcr && jcr->JobType != JT_SYSTEM) {
+ dev->attached_dcrs->append(dcr); /* attach dcr to device */
+ dcr->attached_to_dev = true;
+ }
+}
+
+void detach_dcr_from_dev(DCR *dcr)
{
DEVICE *dev = dcr->dev;
unlock_device(dev);
}
- /* Detach this dcr only if the dev is initialized */
- if (dcr->dev->fd != 0 && dcr->jcr && dcr->jcr->JobType != JT_SYSTEM) {
+ /* Detach this dcr only if attached */
+ if (dcr->attached_to_dev) {
dcr->dev->attached_dcrs->remove(dcr); /* detach dcr from device */
+ dcr->attached_to_dev = false;
// remove_dcr_from_dcrs(dcr); /* remove dcr from jcr list */
}
free_unused_volume(dcr); /* free unused vols attached to this dcr */
int InChanger;
POOL_MEM VolumeName;
+ /* If system job, do not update catalog */
+ if (jcr->JobType == JT_SYSTEM) {
+ return true;
+ }
+
if (vol->VolCatName[0] == 0) {
Jmsg0(jcr, M_FATAL, 0, _("NULL Volume name. This shouldn't happen!!!\n"));
Pmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n"));
JCR *jcr = dcr->jcr;
BSOCK *dir = jcr->dir_bsock;
+ /* If system job, do not update catalog */
+ if (jcr->JobType == JT_SYSTEM) {
+ return true;
+ }
+
if (!dcr->WroteVol) {
return true; /* nothing written to tape */
}
/* Create JobMedia record */
mjcr->read_dcr->VolLastIndex = dcr->VolLastIndex;
create_jobmedia_record(db, mjcr);
- dev->attached_dcrs->remove(mjcr->read_dcr);
+ detach_dcr_from_dev(mjcr->read_dcr);
free_jcr(mjcr);
break;
bool NewFile; /* set when EOF written */
bool reserved_device; /* set if reserve done */
bool any_volume; /* Any OK for dir_find_next... */
+ bool attached_to_dev; /* set when attached to dev */
uint32_t VolFirstIndex; /* First file index this Volume */
uint32_t VolLastIndex; /* Last file index this Volume */
uint32_t FileIndex; /* Current File Index */
DEVICE *dev = dcr->dev;
POOL_MEM archive_name(PM_FNAME);
- dev->clear_freespace_ok(); /* need to update freespace */
-
/* Don't write empty part files.
* This is only useful when growisofs does not support write beyond
* the 4GB boundary.
int timeout;
char ed1[50];
+ dev->clear_freespace_ok(); /* need to update freespace */
+
sm_check(__FILE__, __LINE__, false);
Dmsg3(29, "dvd_write_part: device is %s, part is %d, is_mounted=%d\n", dev->print_name(), dev->part, dev->is_mounted());
icmd = dev->device->write_part_command;
{
DEVICE* dev = dcr->dev;
+ dev->clear_freespace_ok(); /* need to update freespace */
dev->close_part(dcr);
if (!unmount_dvd(dev, 1)) {
bool release_device(DCR *dcr);
DCR *new_dcr(JCR *jcr, DEVICE *dev);
void free_dcr(DCR *dcr);
+void detach_dcr_from_dev(DCR *dcr);
/* From askdir.c */
enum get_vol_info_rw {
#undef VERSION
#define VERSION "1.39.23"
-#define BDATE "13 September 2006"
-#define LSMDATE "13Sep06"
+#define BDATE "15 September 2006"
+#define LSMDATE "15Sep06"
#define BYEAR "2006" /* year for copyright messages in progs */
/* Debug flags */
Technical notes on version 1.39
General:
+15Sep06
+kes Put attach_dcr_to_dev in a subroutine.
+kes Make attaching/detaching to/from a device use a flag and
+ only detach if actually attached.
+kes Add dvd-simulator.in to scripts directory and add to configure.
+kes Fix code in acquire.c that checks fd != 0 to use dev->is_open().
+ This could be a cause of a number of drive reservation problems.
+ Note, this code is now in attach_dcr_to_dev().
+kes Suppress doing Volume updates if it is a system job. This should
+ prevent the DVD label blocking.
+kes Clear the freespace ok flag in a couple of strategic places.
14Sep06
kes Put removing zero sized spool part file in subroutine and
call from release_device().