*
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2003 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
* - We execute the command
* - We continue or exit depending on the return status
*/
-void connection_request(void *arg)
+void *connection_request(void *arg)
{
BSOCK *bs = (BSOCK *)arg;
JCR *jcr;
if (bnet_recv(bs) <= 0) {
Emsg0(M_ERROR, 0, "Connection request failed.\n");
- return;
+ return NULL;
}
/*
*/
if (sscanf(bs->msg, "Hello Start Job %127s calling\n", name) == 1) {
handle_filed_connection(bs, name);
- return;
+ return NULL;
}
jcr = new_jcr(sizeof(JCR), stored_free_jcr); /* create Job Control Record */
if (!authenticate_director(jcr)) {
Jmsg(jcr, M_FATAL, 0, _("Unable to authenticate Director\n"));
free_jcr(jcr);
- return;
+ return NULL;
}
Dmsg0(90, "Message channel init completed.\n");
bnet_sig(bs, BNET_TERMINATE);
}
free_jcr(jcr);
- return;
+ return NULL;
}
/*
bnet_fsend(dir, _("3001 Device %s is mounted with Volume %s\n"),
dev->dev_name, dev->VolHdr.VolName);
} else {
- bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"),
+ bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"
+ "Try unmounting and remounting the Volume.\n"),
dev->dev_name);
}
break;
bnet_fsend(dir, _("3001 Device %s is mounted with Volume %s\n"),
dev->dev_name, dev->VolHdr.VolName);
} else {
- bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"),
+ bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"
+ "Try unmounting and remounting the Volume.\n"),
dev->dev_name);
}
} else {
bnet_fsend(dir, _("3001 Device %s is mounted with Volume %s\n"),
dev->dev_name, dev->VolHdr.VolName);
} else {
- bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"),
+ bnet_fsend(dir, _("3905 Device %s open but no Bacula volume is mounted.\n"
+ "Try unmounting and remounting the Volume.\n"),
dev->dev_name);
}
}
} else if (dev->dev_blocked == BST_WAITING_FOR_SYSOP) {
Dmsg2(90, "%d waiter dev_block=%d. doing unmount\n", dev->num_waiting,
dev->dev_blocked);
- if (dev->capabilities & CAP_OFFLINEUNMOUNT) {
+ if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
offline_dev(dev);
}
force_close_dev(dev);
} else { /* device not being used */
Dmsg0(90, "Device not in use, unmounting\n");
block_device(dev, BST_UNMOUNTED);
- if (dev->capabilities & CAP_OFFLINEUNMOUNT) {
+ if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) {
offline_dev(dev);
}
force_close_dev(dev);
char dt[MAX_TIME_LENGTH];
char b1[30], b2[30], b3[30];
- bnet_fsend(user, "\n%s Version: " VERSION " (" DATE ")\n", my_name);
+ bnet_fsend(user, "\n%s Version: " VERSION " (" BDATE ")\n", my_name);
bstrftime(dt, sizeof(dt), daemon_start_time);
bnet_fsend(user, _("Daemon started %s, %d Job%s run.\n"), dt, last_job.NumJobs,
last_job.NumJobs == 1 ? "" : "s");
LockRes();
for (device=NULL; (device=(DEVRES *)GetNextRes(R_DEVICE, (RES *)device)); ) {
- dev = device->dev;
- if (dev) {
+ for (dev=device->dev; dev; dev=dev->next) {
if (dev->state & ST_OPENED) {
if (dev->state & ST_LABEL) {
bnet_fsend(user, _("Device %s is mounted with Volume %s\n"),
job_type_to_str(jcr->JobType), jcr->Job);
}
if (jcr->device) {
- bnet_fsend(user, _("%s %s job %s is using device %s\n"),
+ bnet_fsend(user, _("%s %s job %s is using device %s volume %s\n"),
job_level_to_str(jcr->JobLevel),
job_type_to_str(jcr->JobType),
- jcr->Job, jcr->device->device_name);
+ jcr->Job, jcr->device->device_name,
+ jcr->VolumeName);
sec = time(NULL) - jcr->run_time;
if (sec <= 0) {
sec = 1;