diff --git a/checkin_notes b/checkin_notes index cde648856d..69f46e2587 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11907,6 +11907,10 @@ David May 2 2004 Its only role was to store the project name. This is now in the config file instead. + NOTE: if you upgrade to this code, you must add an entry + ... + to your config.xml file. + db/ boinc_db.C,h schema.sql @@ -11966,6 +11970,13 @@ David May 3 2004 *.C start +David May 3 2004 + - core client, Unix: if app is killed by SIGKILL, + put it in limbo (same as if exited zero without writing finish file). + + client/ + app.C + Rom May 3 2004 - Try to cleanup a recursive failure during a dump to stderr by changing the fprintf call in diagnostics.c @@ -12013,8 +12024,8 @@ Rom May 4 2004 db_ops.inc Rom May 4 2004 - - Use a more optimized query for the results summary page, load times go from - 8-10 seconds to 1-2 seconds + - Use a more optimized query for the results summary page, + load times go from 8-10 seconds to 1-2 seconds - Fix client_version_num bug after field was renamed to app_version_num html/inc/ @@ -12051,3 +12062,26 @@ Rom May 4 2004 - Tag for 3.03 release, all platforms boinc_core_release_3_03 seti_boinc_app_release_3_03 + +David May 5 2004 + - fixed bug where Unix client ignored QUIT signal + - rename CLIENT_STATE::cleanup_and_exit() + to CLIENT_STATE::quit_activities() + (this function does NOT exit!!!!) + - quit_client(): exit() after quitting activities + (this is why the client wasn't exiting) + - quit_client(), susp_client(), resume_client(): + print messages about which signal was received + - core client, Unix: if app is killed by SIGQUIT, + put it in limbo (same as if exited zero without writing finish file). + + client/ + app.C + client_state.h + cs_apps.C + main.C + win/ + wingui_mainwindow.cpp + tools/ + backend_lib.C + create_work.C diff --git a/client/app.C b/client/app.C index f264a4fb8d..e4834f0824 100644 --- a/client/app.C +++ b/client/app.C @@ -748,10 +748,18 @@ bool ACTIVE_TASK_SET::check_app_exited() { atp->exit_status ); } else if (WIFSIGNALED(stat)) { + int signal = WTERMSIG(stat); + + // if the process was externally killed, allow it to restart. + // + if (signal==SIGKILL || signal==SIGQUIT) { + atp->state = PROCESS_IN_LIMBO; + return true; + } atp->exit_status = stat; atp->result->exit_status = atp->exit_status; atp->state = PROCESS_WAS_SIGNALED; - atp->signal = WTERMSIG(stat); + atp->signal = signal; atp->result->signal = atp->signal; atp->result->active_task_state = PROCESS_WAS_SIGNALED; gstate.report_result_error( diff --git a/client/client_state.h b/client/client_state.h index afeb44aaac..18d6a674bf 100644 --- a/client/client_state.h +++ b/client/client_state.h @@ -178,7 +178,7 @@ private: // --------------- cs_apps.C: public: int restart_tasks(); - int cleanup_and_exit(); + int quit_activities(); int set_nslots(); double estimate_cpu_time(WORKUNIT&); double get_fraction_done(RESULT* result); diff --git a/client/cs_apps.C b/client/cs_apps.C index 88dc53f0c0..1bc866e7fa 100644 --- a/client/cs_apps.C +++ b/client/cs_apps.C @@ -54,27 +54,22 @@ int CLIENT_STATE::make_slot_dirs() { return 0; } -// Perform a graceful shutdown of the client, including quitting -// all applications, checking their final status, and writing -// the client_state.xml file (should we also terminate net_xfers here?) +// Quit running applications, quit benchmarks, +// write the client_state.xml file +// (should we also terminate net_xfers here?) // -int CLIENT_STATE::cleanup_and_exit() { +int CLIENT_STATE::quit_activities() { int retval; retval = active_tasks.exit_tasks(); if (retval) { - msg_printf(NULL, MSG_ERROR, "CLIENT_STATE.cleanup_and_exit: exit_tasks failed\n"); - // don't return here - we'll exit anyway + msg_printf(NULL, MSG_ERROR, "CLIENT_STATE.quit_activities: exit_tasks failed\n"); } retval = write_state_file(); if (retval) { - msg_printf(NULL, MSG_ERROR, "CLIENT_STATE.cleanup_and_exit: write_state_file failed\n"); - // don't return here - we'll exit anyway + msg_printf(NULL, MSG_ERROR, "CLIENT_STATE.quit_activities: write_state_file failed\n"); } - abort_cpu_benchmarks(); - - msg_printf(NULL, MSG_INFO, "Exiting BOINC client"); return 0; } diff --git a/client/main.C b/client/main.C index d97332a037..677fa575a6 100644 --- a/client/main.C +++ b/client/main.C @@ -155,22 +155,36 @@ int add_new_project() { return 0; } -void quit_client(int a) { - gstate.cleanup_and_exit(); +void quit_client(int signum) { + if (signum) { + msg_printf(NULL, MSG_INFO, "Received signal %d - exiting", signum); + } else { + msg_printf(NULL, MSG_INFO, "Exiting - user request"); + } + gstate.quit_activities(); + exit(0); } -void susp_client(int a) { +void susp_client(int signum) { + if (signum) { + msg_printf(NULL, MSG_INFO, "Received signal %d - Suspending activity", signum); + } else { + msg_printf(NULL, MSG_INFO, "Suspending activity - user request"); + } gstate.active_tasks.suspend_all(); - msg_printf(NULL, MSG_INFO, "Suspending activity - user request"); #ifndef WIN32 signal(SIGTSTP, SIG_DFL); raise(SIGTSTP); #endif } -void resume_client(int a) { +void resume_client(int signum) { gstate.active_tasks.unsuspend_all(); - msg_printf(NULL, MSG_INFO, "Resuming activity"); + if (signum) { + msg_printf(NULL, MSG_INFO, "Received signal %d: resuming activity", signum); + } else { + msg_printf(NULL, MSG_INFO, "Resuming activity"); + } } #ifdef WIN32 @@ -179,7 +193,7 @@ BOOL WINAPI ConsoleControlHandler ( DWORD dwCtrlType ){ switch( dwCtrlType ){ case CTRL_C_EVENT: if(gstate.activities_suspended) { - resume_client(NULL); + resume_client(0); } else { susp_client(NULL); } @@ -276,11 +290,11 @@ int boinc_main_loop(int argc, char** argv) { break; } if (gstate.requested_exit) { - msg_printf(NULL, MSG_INFO, "Exit requested by signal"); + msg_printf(NULL, MSG_INFO, "Exit requested by user"); break; } } - gstate.cleanup_and_exit(); + gstate.quit_activities(); return 0; } diff --git a/client/win/wingui_mainwindow.cpp b/client/win/wingui_mainwindow.cpp index d5107862ed..43d8d74a19 100755 --- a/client/win/wingui_mainwindow.cpp +++ b/client/win/wingui_mainwindow.cpp @@ -1581,7 +1581,7 @@ void CMainWindow::OnCommandExit() if (already_exited) return; already_exited = true; - gstate.cleanup_and_exit(); + gstate.quit_activities(); PostQuitMessage(0); KillTimer(m_nGuiTimerID); diff --git a/doc/client_unix.php b/doc/client_unix.php new file mode 100644 index 0000000000..13e464b823 --- /dev/null +++ b/doc/client_unix.php @@ -0,0 +1,109 @@ +The BOINC command-line client +

+Install the BOINC client by using gunzip to decompress the application. +Use 'chmod' to make it executable. +Put it in a directory by itself. +Run it manually, from your login script, +or from system startup files. +

+The command line client has several options: +"; +list_start(); +list_item("-attach_project", + "Attach this computer to a new project. + You must have an account with that project. + You will be asked for the project URL and the account ID." +); +list_item("-show_projects", + "Print a list of projects to which this computer is attached." +); + +list_item("-detach_project URL", + "Detach this computer from a project." +); + +list_item("-reset_project URL", + "Clear pending work for a project. + Use this if there is a problem that is preventing + your computer from working." +); + +list_item("-update_prefs URL", + "Contact a project's server to obtain new preferences." +); + +list_item("-run_cpu_benchmarks", + "Run CPU benchmarks. + Do this if you have modified your computer's hardware." +); +list_item("-help", + "Show client options." +); + +list_item("-version", + "Show client version." +); +list_end(); +echo" + +

Installing BOINC on Mac OS/X

+

+The Mac OS X client will unpack correctly with gunzip on Mac OS X +10.2 (jaguar) or 10.3 (panther) as long as you type the command +within Terminal. Stuffit 7.x or newer will work under the Finder +in either OS X or OS 9, but I'd recommend using 'gunzip' or 'gzip -d' +within Terminal instead. + +

+However, the two main browsers on OS X (IE 5.2.x and Safari 1.x) will +automatically unpack downloads by default, so your work may already +be done. + +

+If you use IE, the boinc client will download and automatically unpack +leaving two files: +

    +
  1. + boinc_2.12_powerpc-apple-darwin + [this will have the stuffit icon in the finder] + +
  2. + boinc_2.12_powerpc-apple-darwin7.0.0 + [this will not have any icon in the finder] + +
+

+ #2 is the unpacked program ready-to-run. You can just start Terminal + and run boinc. + +

+If you use Safari, the boinc client will download and automatically +unpack, leaving a single file: +

+ This is the unpacked program, but it's not yet ready-to-run (this is + a bug with how Safari handles gzipped downloads; we'll fix this soon). + +

