diff --git a/checkin_notes b/checkin_notes index 0852349226..6e56f18b8d 100755 --- a/checkin_notes +++ b/checkin_notes @@ -12164,3 +12164,21 @@ David 3 Nov 2006 clientgui/ ViewStatistics.cpp,h + +David 3 Nov 2006 + - server tools: change a few programs to support the convention + that any programs intended to be run manually + (e.g., start, get_file, create_work, dir_hier_path) + are to be run in the project root directory + (i.e., they look for config.xml in the current directory) + - update_versions: create the reread_db trigger file + in current dir, not parent + + sched/ + delete_file.C + get_file.C + request_file_list.C + send_file.C + show_shmem.C + tools/ + update_versions diff --git a/doc/delete_file.php b/doc/delete_file.php index 4f989c3359..16416ec9a4 100644 --- a/doc/delete_file.php +++ b/doc/delete_file.php @@ -6,7 +6,7 @@ To delete a file from a host, use the function
 delete_file(int host_id, const char* file_name)
 
-or the command line program +or the command line program (run from the project root dir)
 delete_file -host_id X -file_name Y
 
diff --git a/doc/get_file.php b/doc/get_file.php index 73fc5b13be..c59b2d8f25 100644 --- a/doc/get_file.php +++ b/doc/get_file.php @@ -9,7 +9,7 @@ This can be done using the function get_file(int host_id, const char* file_name)

-or the command line program +or the command line program (run in the project root dir)

 get_file -host_id X -file_name Y
 
diff --git a/doc/get_file_list.php b/doc/get_file_list.php index 9bb643b6de..0999556a0b 100644 --- a/doc/get_file_list.php +++ b/doc/get_file_list.php @@ -7,7 +7,7 @@ use the function
 request_file_list(int host_id)
 
-or the command line program +or the command line program (run from the project root directory)
 request_file_list [ -host_id X ]
 
@@ -18,7 +18,8 @@ A message is created for the specific host (or all hosts) and added to the msg_to_host table in the database. The upload message included in the next RPC reply to the host.

-???? how do you tell it where to upload the list??? +The file list will be included in the next scheduler RPC request. +You must modify the scheduler to parse and store it. "; page_tail(); ?> diff --git a/doc/hier_dir.php b/doc/hier_dir.php index 748c380075..d4e2ab469f 100644 --- a/doc/hier_dir.php +++ b/doc/hier_dir.php @@ -63,7 +63,8 @@ int get_output_file_paths(RESULT const& result, vector& ); to get the paths of output files in the hierarchy.

-A couple of utility programs are available: +A couple of utility programs are available +(run this in the project root directory): ".html_text(" dir_hier_move src_dir dst_dir fanout dir_hier_path filename diff --git a/doc/send_file.php b/doc/send_file.php index 03e86d8cc9..20d8859486 100644 --- a/doc/send_file.php +++ b/doc/send_file.php @@ -4,17 +4,12 @@ page_head("Sending files"); echo " To send a file to a specific host, use the function

-send_file(int host_id, const char* file_name, int priority, long int exp_date) 
+send_file(int host_id, const char* file_name) 
 
-or the command line program +or the command line program (run from the project root directory)
-send_file -host_id X -file_name Y -priority Z -days_exp N
+send_file -host_id X -file_name Y
 
-

