Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- Bacula® is a registered trademark of John Walker.
+ Bacula® is a registered trademark of Kern Sibbald.
The licensor of Bacula is the Free Software Foundation Europe
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
static char OK_msg[] = "1000 OK\n";
+
+void set_jcr_sd_job_status(JCR *jcr, int SDJobStatus)
+{
+ bool set_waittime=false;
+ Dmsg2(800, "set_jcr_sd_job_status(%s, %c)\n", jcr->Job, SDJobStatus);
+ /* if wait state is new, we keep current time for watchdog MaxWaitTime */
+ switch (SDJobStatus) {
+ case JS_WaitMedia:
+ case JS_WaitMount:
+ case JS_WaitMaxJobs:
+ set_waittime = true;
+ default:
+ break;
+ }
+
+ if (job_waiting(jcr)) {
+ set_waittime = false;
+ }
+
+ if (set_waittime) {
+ /* set it before JobStatus */
+ Dmsg0(800, "Setting wait_time\n");
+ jcr->wait_time = time(NULL);
+ }
+ jcr->SDJobStatus = SDJobStatus;
+}
+
/*
* Get a message
* Call appropriate processing routine
for (;;) {
n = bs->recv();
- Dmsg2(100, "bget_dirmsg %d: %s", n, bs->msg);
+ Dmsg2(100, "bget_dirmsg %d: %s\n", n, bs->msg);
if (is_bnet_stop(bs)) {
return n; /* error or terminate */
free_jcr(jcr);
continue;
}
- if (bs->msg[0] == 'U') { /* Catalog update */
+ if (bs->msg[0] == 'U') { /* SD sending attributes */
Dmsg2(900, "Catalog upd jcr 0x%x: %s", jcr, bs->msg);
catalog_update(jcr, bs);
Dmsg1(900, "Calling freejcr 0x%x\n", jcr);
int JobStatus;
char Job[MAX_NAME_LENGTH];
if (sscanf(bs->msg, Job_status, &Job, &JobStatus) == 2) {
- jcr->SDJobStatus = JobStatus; /* current status */
+ set_jcr_sd_job_status(jcr,JobStatus); /* current status */
} else {
Emsg1(M_ERROR, 0, _("Malformed message: %s\n"), bs->msg);
}