/*
Bacula® - The Network Backup Solution
- Copyright (C) 2001-2007 Free Software Foundation Europe e.V.
+ Copyright (C) 2001-2008 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
if (!db_create_jobmedia_record(jcr, jcr->db, &jm)) {
Jmsg(jcr, M_FATAL, 0, _("Catalog error creating JobMedia record. %s"),
db_strerror(jcr->db));
- bs->fsend(_("1991 Update JobMedia error\n"));
+ bs->fsend(_("1992 Create JobMedia error\n"));
} else {
Dmsg0(400, "JobMedia record created\n");
bs->fsend(OK_create);
if (!jcr->db) {
omsg = get_memory(bs->msglen+1);
pm_strcpy(omsg, bs->msg);
- bs->fsend(_("1991 Invalid Catalog Update: %s"), omsg);
+ bs->fsend(_("1994 Invalid Catalog Update: %s"), omsg);
Jmsg1(jcr, M_FATAL, 0, _("Invalid Catalog Update; DB not open: %s"), omsg);
free_memory(omsg);
goto bail_out;
void term_scheduler()
{
if (jobs_to_run) {
- job_item *je;
- /* Release all queued job entries to be run */
- foreach_dlist(je, jobs_to_run) {
- free(je);
- }
delete jobs_to_run;
}
}
woy = tm_woy(now); /* get week of year */
Dmsg7(dbglvl, "now = %x: h=%d m=%d md=%d wd=%d wom=%d woy=%d\n",
- now, hour, month, mday, wday, wom, woy);
+ now, hour, month, mday, wday, wom, woy);
/*
* Compute values for next hour from now.
nh_woy = tm_woy(now); /* get week of year */
Dmsg7(dbglvl, "nh = %x: h=%d m=%d md=%d wd=%d wom=%d woy=%d\n",
- next_hour, nh_hour, nh_month, nh_mday, nh_wday, nh_wom, nh_woy);
+ next_hour, nh_hour, nh_month, nh_mday, nh_wday, nh_wom, nh_woy);
/* Loop through all jobs */
LockRes();
Dmsg3(dbglvl, "run@%p: run_now=%d run_nh=%d\n", run, run_now, run_nh);
- if (run_now || run_nh) {
- /* find time (time_t) job is to be run */
- (void)localtime_r(&now, &tm); /* reset tm structure */
- tm.tm_min = run->minute; /* set run minute */
- tm.tm_sec = 0; /* zero secs */
- runtime = mktime(&tm);
- if (run_now) {
- add_job(job, run, now, runtime);
- }
- /* If job is to be run in the next hour schedule it */
- if (run_nh) {
- add_job(job, run, now, runtime + 3600);
- }
- }
+ if (run_now || run_nh) {
+ /* find time (time_t) job is to be run */
+ (void)localtime_r(&now, &tm); /* reset tm structure */
+ tm.tm_min = run->minute; /* set run minute */
+ tm.tm_sec = 0; /* zero secs */
+ runtime = mktime(&tm);
+ if (run_now) {
+ add_job(job, run, now, runtime);
+ }
+ /* If job is to be run in the next hour schedule it */
+ if (run_nh) {
+ add_job(job, run, now, runtime + 3600);
+ }
+ }
}
}
UnlockRes();
goto bail_out;
}
+ /* Do not prune any job currently running */
for (i=0; i < del->num_ids; i++) {
- if (ua->jcr->JobId == del->JobId[i]) {
- Dmsg2(150, "skip same job JobId[%d]=%d\n", i, (int)del->JobId[i]);
- del->JobId[i] = 0;
+ skip = false;
+ foreach_jcr(jcr) {
+ if (jcr->JobId == del->JobId[i]) {
+ Dmsg2(150, "skip same job JobId[%d]=%d\n", i, (int)del->JobId[i]);
+ del->JobId[i] = 0;
+ skip = true;
+ break;
+ }
+ }
+ if (skip) {
continue;
}
Dmsg2(150, "accept JobId[%d]=%d\n", i, (int)del->JobId[i]);
{
m_isClosing = true;
writeSettings();
+ /*
+ * Close the console pages before non-console pages so that
+ * the notifier is turned off. Otherwise it prints an error when
+ * the page it is using gets destroyed.
+ */
+ foreach(Console *console, m_consoleHash){
+ console->writeSettings();
+ console->terminate();
+ console->closeStackPage();
+ }
/* close all non console pages, this will call settings in destructors */
while (m_consoleHash.count() < m_pagehash.count()) {
foreach(Pages *page, m_pagehash) {
}
}
}
- /* close the console pages and terminate connection */
- foreach(Console *console, m_consoleHash){
- console->writeSettings();
- console->terminate();
- console->closeStackPage();
- }
event->accept();
}
dev->weof(1);
write_ansi_ibm_labels(dcr, ANSI_EOF_LABEL, dev->VolHdr.VolumeName);
}
- if (!dev->num_writers) { /* if no more writers */
+ if (!dev->is_busy()) { /* if no more writers */
volume_unused(dcr); /* we obviously are not using the volume */
}
if (!dev->at_weot()) {
return false;
}
if (recycle) {
- volume_unused(dcr); /* mark volume unused */
if (!dev->truncate(dcr)) {
Jmsg2(jcr, M_FATAL, 0, _("Truncate error on device %s: ERR=%s\n"),
dev->print_name(), dev->print_errmsg());
* he wants to know if they matched the bsr, then he must
* check the match_stat in the record */
ok = record_cb(dcr, rec);
+#ifdef xxx
/*
* If this is the end of the Session (EOS) for this record
* we can remove the record. Note, there is a separate
* record to read each session. If a new session is seen
* a new record will be created at approx line 157 above.
+ *
+ * This code causes a seg fault in the enclosing for() loop.
*/
if (rec->FileIndex == EOS_LABEL) {
Dmsg2(dbglvl, "Remove EOS rec. SI=%d ST=%d\n", rec->VolSessionId,
recs->remove(rec);
free_record(rec);
}
+#endif
continue;
} /* end if label record */
goto get_out;
}
Dmsg3(dbglvl, "jid=%u reserve_vol free vol=%s at %p\n", jid(), vol->vol_name, vol->vol_name);
- unload_autochanger(dcr, -1); /* unload the volume */
+// unload_autochanger(dcr, -1); /* unload the volume */
free_volume(dev);
debug_list_volumes("reserve_vol free");
}
void unreserve_device(DCR *dcr)
{
DEVICE *dev = dcr->dev;
+ lock_volumes();
if (dcr->reserved_device) {
dcr->reserved_device = false;
dev->reserved_device--;
volume_unused(dcr);
}
}
+ unlock_volumes();
}
/*
DEVICE *dev = dcr->dev;
JCR *jcr = dcr->jcr;
- Dmsg4(dbglvl, "MaxJobs=%d Jobs=%d reserves=%d Vol=%s\n",
+ Dmsg5(dbglvl, "MaxJobs=%d Jobs=%d reserves=%d Status=%s Vol=%s\n",
dcr->VolCatInfo.VolCatMaxJobs,
dcr->VolCatInfo.VolCatJobs, dev->reserved_device,
+ dcr->VolCatInfo.VolCatStatus,
dcr->VolumeName);
+ if (strcmp(dcr->VolCatInfo.VolCatStatus, "Recycle") == 0) {
+ return true;
+ }
if (dcr->VolCatInfo.VolCatMaxJobs > 0 && dcr->VolCatInfo.VolCatMaxJobs <=
(dcr->VolCatInfo.VolCatJobs + dev->reserved_device)) {
/* Max Job Vols depassed or already reserved */
*/
#undef VERSION
-#define VERSION "2.2.9-b6"
-#define BDATE "07 April 2008"
-#define LSMDATE "07Apr08"
+#define VERSION "2.2.9-b7"
+#define BDATE "14 April 2008"
+#define LSMDATE "14Apr08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
Technical notes on version 2.2
General:
+14Apr08
+kes Close bat console windows first to eliminate error message
+ from the notifier.
+kes Remove useless code in Scheduler that causes seg fault on
+ termination.
+kes Correct some SD catalog request error messages.
+kes Don't allow pruning of any running job.
+kes Turn off code in read_record that causes a seg fault in the SD
+ when reading past an EOS_LABEL.
+kes Turn off unloading the autochanger in reserve.c as it just
+ causes problems.
+kes Lock volumes when unreserving a device.
+kes Do not mark volume unused when recycling.
+kes When acquiring, don't mark volume unused if it is reserved (busy).
+
+Beta Release Version 2.2.9-b6
06Apr08
kes Eliminate ./configure warning on po directory
kes Fix bug #1063, reuse of freed ptr in list nextvol.