#include "bacula.h"
#include "jcr.h"
+const int dbglvl = 900;
+
/* Forward referenced functions */
static void stop_btimer(btimer_t *wid);
static btimer_t *btimer_start_common(uint32_t wait);
wid->wd->interval = wait;
register_watchdog(wid->wd);
- Dmsg3(900, "Start child timer %p, pid %d for %d secs.\n", wid, pid, wait);
+ Dmsg3(dbglvl, "Start child timer %p, pid %d for %d secs.\n", wid, pid, wait);
return wid;
}
void stop_child_timer(btimer_t *wid)
{
if (wid == NULL) {
- Dmsg0(900, "stop_child_timer called with NULL btimer_id\n");
+ Dmsg0(dbglvl, "stop_child_timer called with NULL btimer_id\n");
return;
}
- Dmsg2(900, "Stop child timer %p pid %d\n", wid, wid->pid);
+ Dmsg2(dbglvl, "Stop child timer %p pid %d\n", wid, wid->pid);
stop_btimer(wid);
}
/* First kill attempt; try killing it softly (kill -SONG) first */
wid->killed = true;
- Dmsg2(050, "watchdog %p term PID %d\n", self, wid->pid);
+ Dmsg2(dbglvl, "watchdog %p term PID %d\n", self, wid->pid);
/* Kill -TERM the specified PID, and reschedule a -KILL for 5 seconds
* later. (Warning: this should let dvd-writepart enough time to term
self->interval = 5;
} else {
/* This is the second call - terminate with prejudice. */
- Dmsg2(050, "watchdog %p kill PID %d\n", self, wid->pid);
+ Dmsg2(dbglvl, "watchdog %p kill PID %d\n", self, wid->pid);
kill(wid->pid, SIGKILL);
*/
self->one_shot = true;
}
- Jmsg(wid->jcr, M_INFO, 0, _("Child timer expired. Child process killed.\n"));
}
/*
btimer_t *wid;
wid = btimer_start_common(wait);
if (wid == NULL) {
- Dmsg1(900, "start_thread_timer return NULL from common. wait=%d.\n", wait);
+ Dmsg1(dbglvl, "start_thread_timer return NULL from common. wait=%d.\n", wait);
return NULL;
}
wid->type = TYPE_PTHREAD;
wid->wd->interval = wait;
register_watchdog(wid->wd);
- Dmsg3(900, "Start thread timer %p tid %p for %d secs.\n", wid, tid, wait);
+ Dmsg3(dbglvl, "Start thread timer %p tid %p for %d secs.\n", wid, tid, wait);
return wid;
}
wid->wd->interval = wait;
register_watchdog(wid->wd);
- Dmsg4(950, "Start bsock timer %p tid=%p for %d secs at %d\n", wid,
+ Dmsg4(dbglvl, "Start bsock timer %p tid=%p for %d secs at %d\n", wid,
wid->tid, wait, time(NULL));
return wid;
Dmsg0(900, "stop_bsock_timer called with NULL btimer_id\n");
return;
}
- Dmsg3(950, "Stop bsock timer %p tid=%p at %d.\n", wid, wid->tid, time(NULL));
+ Dmsg3(dbglvl, "Stop bsock timer %p tid=%p at %d.\n", wid, wid->tid, time(NULL));
stop_btimer(wid);
}
void stop_thread_timer(btimer_t *wid)
{
if (wid == NULL) {
- Dmsg0(900, "stop_thread_timer called with NULL btimer_id\n");
+ Dmsg0(dbglvl, "stop_thread_timer called with NULL btimer_id\n");
return;
}
- Dmsg2(900, "Stop thread timer %p tid=%p.\n", wid, wid->tid);
+ Dmsg2(dbglvl, "Stop thread timer %p tid=%p.\n", wid, wid->tid);
stop_btimer(wid);
}
{
btimer_t *wid = (btimer_t *)self->data;
- Dmsg4(50, "thread timer %p kill %s tid=%p at %d.\n", self,
+ Dmsg4(dbglvl, "thread timer %p kill %s tid=%p at %d.\n", self,
wid->type == TYPE_BSOCK ? "bsock" : "thread", wid->tid, time(NULL));
+ if (wid->jcr) {
+ Dmsg2(dbglvl, "killed jid=%u Job=%s\n", wid->jcr->JobId, wid->jcr->Job);
+ }
if (wid->type == TYPE_BSOCK && wid->bsock) {
wid->bsock->set_timed_out();
{
bool do_mount = false;
bool release = false;
- bool find;
+ bool have_vol;
DEVICE *dev = dcr->dev;
JCR *jcr = dcr->jcr;
* find defines whether or not mount_next_write_volume should
* as the Director again about what Volume to use.
*/
- find = !is_suitable_volume_mounted(dcr);
+ have_vol = is_suitable_volume_mounted(dcr);
if (dev->can_append()) {
Dmsg0(190, "device already in append.\n");
/*
* dcr->VolumeName is what we pass into the routines, or
* get back from the subroutines.
*/
- if (!find &&
+ if (!have_vol &&
!(dir_find_next_appendable_volume(dcr) &&
strcmp(dev->VolHdr.VolumeName, dcr->VolumeName) == 0)) { /* wrong tape mounted */
Dmsg2(190, "Wrong tape mounted: %s. wants:%s\n", dev->VolHdr.VolumeName,
}
} else {
/* Not already in append mode, so mount the device */
- Dmsg2(190, "jid=%u Not in append mode, try mount find=%d\n",
- (uint32_t)jcr->JobId, find);
+ Dmsg2(190, "jid=%u Not in append mode, try mount have_vol=%d\n",
+ (uint32_t)jcr->JobId, have_vol);
ASSERT(dev->num_writers == 0);
do_mount = true;
}
- if (do_mount) {
+ if (do_mount || !have_vol) {
Dmsg1(190, "jid=%u Do mount_next_write_vol\n", (uint32_t)jcr->JobId);
- bool mounted = mount_next_write_volume(dcr, find, release);
+ bool mounted = mount_next_write_volume(dcr, have_vol, release);
if (!mounted) {
if (!job_canceled(jcr)) {
/* Reduce "noise" -- don't print if job canceled */