$(MKDIR) $(DESTDIR)$(scriptdir)
$(MKDIR) $(DESTDIR)$(working_dir)
# $(MKDIR) $(DESTDIR)$(mandir)
+
+gnomedirs:
$(MKDIR) $(DESTDIR)/usr/share/pixmaps
$(MKDIR) $(DESTDIR)/usr/share/gnome/apps/System
$(MKDIR) $(DESTDIR)/usr/share/applications
$(MKDIR) $(DESTDIR)/etc/security/console.apps
$(MKDIR) $(DESTDIR)/etc/pam.d
- $(MKDIR) $(DESTDIR)/usr/bin
-install-menu: installdirs
+install-menu: installdirs gnomedirs
${INSTALL_DATA} scripts/bacula.png $(DESTDIR)/usr/share/pixmaps/bacula.png
${INSTALL_DATA} scripts/bacula.desktop.gnome1 $(DESTDIR)/usr/share/gnome/apps/System/bacula.desktop
${INSTALL_DATA} scripts/bacula.desktop.gnome2 $(DESTDIR)/usr/share/applications/bacula.desktop
-install-menu-xsu: installdirs
+install-menu-xsu: installdirs gnomedirs
${INSTALL_DATA} scripts/bacula.png $(DESTDIR)/usr/share/pixmaps/bacula.png
${INSTALL_DATA} scripts/bacula.desktop.gnome1.xsu $(DESTDIR)/usr/share/gnome/apps/System/bacula.desktop
${INSTALL_DATA} scripts/bacula.desktop.gnome2.xsu $(DESTDIR)/usr/share/applications/bacula.desktop
-install-menu-consolehelper: installdirs
+install-menu-consolehelper: installdirs gnomedirs
${INSTALL_DATA} scripts/bacula.png $(DESTDIR)/usr/share/pixmaps/bacula.png
${INSTALL_DATA} scripts/bacula.desktop.gnome1.consolehelper $(DESTDIR)/usr/share/gnome/apps/System/bacula.desktop
${INSTALL_DATA} scripts/bacula.desktop.gnome2.consolehelper $(DESTDIR)/usr/share/applications/bacula.desktop
${INSTALL_DATA} scripts/gnome-console.console_apps $(DESTDIR)/etc/security/console.apps/gnome-console
${INSTALL_DATA} scripts/gnome-console.pamd $(DESTDIR)/etc/pam.d/gnome-console
- ln -s /usr/bin/consolehelper $(DESTDIR)/usr/bin/gnome-console
+ ln -s $(DESTDIR)$(sbindir)/consolehelper $(DESTDIR)$(sbindir)/gnome-console
install: installdirs
@for I in $(all_subdirs); do (cd $$I; $(MAKE) DESTDIR=$(DESTDIR) $@ || exit 1); done
#define CONFIG_FILE "bacula-sd.conf"
char *configfile;
+bool forge_on = true;
static void usage()
case 'p':
ignore_label_errors = true;
+ forge_on = true;
break;
case 'v':
#define CONFIG_FILE "bacula-sd.conf"
char *configfile;
-
+bool forge_on = false;
static void usage()
{
" -d <nn> set debug level to nn\n"
" -e <file> exclude list\n"
" -i <file> include list\n"
+" -p proceed inspite of I/O errors\n"
" -V <volumes> specify Volume names (separated by |)\n"
" -? print this message\n\n");
exit(1);
init_include_exclude_files(ff);
binit(&bfd);
- while ((ch = getopt(argc, argv, "b:c:d:e:i:V:?")) != -1) {
+ while ((ch = getopt(argc, argv, "b:c:d:e:i:pV:?")) != -1) {
switch (ch) {
case 'b': /* bootstrap file */
bsr = parse_bsr(NULL, optarg);
got_inc = TRUE;
break;
+ case 'p':
+ forge_on = true;
+ break;
+
case 'V': /* Volume name */
VolumeName = optarg;
break;
Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
}
block->read_errors++;
- return 0;
+ if (!forge_on) {
+ return 0;
+ }
}
} else if (Id[3] == '2') {
unser_uint32(block->VolSessionId);
Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
}
block->read_errors++;
- return 0;
+ if (!forge_on) {
+ return 0;
+ }
}
} else {
dev->dev_errno = EIO;
Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
}
block->read_errors++;
- return 0;
+ if (!forge_on) {
+ return 0;
+ }
+ unser_uint32(block->VolSessionId);
+ unser_uint32(block->VolSessionTime);
+ bhl = BLKHDR2_LENGTH;
+ block->BlockVer = 2;
+ block->bufp = block->buf + bhl;
}
/* Sanity check */
Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
}
block->read_errors++;
- return 0;
+ if (!forge_on) {
+ return 0;
+ }
}
Dmsg1(190, "unser_block_header block_len=%d\n", block_len);
Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
}
block->read_errors++;
- return 0;
+ if (!forge_on) {
+ return 0;
+ }
}
}
return 1;
dev->dev_errno = EIO;
Jmsg(jcr, M_ERROR, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
dcr->VolCatInfo.VolCatName, jcr->Job);
- return 0;
+ if (!forge_on) {
+ return 0;
+ }
}
dev->file_size = 0; /* reset file size */
/*
#define CONFIG_FILE "bacula-sd.conf"
char *configfile;
+bool forge_on = false;
static FF_PKT ff;
case 'p':
ignore_label_errors = true;
+ forge_on = true;
break;
case 'v':
#define CONFIG_FILE "bacula-sd.conf"
char *configfile;
-
+bool forge_on = false;
static void usage()
" -m update media info in database\n"
" -n <name> specify the database name (default bacula)\n"
" -u <user> specify database user name (default bacula)\n"
-" -p <password specify database password (default none)\n"
+" -P <password specify database password (default none)\n"
" -h <host> specify database host (default NULL)\n"
+" -p proceed inspite of I/O errors\n"
" -r list records\n"
" -s synchronize or store in database\n"
" -v verbose\n"
init_msg(NULL, NULL);
- while ((ch = getopt(argc, argv, "b:c:d:h:mn:p:rsu:vV:w:?")) != -1) {
+ while ((ch = getopt(argc, argv, "b:c:d:h:mn:pP:rsu:vV:w:?")) != -1) {
switch (ch) {
case 'b':
bsr = parse_bsr(NULL, optarg);
db_user = optarg;
break;
- case 'p':
+ case 'P':
db_password = optarg;
break;
+ case 'p':
+ forge_on = true;
+ break;
+
case 'r':
list_records = 1;
break;
char buf[100000];
int bsize = TAPE_BSIZE;
char VolName[MAX_NAME_LENGTH];
+bool forge_on = false;
/*
* If you change the format of the state file,
my_name_is(margc, margv, "btape");
init_msg(NULL, NULL);
- while ((ch = getopt(margc, margv, "b:c:d:sv?")) != -1) {
+ while ((ch = getopt(margc, margv, "b:c:d:psv?")) != -1) {
switch (ch) {
case 'b': /* bootstrap file */
bsr = parse_bsr(NULL, optarg);
}
break;
+ case 'p':
+ forge_on = true;
+ break;
+
case 's':
signals = FALSE;
break;
" -b <file> specify bootstrap file\n"
" -c <file> set configuration file to file\n"
" -d <nn> set debug level to nn\n"
+" -p proceed inspite of I/O errors\n"
" -s turn off signals\n"
" -v be verbose\n"
" -? print this message.\n"
}
if (!ok) {
free_record(record);
- if (jcr->ignore_label_errors) {
+ if (forge_on || jcr->ignore_label_errors) {
dev->state |= ST_LABEL; /* set has Bacula label */
Jmsg(jcr, M_ERROR, 0, "%s", jcr->errmsg);
return jcr->label_status = VOL_OK;
FI_to_ascii(rec->FileIndex),
stream_to_ascii(rec->Stream, rec->FileIndex),
rec->data_len);
- return 0;
+ if (!forge_on) {
+ return 0;
+ }
}
dev->VolHdr.LabelType = rec->FileIndex;
if (!rewind_dev(dev)) {
memset(&dev->VolHdr, 0, sizeof(dev->VolHdr));
Dmsg2(30, "Bad status on %s from rewind. ERR=%s\n", dev_name(dev), strerror_dev(dev));
- return 0;
+ if (!forge_on) {
+ return 0;
+ }
}
block = new_block(dev);
} else {
/* I/O error or strange end of tape */
display_tape_error_status(jcr, dev);
- if (jcr->ignore_label_errors) {
+ if (forge_on || jcr->ignore_label_errors) {
fsr_dev(dev, 1); /* try skipping bad record */
Dmsg0(000, "Did fsr\n");
continue; /* try to continue */
/* Global variables exported */
char OK_msg[] = "3000 OK\n";
char TERM_msg[] = "3999 Terminate\n";
-STORES *me; /* our Global resource */
+STORES *me = NULL; /* our Global resource */
+bool forge_on = false; /* proceed inspite of I/O errors */
static uint32_t VolSessionId = 0;
uint32_t VolSessionTime;
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static workq_t dird_workq; /* queue for processing connections */
+
static void usage()
{
fprintf(stderr, _(
"\nVersion: " VERSION " (" BDATE ")\n\n"
-"Usage: stored [-s -f ] [-c config_file] [-d debug_level] [config_file]\n"
+"Usage: stored [options] [-c config_file] [config_file]\n"
" -c <file> use <file> as configuration file\n"
" -dnn set debug level to nn\n"
" -f run in foreground (for debugging)\n"
-" -g groupid\n"
+" -g <group> set groupid to group\n"
+" -p proceed despite I/O errors\n"
" -s no signals (for debugging)\n"
" -t test - read config and exit\n"
-" -u userid\n"
+" -u <user> userid to <user>\n"
" -v verbose user messages\n"
" -? print this message.\n"
"\n"));
Emsg1(M_ABORT, 0, "Tape block size (%d) is not a power of 2\n", TAPE_BSIZE);
}
- while ((ch = getopt(argc, argv, "c:d:fg:stu:v?")) != -1) {
+ while ((ch = getopt(argc, argv, "c:d:fg:pstu:v?")) != -1) {
switch (ch) {
case 'c': /* configuration file */
if (configfile != NULL) {
gid = optarg;
break;
+ case 'p': /* proceed in spite of I/O errors */
+ forge_on = true;
+ break;
+
case 's': /* no signals */
no_signals = TRUE;
break;
#include "jcr.h"
#include "protos.h"
#ifdef HAVE_LIBZ
-#include <zlib.h> /* compression headers */
+#include <zlib.h> /* compression headers */
#else
#define uLongf uint32_t
#endif
-extern char errmsg[]; /* general error message */
-
extern STORES *me; /* "Global" daemon resource */
+extern bool forge_on; /* proceed inspite of I/O errors */
#ifdef debug_tracing
extern int _rewind_dev(char *file, int line, DEVICE *dev);
#undef VERSION
#define VERSION "1.33.6"
#define VSTRING "1"
-#define BDATE "28 Mar 2004"
-#define LSMDATE "28Mar04"
+#define BDATE "30 Mar 2004"
+#define LSMDATE "30Mar04"
/* Debug flags */
#undef DEBUG