diff --git a/checkin_notes b/checkin_notes index 2e6c1fbe5c..ff6eb96c16 100755 --- a/checkin_notes +++ b/checkin_notes @@ -3194,3 +3194,13 @@ David Feb 12 2003 scheduler_op.C test/ test_time.php + +David Feb 12 2003 + - changed server startup mechanism so that config.xml contains + actual commands (so you can include cmdline args etc.) + + sched/ + config.C,h + start_servers.C + test/ + test.inc diff --git a/sched/config.C b/sched/config.C index ae70b0a297..2e0a6172f5 100644 --- a/sched/config.C +++ b/sched/config.C @@ -28,7 +28,8 @@ #include "config.h" int CONFIG::parse(FILE* in) { - char buf[256]; + char buf[256], cmd[256]; + int ncmds = 0; memset(this, 0, sizeof(CONFIG)); while (fgets(buf, 256, in)) { @@ -42,24 +43,8 @@ int CONFIG::parse(FILE* in) { else if (parse_str(buf, "", upload_url, sizeof(upload_url))) continue; else if (parse_str(buf, "", upload_dir, sizeof(upload_dir))) continue; else if (parse_str(buf, "", user_name, sizeof(user_name))) continue; - else if (match_tag(buf, "")) { - start_assimilator = true; - continue; - } else if (match_tag(buf, "")) { - start_feeder = true; - continue; - } else if (match_tag(buf, "")) { - start_file_deleter = true; - continue; - } else if (match_tag(buf, "")) { - start_make_work = true; - continue; - } else if (match_tag(buf, "")) { - start_result_retry = true; - continue; - } else if (match_tag(buf, "")) { - start_validate = true; - continue; + else if (parse_str(buf, "", cmd, sizeof(cmd))) { + start_commands[ncmds++] = strdup(cmd); } } return ERR_XML_PARSE; diff --git a/sched/config.h b/sched/config.h index a98e18acad..8b9ca8ed1d 100644 --- a/sched/config.h +++ b/sched/config.h @@ -33,12 +33,7 @@ public: char upload_url[256]; char upload_dir[256]; char user_name[256]; - bool start_assimilator; - bool start_feeder; - bool start_file_deleter; - bool start_make_work; - bool start_result_retry; - bool start_validate; + char* start_commands[20]; int parse(FILE*); int parse_file(); diff --git a/sched/start_servers.C b/sched/start_servers.C index ad177b3b96..55f771b117 100644 --- a/sched/start_servers.C +++ b/sched/start_servers.C @@ -25,6 +25,7 @@ int main() { CONFIG config; int retval; + char* p; retval = config.parse_file(); if (retval) { @@ -32,22 +33,9 @@ int main() { exit(1); } - if (config.start_assimilator) { - system("assimilator >> assimilator.out 2>&1"); - } - if (config.start_feeder) { - system("feeder >> feeder.out 2>&1"); - } - if (config.start_file_deleter) { - system("file_deleter >> file_deleter.out 2>&1"); - } - if (config.start_make_work) { - system("make_work >> make_work.out 2>&1"); - } - if (config.start_result_retry) { - system("result_retry >> result_retry.out 2>&1"); - } - if (config.start_validate) { - system("validate >> validate.out 2>&1"); + for (i=0; i<20; i++) { + p = config.start_commands[i]; + if (!p) break; + system(p); } } diff --git a/test/test.inc b/test/test.inc index 34cf166e0a..efe00433ee 100644 --- a/test/test.inc +++ b/test/test.inc @@ -314,21 +314,33 @@ class Project { // $f = fopen("$this->project_dir/cgi/config.xml", "w"); fputs($f, "\n"); - fputs($f, " $this->db_name\n"); - fputs($f, " $this->db_passwd\n"); - fputs($f, " $this->shmem_key\n"); - fputs($f, " $this->key_dir\n"); - fputs($f, " $this->download_url\n"); - fputs($f, " $this->project_dir/download\n"); - fputs($f, " $this->upload_url\n"); - fputs($f, " $this->project_dir/upload\n"); - fputs($f, " $this->user_name\n"); - if ($this->start_assimilator) fputs($f, " \n"); - if ($this->start_feeder) fputs($f, " \n"); - if ($this->start_file_deleter) fputs($f, " \n"); - if ($this->start_make_work) fputs($f, " \n"); - if ($this->start_result_retry) fputs($f, " \n"); - if ($this->start_validate) fputs($f, " \n"); + fputs($f, "$this->db_name\n"); + fputs($f, "$this->db_passwd\n"); + fputs($f, "$this->shmem_key\n"); + fputs($f, "$this->key_dir\n"); + fputs($f, "$this->download_url\n"); + fputs($f, "$this->project_dir/download\n"); + fputs($f, "$this->upload_url\n"); + fputs($f, "$this->project_dir/upload\n"); + fputs($f, "$this->user_name\n"); + if ($this->start_assimilator) { + fputs($f, "assimilator >> assimilator.out 2>&1\n"); + } + if ($this->start_feeder) { + fputs($f, "feeder >> feeder.out 2>&1\n"); + } + if ($this->start_file_deleter) { + fputs($f, "file_deleter >> file_deleter.out 2>&1\n"); + } + if ($this->start_make_work) { + fputs($f, "make_work >> make_work.out 2>&1\n"); + } + if ($this->start_result_retry) { + fputs($f, "result_retry >> result_retry.out 2>&1\n"); + } + if ($this->start_validate) { + fputs($f, "validate >> validate.out 2>&1\n"); + } fputs($f, "\n"); fclose($f);