*** empty log message ***

svn path=/trunk/boinc/; revision=11466
This commit is contained in:
David Anderson 2006-11-03 21:42:49 +00:00
parent 9738e585a8
commit 0cb8434d75
12 changed files with 66 additions and 60 deletions

View File

@ -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

View File

@ -6,7 +6,7 @@ To delete a file from a host, use the function
<pre>
delete_file(int host_id, const char* file_name)
</pre>
or the command line program
or the command line program (run from the project root dir)
<pre>
delete_file -host_id X -file_name Y
</pre>

View File

@ -9,7 +9,7 @@ This can be done using the function
get_file(int host_id, const char* file_name)
</pre>
<p>
or the command line program
or the command line program (run in the project root dir)
<pre>
get_file -host_id X -file_name Y
</pre>

View File

@ -7,7 +7,7 @@ use the function
<pre>
request_file_list(int host_id)
</pre>
or the command line program
or the command line program (run from the project root directory)
<pre>
request_file_list [ -host_id X ]
</pre>
@ -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.
<p>
???? 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();
?>

View File

@ -63,7 +63,8 @@ int get_output_file_paths(RESULT const& result, vector<string>& );
to get the paths of output files in the hierarchy.
<p>
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

View File

@ -4,17 +4,12 @@ page_head("Sending files");
echo "
To send a file to a specific host, use the function
<pre>
send_file(int host_id, const char* file_name, int priority, long int exp_date)
send_file(int host_id, const char* file_name)
</pre>
or the command line program
or the command line program (run from the project root directory)
<pre>
send_file -host_id X -file_name Y -priority Z -days_exp N
send_file -host_id X -file_name Y
</pre>
<ul>
<li> priority is the relative importance of the file (default = 1)
<li> days_exp is the number of days the file should stay on the
host (default = 100)
</ul>
<p>
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_cksum>md5</md5_cksum>
<nbytes>file->nbytes</nbytes>
<sticky/>
<priority>priority</priority>
<exp_date>exp_date</exp_date>
</file_info>
<workunit>
<name>result.name</name>

View File

@ -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 <ctime>
@ -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);

View File

@ -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<argc; i++) {
if (!strcmp(argv[i], "-host_id")) {
host_id = atoi(argv[++i]);
@ -172,31 +170,29 @@ int main(int argc, char** argv) {
}
}
// if no arguments are given, error and exit
if (!strlen(file_name) || host_id == 0) {
fprintf(stderr, "get_file: bad command line, requires a valid host_id and file_name\n");
fprintf(stderr,
"get_file: bad command line, requires a valid host_id and file_name\n"
);
exit(1);
}
// 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);
}
// open the database
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);
}
// run the get file routine
retval = get_file(host_id, file_name);
// close the database
boinc_db.close();
// return with error code if any
return retval;
}

View File

@ -17,14 +17,14 @@
// or write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//------------------------------------
//
// request_file_list [-host_id host_id]
// -host_id number of host to upload from
// or 'all' if for all active hosts
//
// Create a msg_to_host_that requests the list of permanant files
// associated with the project
//
// Run this in the project root dir
#include "config.h"
#include <unistd.h>
@ -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);

View File

@ -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
" <md5_cksum>%s</md5_cksum>\n"
" <nbytes>%.0f</nbytes>\n"
" <sticky/>\n"
" <priority>%d</priority>\n"
" <exp_days>%ld</exp_days>\n"
"</file_info>\n"
"<workunit>\n"
" <name>%s</name>\n"
@ -130,7 +130,7 @@ int create_download_message(DB_RESULT& result, int host_id, const char* file_nam
"</workunit>",
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;

View File

@ -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);

View File

@ -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"