From: Kern Sibbald Date: Sun, 6 Jul 2003 13:08:22 +0000 (+0000) Subject: Fix tree code from bashing restore args + pass prefix links to FD + sort Console... X-Git-Tag: Release-1.31~36 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=53ef709ba5336a2fdfe6c1856329d187a5e8a0d6;p=bacula%2Fbacula Fix tree code from bashing restore args + pass prefix links to FD + sort Console commands + set default jobs to 10 in SD and FD git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@620 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 128d6a5237..85a38eab74 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,5 +1,12 @@ 2003-07-xx Version 1.31 Beta xxJul03 +- Add a new test -- bsr-opt-test for testing bsr optimization. As usual, + it pointed out a bug where the directory tree handling code destroyed + the restore arg list. +- Many updates to the manual. +- Pass prefix links flag to FD. +- Sort list of commands for Console +- Set default FD and SD concurrent jobs to 10. - Rework the find next volume code in catreq.c to correct some minor but subtle logic errors and to eliminate a goto. - Did spell check on manual. diff --git a/bacula/kernstodo b/bacula/kernstodo index 4b560ba98b..2c627d324e 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -21,6 +21,7 @@ Documentation to do: (any release a little bit at a time) - Document update volume: jobid, current, before, all - Document run "yes". - Document that bscan does not work with multiple simultaneous jobs. +- Update Automatic Volume Labeling in disk.wml Testing to do: (painful) @@ -69,6 +70,7 @@ For 1.31 release: For 1.32: +- Implement ClientRunBeforeJob and ClientRunAfterJob. - Implement new alist in FileSet scanning. - Add JobLevel in FD status (but make sure it is defined). - Audit all UA commands to ensure that we always prompt where possible. diff --git a/bacula/src/dird/restore.c b/bacula/src/dird/restore.c index d8b1b72088..341ac3aa33 100644 --- a/bacula/src/dird/restore.c +++ b/bacula/src/dird/restore.c @@ -236,6 +236,7 @@ int do_restore(JCR *jcr) } else { where = ""; /* None */ } + jcr->prefix_links = jcr->job->PrefixLinks; bash_spaces(where); bnet_fsend(fd, restorecmd, replace, jcr->prefix_links, where); unbash_spaces(where); diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index ccf346e862..ec2cfc13ed 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -91,32 +91,32 @@ static struct cmdstruct commands[] = { { N_("cancel"), cancelcmd, _("cancel job=nnn -- cancel a job")}, { N_("create"), createcmd, _("create DB Pool from resource")}, { N_("delete"), delete_cmd, _("delete [pool= | media volume=]")}, + { N_("estimate"), estimate_cmd, _("performs FileSet estimate debug=1 give full listing")}, + { N_("exit"), quit_cmd, _("exit = quit")}, { N_("help"), help_cmd, _("print this command")}, { N_("label"), labelcmd, _("label a tape")}, - { N_("relabel"), relabelcmd, _("relabel a tape")}, { N_("list"), listcmd, _("list [pools | jobs | jobtotals | media | files job=]; from catalog")}, { N_("llist"), llistcmd, _("full or long list like list command")}, { N_("messages"), messagescmd, _("messages")}, { N_("mount"), mount_cmd, _("mount ")}, - { N_("restore"), restorecmd, _("restore files")}, { N_("prune"), prunecmd, _("prune expired records from catalog")}, { N_("purge"), purgecmd, _("purge records from catalog")}, + { N_("query"), querycmd, _("query catalog")}, + { N_("quit"), quit_cmd, _("quit")}, + { N_("relabel"), relabelcmd, _("relabel a tape")}, + { N_("release"), release_cmd, _("release ")}, + { N_("restore"), restorecmd, _("restore files")}, { N_("run"), runcmd, _("run ")}, { N_("setdebug"), setdebug_cmd, _("sets debug level")}, - { N_("estimate"), estimate_cmd, _("performs FileSet estimate debug=1 give full listing")}, - { N_("var"), var_cmd, _("does variable expansion")}, { N_("show"), show_cmd, _("show (resource records) [jobs | pools | ... | all]")}, { N_("sqlquery"), sqlquerycmd, _("use SQL to query catalog")}, { N_("status"), statuscmd, _("status [storage | client]=")}, + { N_("time"), time_cmd, _("print current time")}, { N_("unmount"), unmount_cmd, _("unmount ")}, { N_("update"), update_cmd, _("update Volume or Pool")}, { N_("use"), use_cmd, _("use catalog xxx")}, + { N_("var"), var_cmd, _("does variable expansion")}, { N_("version"), version_cmd, _("print Director version")}, - { N_("quit"), quit_cmd, _("quit")}, - { N_("query"), querycmd, _("query catalog")}, - { N_("release"), release_cmd, _("release ")}, - { N_("time"), time_cmd, _("print current time")}, - { N_("exit"), quit_cmd, _("exit = quit")}, { N_("wait"), wait_cmd, _("wait until no jobs are running")}, }; #define comsize (sizeof(commands)/sizeof(struct cmdstruct)) diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 02853da6f0..fa13461724 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -252,8 +252,8 @@ int restorecmd(UAContext *ua, char *cmd) job->hdr.name, ji.ClientName, ji.store?ji.store->hdr.name:"", working_directory); } - Dmsg1(400, "Submitting: %s\n", ua->cmd); + Dmsg1(400, "Submitting: %s\n", ua->cmd); parse_ua_args(ua); runcmd(ua, ua->cmd); diff --git a/bacula/src/dird/ua_server.c b/bacula/src/dird/ua_server.c index ef0832930d..75c08fc9d6 100644 --- a/bacula/src/dird/ua_server.c +++ b/bacula/src/dird/ua_server.c @@ -219,7 +219,6 @@ void free_ua_context(UAContext *ua) if (ua->UA_sock) { bnet_close(ua->UA_sock); } - free(ua); } diff --git a/bacula/src/dird/ua_tree.c b/bacula/src/dird/ua_tree.c index 67663749b5..6331200e1a 100644 --- a/bacula/src/dird/ua_tree.c +++ b/bacula/src/dird/ua_tree.c @@ -74,6 +74,9 @@ static struct cmdstruct commands[] = { void user_select_files_from_tree(TREE_CTX *tree) { char cwd[2000]; + /* Get a new context so we don't destroy restore command args */ + UAContext *ua = new_ua_context(ua->jcr); + ua->UA_sock = tree->ua->UA_sock; /* patch in UA socket */ bsendmsg(tree->ua, _( "\nYou are now entering file selection mode where you add and\n" @@ -88,20 +91,20 @@ void user_select_files_from_tree(TREE_CTX *tree) bsendmsg(tree->ua, _("cwd is: %s\n"), cwd); for ( ;; ) { int found, len, stat, i; - if (!get_cmd(tree->ua, "$ ")) { + if (!get_cmd(ua, "$ ")) { break; } - parse_ua_args(tree->ua); - if (tree->ua->argc == 0) { + parse_ua_args(ua); + if (ua->argc == 0) { return; } - len = strlen(tree->ua->argk[0]); + len = strlen(ua->argk[0]); found = 0; stat = 0; for (i=0; i<(int)comsize; i++) /* search for command */ - if (strncasecmp(tree->ua->argk[0], _(commands[i].key), len) == 0) { - stat = (*commands[i].func)(tree->ua, tree); /* go execute command */ + if (strncasecmp(ua->argk[0], _(commands[i].key), len) == 0) { + stat = (*commands[i].func)(ua, tree); /* go execute command */ found = 1; break; } @@ -113,6 +116,8 @@ void user_select_files_from_tree(TREE_CTX *tree) break; } } + ua->UA_sock = NULL; /* don't release restore socket */ + free_ua_context(ua); /* get rid of temp UA context */ } diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index 05781eb7cb..0872c4f2d4 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -79,7 +79,7 @@ static struct res_items cli_items[] = { {"piddirectory", store_dir, ITEM(res_client.pid_directory), 0, ITEM_REQUIRED, 0}, {"subsysdirectory", store_dir, ITEM(res_client.subsys_directory), 0, 0, 0}, {"requiressl", store_yesno, ITEM(res_client.require_ssl), 1, ITEM_DEFAULT, 0}, - {"maximumconcurrentjobs", store_pint, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 5}, + {"maximumconcurrentjobs", store_pint, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 10}, {"messages", store_res, ITEM(res_client.messages), R_MSGS, 0, 0}, {"heartbeatinterval", store_time, ITEM(res_client.heartbeat_interval), 0, ITEM_DEFAULT, 20*60}, {NULL, NULL, NULL, 0, 0, 0} diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index 2c3c0ed482..94e4bbb839 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -63,7 +63,7 @@ static struct res_items store_items[] = { {"piddirectory", store_dir, ITEM(res_store.pid_directory), 0, ITEM_REQUIRED, 0}, {"subsysdirectory", store_dir, ITEM(res_store.subsys_directory), 0, 0, 0}, {"requiressl", store_yesno,ITEM(res_store.require_ssl), 1, ITEM_DEFAULT, 0}, - {"maximumconcurrentjobs", store_pint, ITEM(res_store.max_concurrent_jobs), 0, ITEM_DEFAULT, 5}, + {"maximumconcurrentjobs", store_pint, ITEM(res_store.max_concurrent_jobs), 0, ITEM_DEFAULT, 10}, {"heartbeatinterval", store_time, ITEM(res_store.heartbeat_interval), 0, ITEM_DEFAULT, 20*60}, {NULL, NULL, 0, 0, 0, 0} }; diff --git a/bacula/src/version.h b/bacula/src/version.h index d0a1f839ff..8d151b9f00 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.31" #define VSTRING "1" -#define BDATE "02 Jul 2003" -#define LSMDATE "02Jul03" +#define BDATE "06 Jul 2003" +#define LSMDATE "06Jul03" /* Debug flags */ #define DEBUG 1