From 62fc8d1e39e8abf4e42116a8071c71f8bd0e898b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 16 Jun 2003 19:16:39 +0000 Subject: [PATCH] Set correct SD->FD Job term status git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@583 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ReleaseNotes | 3 ++- bacula/kernstodo | 5 ++--- bacula/src/stored/append.c | 2 +- bacula/src/stored/dircmd.c | 4 +--- bacula/src/stored/fd_cmds.c | 6 +++--- bacula/src/stored/job.c | 18 +++++++++--------- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 55bab38cd1..186246c342 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,7 +1,7 @@ Release Notes for Bacula 1.31 - Bacula code: Total files = 246 Total lines = 70,476 (*.h *.c *.in) + Bacula code: Total files = 250 Total lines = 74,253 (*.h *.c *.in) Major Changes this Release: - The database format has changed. Please see below. @@ -15,6 +15,7 @@ Major Changes this Release: and underscore. - Added readline to depkgs (removed from depkgs1) and fixed configuration if it is not installed in your system libraries. +- Implemented generalized tape label formats including counter variables. Other Changes this Release: diff --git a/bacula/kernstodo b/bacula/kernstodo index ec97e8ec6b..9bd45237ec 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -398,7 +398,7 @@ Done -- Restore part needs better implementation to work correctly Item 2: Make the Storage daemon use intermediate file storage to buffer data. -Deferred -- not necessary yet. +Deferred -- not necessary yet -- possibly implement with Migration. What: If data is coming into the SD too fast, buffer it to disk if the user has configured this option. @@ -454,6 +454,7 @@ Item 4: Implement Base jobs. Item 5: Implement Label templates +Done What: This is a mechanism whereby Bacula can automatically create a tape label for new tapes according to a detailed specification @@ -507,7 +508,6 @@ Item 8: GUI for interactive backup Item 9: Add SSL to daemon communications. -Inprogress as of version 1.31. What: This provides for secure communications between the daemons. @@ -980,4 +980,3 @@ Done: (see kernsdone for more) - That restoring a hard link that already exists works correctly. Same for soft link. - Make Pool resource handle Counter resources. - diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index 020817636b..dd81af9e25 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -261,6 +261,6 @@ int do_append_data(JCR *jcr) dir_send_job_status(jcr); /* update director */ - Dmsg0(90, "return from do_append_data()\n"); + Dmsg1(100, "return from do_append_data() stat=%d\n", ok); return ok ? 1 : 0; } diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index d712b3208c..c6b127862f 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -175,9 +175,7 @@ void *connection_request(void *arg) break; } } - if (bnet_stat != BNET_TERMINATE) { - bnet_sig(bs, BNET_TERMINATE); - } + bnet_sig(bs, BNET_TERMINATE); free_jcr(jcr); return NULL; } diff --git a/bacula/src/stored/fd_cmds.c b/bacula/src/stored/fd_cmds.c index 813b43d2d4..0344b77144 100644 --- a/bacula/src/stored/fd_cmds.c +++ b/bacula/src/stored/fd_cmds.c @@ -153,7 +153,6 @@ void run_job(JCR *jcr) set_jcr_job_status(jcr, JS_Terminated); bnet_fsend(dir, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, edit_uint64(jcr->JobBytes, ec1)); - bnet_sig(dir, BNET_EOD); /* send EOD to Director daemon */ return; } @@ -171,9 +170,9 @@ static int append_data_cmd(JCR *jcr) Dmsg1(120, "Append data: %s", fd->msg); if (jcr->session_opened) { Dmsg1(110, "msg); + jcr->JobType = JT_BACKUP; if (do_append_data(jcr)) { bnet_fsend(fd, OK_append); - jcr->JobType = JT_BACKUP; return 1; } else { bnet_suppress_error_messages(fd, 1); /* ignore errors at this point */ @@ -195,6 +194,7 @@ static int append_end_session(JCR *jcr) bnet_fsend(fd, NOT_opened); return 0; } + set_jcr_job_status(jcr, JS_Terminated); return bnet_fsend(fd, OK_end); } @@ -239,7 +239,7 @@ static int append_close_session(JCR *jcr) } /* Send final statistics to File daemon */ bnet_fsend(fd, OK_close, jcr->JobStatus); - Dmsg1(160, ">filed: %s\n", fd->msg); + Dmsg1(120, ">filed: %s\n", fd->msg); bnet_sig(fd, BNET_EOD); /* send EOD to File daemon */ diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c index 04e7ff3a96..3a8d3a2112 100644 --- a/bacula/src/stored/job.c +++ b/bacula/src/stored/job.c @@ -98,22 +98,22 @@ int job_cmd(JCR *jcr) jcr->JobId = JobId; jcr->VolSessionId = newVolSessionId(); jcr->VolSessionTime = VolSessionTime; - strcpy(jcr->Job, job); + bstrncpy(jcr->Job, job, sizeof(jcr->Job)); unbash_spaces(job_name); - jcr->job_name = get_memory(strlen(job_name) + 1); - strcpy(jcr->job_name, job_name); + jcr->job_name = get_pool_memory(PM_NAME); + pm_strcpy(&jcr->job_name, job_name); unbash_spaces(client_name); - jcr->client_name = get_memory(strlen(client_name) + 1); - strcpy(jcr->client_name, client_name); + jcr->client_name = get_pool_memory(PM_NAME); + pm_strcpy(&jcr->client_name, client_name); unbash_spaces(fileset_name); - jcr->fileset_name = get_memory(strlen(fileset_name) + 1); - strcpy(jcr->fileset_name, fileset_name); + jcr->fileset_name = get_pool_memory(PM_NAME); + pm_strcpy(&jcr->fileset_name, fileset_name); jcr->JobType = JobType; jcr->JobLevel = level; jcr->no_attributes = no_attributes; jcr->spool_attributes = spool_attributes; - jcr->fileset_md5 = get_memory(strlen(fileset_md5) + 1); - strcpy(jcr->fileset_md5, fileset_md5); + jcr->fileset_md5 = get_pool_memory(PM_NAME); + pm_strcpy(&jcr->fileset_md5, fileset_md5); free_memory(job); free_memory(job_name); free_memory(client_name); -- 2.39.5