send_file creates a result and initializes it with a name of the form send_FILENAME_HOSTID_TIME. @@ -42,8 +37,6 @@ The message has the form: md5 file->nbytes - priority - exp_date result.name diff --git a/sched/delete_file.C b/sched/delete_file.C index 1ac0b234e1..528ba3e4ea 100644 --- a/sched/delete_file.C +++ b/sched/delete_file.C @@ -17,8 +17,6 @@ // or write to the Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//------------------------------------ -// // delete_file [-host_id host_id -file_name file_name] // -host_id number of host to upload from // or 'all' if for all active hosts @@ -26,6 +24,8 @@ // // Create a msg_to_host_that requests that the host delete the // given file from the client +// +// Run from the project root dir #include "config.h" #include @@ -101,7 +101,7 @@ int main(int argc, char** argv) { } // parse the configuration file to get database information - retval = config.parse_file(".."); + retval = config.parse_file("."); if (retval) { fprintf(stderr, "Can't parse config file: %d\n", retval); exit(1); diff --git a/sched/get_file.C b/sched/get_file.C index 239115b3c0..67b542d137 100644 --- a/sched/get_file.C +++ b/sched/get_file.C @@ -17,14 +17,14 @@ // or write to the Free Software Foundation, Inc., // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//------------------------------------ -// // get_file [-host_id host_id] [-file_name file_name] // -host_id name of host to upload from // -file_name name of specific file, dominates workunit // // Create a result entries, initialized to sent, and corresponding // messages to the host that is assumed to have the file. +// +// Run from the project root dir. #include "config.h" @@ -144,13 +144,11 @@ int main(int argc, char** argv) { char file_name[256]; int host_id; - // initialize argument strings to empty strcpy(file_name, ""); host_id = 0; check_stop_daemons(); - // get arguments for(i=1; i @@ -80,24 +80,30 @@ int main(int argc, char** argv) { } } else { if (!strncmp("-",argv[i],1)) { - fprintf(stderr, "request_file_list: bad argument '%s'\n", argv[i]); + fprintf(stderr, + "request_file_list: bad argument '%s'\n", argv[i] + ); exit(1); } } } if (host_id == 0) { - fprintf(stderr, "request_file_list: bad command line, requires a valid host_id\n"); + fprintf(stderr, + "request_file_list: bad command line, requires a valid host_id\n" + ); exit(1); } - retval = config.parse_file(".."); + retval = config.parse_file("."); if (retval) { fprintf(stderr, "Can't parse config file: %d\n", retval); exit(1); } - retval = boinc_db.open(config.db_name, config.db_host, config.db_user, config.db_passwd); + retval = boinc_db.open( + config.db_name, config.db_host, config.db_user, config.db_passwd + ); if (retval) { fprintf(stderr, "boinc_db.open failed: %d\n", retval); exit(1); diff --git a/sched/send_file.C b/sched/send_file.C index ce469ef841..8933ab7427 100644 --- a/sched/send_file.C +++ b/sched/send_file.C @@ -85,7 +85,9 @@ int create_download_result(DB_RESULT& result, int host_id) { return 0; } -int create_download_message(DB_RESULT& result, int host_id, const char* file_name, int priority, long int exp_days) {; +int create_download_message( + DB_RESULT& result, int host_id, const char* file_name +) {; DB_MSG_TO_HOST mth; int retval; double nbytes; @@ -118,8 +120,6 @@ int create_download_message(DB_RESULT& result, int host_id, const char* file_nam " %s\n" " %.0f\n" " \n" - " %d\n" - " %ld\n" "\n" "\n" " %s\n" @@ -130,7 +130,7 @@ int create_download_message(DB_RESULT& result, int host_id, const char* file_nam "", FILE_MOVER, FILE_MOVER, BOINC_MAJOR_VERSION, result.xml_doc_in, file_name, urlpath, file_name, md5, - nbytes, priority, exp_days, result.name, FILE_MOVER, file_name + nbytes, result.name, FILE_MOVER, file_name ); retval = mth.insert(); if (retval) { @@ -140,9 +140,7 @@ int create_download_message(DB_RESULT& result, int host_id, const char* file_nam return 0; } -int send_file( - int host_id, const char* file_name, int priority, long int exp_days -) { +int send_file(int host_id, const char* file_name) { DB_RESULT result; int retval; result.clear(); @@ -151,7 +149,7 @@ int send_file( sprintf(result.name, "send_%s_%d_%ld", file_name, host_id, my_time); result.hostid = host_id; retval = create_download_result(result, host_id); - retval = create_download_message(result, host_id, file_name, priority, exp_days); + retval = create_download_message(result, host_id, file_name); return retval; } @@ -160,16 +158,12 @@ int main(int argc, char** argv) { int i, retval; char file_name[256]; int host_id; - int priority = 1; - unsigned long exp_days; int num_copies; // initialize argument strings to empty strcpy(file_name, ""); host_id = 0; num_copies = 0; - priority = 1; - exp_days = 60; check_stop_daemons(); @@ -179,18 +173,13 @@ int main(int argc, char** argv) { host_id = atoi(argv[++i]); } else if (!strcmp(argv[i], "-file_name")) { strcpy(file_name, argv[++i]); - } else if (!strcmp(argv[i], "-priority")) { - priority = atoi(argv[++i]); - } else if (!strcmp(argv[i], "-exp_days")) { - exp_days = atoi(argv[++i]); } else if (!strcmp(argv[i], "-help")) { fprintf(stdout, "send_file: sends a file to a specific host\n\n" "It takes the following arguments and types:\n" "-hostid (int); the number of the host\n" "-file_name (string); the name of the file to send\n" - "-priority (int); the priority of the file, (low=1, high=5)\n" - "-exp_days (int); the number of days until the file should expire\n"); + ); exit(0); } else { if (!strncmp("-",argv[i],1)) { @@ -202,10 +191,12 @@ int main(int argc, char** argv) { } if (!strlen(file_name)) { - fprintf(stderr, "send_file: bad command line, requires a valid host_id and file_name\n"); + fprintf(stderr, + "send_file: bad command line, requires a valid host_id and file_name\n" + ); exit(1); } - retval = config.parse_file(".."); + retval = config.parse_file("."); if (retval) { fprintf(stderr, "Can't parse config file: %d\n", retval); exit(1); @@ -217,7 +208,7 @@ int main(int argc, char** argv) { exit(1); } - retval = send_file(host_id, file_name, priority, exp_days); + retval = send_file(host_id, file_name); boinc_db.close(); return retval; diff --git a/sched/show_shmem.C b/sched/show_shmem.C index 6af5da3f42..2080165637 100644 --- a/sched/show_shmem.C +++ b/sched/show_shmem.C @@ -33,7 +33,7 @@ int main() { void* p; SCHED_CONFIG config; - retval = config.parse_file(".."); + retval = config.parse_file("."); if (retval) { printf("can't parse config: %d\n", retval); exit(1); diff --git a/tools/update_versions b/tools/update_versions index 571373fddb..9fed6c36e4 100755 --- a/tools/update_versions +++ b/tools/update_versions @@ -255,6 +255,6 @@ for object in objects_to_commit: object.commit() print " ", object -touch_file('../reread_db') +touch_file('reread_db') print "Touched trigger file to make feeder re-read app_version table from database" print "Done"