+ Here's what you have to do to fix the Safari download (apologies if + you already know how to do this): + +

+ Now you can run BOINC. + "; +page_tail(); +?> diff --git a/doc/client.php b/doc/client_windows.php similarity index 57% rename from doc/client.php rename to doc/client_windows.php index 42b6590f02..353158225e 100644 --- a/doc/client.php +++ b/doc/client_windows.php @@ -1,15 +1,7 @@ -
  • Instructions for the Windows client -
  • Instructions for the command-line client -(Mac OS/X, Linus, Unix) -
  • Additional instructions for Mac OS/X - - -

    BOINC for Windows

    Install BOINC by running the installer program.

    @@ -121,111 +113,6 @@ The BOINC screensaver can be selected using the Display Properties dialog The BOINC screensaver draws graphics from a running application, if any is available. Otherwise it draws the BOINC logo bouncing around the screen. - -


    -
    -

    The BOINC command-line client

    -

    -Install the BOINC client by using gunzip to decompress the application. -Use 'chmod' to make it executable. -Put it in a directory by itself. -Run it manually, from your login script, -or from system startup files. -

    -The command line client has several options: "; -list_start(); -list_item("-attach_project", - "Attach this computer to a new project. - You must have an account with that project. - You will be asked for the project URL and the account ID." -); -list_item("-show_projects", - "Print a list of projects to which this computer is attached." -); - -list_item("-detach_project URL", - "Detach this computer from a project." -); - -list_item("-reset_project URL", - "Clear pending work for a project. - Use this if there is a problem that is preventing - your computer from working." -); - -list_item("-update_prefs URL", - "Contact a project's server to obtain new preferences." -); - -list_item("-run_cpu_benchmarks", - "Run CPU benchmarks. - Do this if you have modified your computer's hardware." -); -list_item("-help", - "Show client options." -); - -list_item("-version", - "Show client version." -); -list_end(); -echo" - -

    Installing BOINC on Mac OS/X

    -

    -The Mac OS X client will unpack correctly with gunzip on Mac OS X -10.2 (jaguar) or 10.3 (panther) as long as you type the command -within Terminal. Stuffit 7.x or newer will work under the Finder -in either OS X or OS 9, but I'd recommend using 'gunzip' or 'gzip -d' -within Terminal instead. - -

    -However, the two main browsers on OS X (IE 5.2.x and Safari 1.x) will -automatically unpack downloads by default, so your work may already -be done. - -

    -If you use IE, the boinc client will download and automatically unpack -leaving two files: -

      -
    1. - boinc_2.12_powerpc-apple-darwin - [this will have the stuffit icon in the finder] - -
    2. - boinc_2.12_powerpc-apple-darwin7.0.0 - [this will not have any icon in the finder] - -
    -

    - #2 is the unpacked program ready-to-run. You can just start Terminal - and run boinc. - -

    -If you use Safari, the boinc client will download and automatically -unpack, leaving a single file: -

    - This is the unpacked program, but it's not yet ready-to-run (this is - a bug with how Safari handles gzipped downloads; we'll fix this soon). - -

    - Here's what you have to do to fix the Safari download (apologies if - you already know how to do this): - -

    - Now you can run BOINC. - "; page_tail(); ?> diff --git a/doc/index.html b/doc/index.html index e6423a45c8..5cb9a84c28 100644 --- a/doc/index.html +++ b/doc/index.html @@ -84,6 +84,12 @@ Several other distributed computing projects are evaluating BOINC.

    News

    +May 2, 2004 +
    +General preferences are now propagated from client to server, +but only to accounts with the same email address +as where the preferences originated. +

    April 20, 2004
    Added
    cross-project identification system. diff --git a/doc/participate.php b/doc/participate.php index 4eb864491f..20c58785b1 100644 --- a/doc/participate.php +++ b/doc/participate.php @@ -8,15 +8,19 @@ echo "
  • Choosing project(s)
  • System requirements
  • Joining a project -
  • Running the BOINC client +
  • Installing and running the BOINC client +
  • Preferences
  • Host identification and merging
  • Participating in multiple projects
  • Computation credit
  • Teams
  • Compiling BOINC software yourself -
  • User-supplied FAQs by - Paul D. Buck and +
  • User-supplied FAQ by Chris Sutton
  • Leader boards diff --git a/doc/service.php b/doc/service.php new file mode 100644 index 0000000000..c65a146c94 --- /dev/null +++ b/doc/service.php @@ -0,0 +1,41 @@ + +BOINC can be run as a Windows service. +This requires the command-line interface (CLI) version of the core client, +which is not available for download; +you'll have to build it from the source code +using Visual Studio .Net. + +

    +If you haven't already run BOINC on the machine, +you'll need to run through the setup procedure +(using either the CLI or the GUI client) +in order to establish the +account* files which are needed for the project URLs and authenticators. +

    +Then put the CLI executable (boinc_cli.exe) into the BOINC folder. +Type this from the commandline: + +

    +boinc_cli -install
    +
    + +This will setup BOINC as a Windows service which can be started on boot +and will be hidden from view. +If you are executing this on a Windows 2003 machine +the default user account that is chosen is 'Network +Service' which means you'll need to grant Read/Write/Execute/Delete permissions +to the client folder and all of its children before attempting to start +the service. +On Windows XP and older systems the client currently sets +itself up as local system. +

    +Messages are logged to the 'eventlog' - check there +periodically for error and status messages. + +"; +page_tail(); +?> diff --git a/tools/backend_lib.C b/tools/backend_lib.C index 62f614e5c6..dba81688a1 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -302,46 +302,3 @@ int create_work( return 0; } - -#if 0 -int create_sequence( - DB_WORKUNIT& wu, - char* wu_template, - char* result_template_filename, - char* infile_dir, - char** infiles, - int ninfiles, - R_RSA_PRIVATE_KEY& key, - char* upload_url, char* download_url, - int nsteps -) { - int i, retval; - DB_WORKSEQ ws; - - retval = ws.insert(); - if (retval) return retval; - for (i=0; i @@ -68,7 +67,7 @@ int main(int argc, char** argv) { char wu_template_file[256], result_template_file[256]; char keyfile[256]; char** infiles = NULL; - int i, ninfiles, sequence=0; + int i, ninfiles; R_RSA_PRIVATE_KEY key; char download_dir[256], db_name[256], db_passwd[256],db_user[256],db_host[256]; char upload_url[256], download_url[256]; @@ -100,8 +99,8 @@ int main(int argc, char** argv) { } else { strcpy(db_name, config.db_name); strcpy(db_passwd, config.db_passwd); - strcpy(db_user, config.db_user); - strcpy(db_host, config.db_host); + strcpy(db_user, config.db_user); + strcpy(db_host, config.db_host); strcpy(download_url, config.download_url); strcpy(download_dir, config.download_dir); strcpy(upload_url, config.upload_url); @@ -153,8 +152,6 @@ int main(int argc, char** argv) { wu.max_total_results = atoi(argv[++i]); } else if (!strcmp(argv[i], "-max_success_results")) { wu.max_success_results = atoi(argv[++i]); - } else if (!strcmp(argv[i], "-sequence")) { - sequence = atoi(argv[++i]); } else { if (!strncmp("-",argv[i],1)) { fprintf(stderr, "create_work: bad argument '%s'\n", argv[i]); @@ -174,12 +171,6 @@ int main(int argc, char** argv) { CHKARG_STR(wu.name , "need -wu_name"); CHKARG_STR(wu_template_file , "need -wu_template"); CHKARG_STR(result_template_file , "need -result_template"); - CHKARG(wu.delay_bound , "need -delay_bound"); - CHKARG(wu.min_quorum , "need -min_quorum"); - CHKARG(wu.target_nresults , "need -target_nresults"); - CHKARG(wu.max_error_results , "need -max_error_results"); - CHKARG(wu.max_total_results , "need -max_total_results"); - CHKARG(wu.max_success_results , "need -max_success_results"); #undef CHKARG #undef CHKARG_STR @@ -209,37 +200,20 @@ int main(int argc, char** argv) { exit(1); } - if (sequence) { -#if 0 - retval = create_sequence_group( - wu, - wu_template, - result_template_file, - download_dir, - infiles, - ninfiles, - key, - upload_url, - download_url, - sequence - ); -#endif - } else { - retval = create_work( - wu, - wu_template, - result_template_file, - download_dir, - const_cast(infiles), - ninfiles, - key, - upload_url, - download_url - ); - if (retval) { - fprintf(stderr, "create_work: %d\n", retval); - exit(1); - } + retval = create_work( + wu, + wu_template, + result_template_file, + download_dir, + const_cast(infiles), + ninfiles, + key, + upload_url, + download_url + ); + if (retval) { + fprintf(stderr, "create_work: %d\n", retval); + exit(1); } boinc_db.close(); }