diff --git a/checkin_notes b/checkin_notes index 44b339a980..bd77358c82 100755 --- a/checkin_notes +++ b/checkin_notes @@ -1646,3 +1646,10 @@ David 12 Feb 2007 win_build/ boinc_zip.vcproj + +David 12 Feb 2007 + - core client, Unix: add '[Family x Model x Stepping x]' in p_model string. + This will enable better homogeneous redundancy resolution + + client/ + hostinfo_unix.C diff --git a/client/client_state.C b/client/client_state.C index 25ce4e0c1d..4eb5da43b0 100644 --- a/client/client_state.C +++ b/client/client_state.C @@ -176,7 +176,7 @@ int CLIENT_STATE::init() { LPTSTR pbuf = buf; GetUserName(pbuf, &buf_size); - if (executing_as_daemon && (0 != strcmp("SYSTEM", pbuf))) { + if (executing_as_daemon && (strcmp("SYSTEM", pbuf))) { msg_printf(NULL, MSG_INFO, "BOINC is running as a service and as a non-system user." ); diff --git a/client/cs_cmdline.C b/client/cs_cmdline.C index 54a17f5a74..1dd98633e3 100644 --- a/client/cs_cmdline.C +++ b/client/cs_cmdline.C @@ -35,26 +35,26 @@ static void print_options(char* prog) { printf( "Usage: %s [options]\n" - " -help show options\n" - " -version show version info\n" - " -exit_when_idle Get/process/report work, then exit\n" - " -show_projects show attached projects\n" - " -return_results_immediately contact server when have results\n" - " -detach_project detach from a project\n" - " -reset_project reset (clear) a project\n" - " -attach_project attach to a project\n" - " -update_prefs contact a project to update preferences\n" - " -run_cpu_benchmarks run the CPU benchmarks\n" - " -check_all_logins for idle detection, check remote logins\n too" - " -allow_remote_gui_rpc allow remote GUI RPC connections\n" - " -gui_rpc_port port for GUI RPCs\n" - " -redirectio redirect stdout and stderr to log files\n" - " -detach detach from console (Windows)\n" - " -dir use given dir as BOINC home\n" - " -no_gui_rpc don't allow GUI RPC, don't make socket\n" - " -daemon run as daemon (Unix)\n" - " -insecure disable BOINC security users and permissions (Unix, Linux)\n" - " -launched_by_manager core client was launched by Manager\n" + " --help show options\n" + " --version show version info\n" + " --exit_when_idle Get/process/report work, then exit\n" + " --show_projects show attached projects\n" + " --return_results_immediately contact server when have results\n" + " --detach_project detach from a project\n" + " --reset_project reset (clear) a project\n" + " --attach_project attach to a project\n" + " --update_prefs contact a project to update preferences\n" + " --run_cpu_benchmarks run the CPU benchmarks\n" + " --check_all_logins for idle detection, check remote logins\n too" + " --allow_remote_gui_rpc allow remote GUI RPC connections\n" + " --gui_rpc_port port for GUI RPCs\n" + " --redirectio redirect stdout and stderr to log files\n" + " --detach detach from console (Windows)\n" + " --dir use given dir as BOINC home\n" + " --no_gui_rpc don't allow GUI RPC, don't make socket\n" + " --daemon run as daemon (Unix)\n" + " --insecure disable BOINC security users and permissions (Unix, Linux)\n" + " --launched_by_manager core client was launched by Manager\n" , prog ); @@ -66,6 +66,8 @@ static void print_options(char* prog) { // So just record the args here. // The actions get done in do_cmdline_actions() // +// Check for both -X (deprecated) and --X +// #define ARGX2(s1,s2) (!strcmp(argv[i], s1)||!strcmp(argv[i], s2)) #define ARG(S) ARGX2("-"#S, "--"#S) diff --git a/client/hostinfo_unix.C b/client/hostinfo_unix.C index 0357cc4bd5..38b0e580f9 100644 --- a/client/hostinfo_unix.C +++ b/client/hostinfo_unix.C @@ -248,10 +248,11 @@ bool HOST_INFO::host_is_running_on_batteries() { // See http://people.nl.linux.org/~hch/cpuinfo/ for some examples. // void parse_cpuinfo(HOST_INFO& host) { - char buf[256]; + char buf[256], features[1024], model_buf[1024]; bool vendor_found=false, model_found=false; - bool cache_found=false, flags_found=false; + bool cache_found=false, features_found=false; int n; + int family=-1, model=-1, stepping=-1; FILE* f = fopen("/proc/cpuinfo", "r"); if (!f) return; @@ -264,6 +265,7 @@ void parse_cpuinfo(HOST_INFO& host) { vendor_found = true; #endif + strcpy(features, ""); while (fgets(buf, 256, f)) { strip_whitespace(buf); if (strstr(buf, "vendor_id\t: ") || strstr(buf, "system type\t\t: ")) { @@ -278,31 +280,59 @@ void parse_cpuinfo(HOST_INFO& host) { strlcpy(host.p_model, strchr(buf, ':') + 2, sizeof(host.p_model)); } } + if (strstr(buf, "cpu family\t: ") && family<0) { + family = atoi(buf+strlen("cpu family\t: ")); + } + if (strstr(buf, "model\t\t: ") && model<0) { + model = atoi(buf+strlen("model\t\t: ")); + } + if (strstr(buf, "stepping\t: ") && stepping<0) { + stepping = atoi(buf+strlen("stepping\t: ")); + } if (!cache_found && (strstr(buf, "cache size\t: ") == buf)) { cache_found = true; sscanf(buf, "cache size\t: %d", &n); host.m_cache = n*1024; } - if (!flags_found) { + if (!features_found) { // Some versions of the linux kernel call them flags, // others call them features, so look for both. // - char buf2[256], buf3[1024]; - strcpy(buf2, ""); if ((strstr(buf, "flags\t\t: ") == buf)) { - strlcpy(buf2, strchr(buf, ':') + 2, sizeof(buf2)); + strlcpy(features, strchr(buf, ':') + 2, sizeof(features)); } else if ((strstr(buf, "features\t\t: ") == buf)) { - strlcpy(buf2, strchr(buf, ':') + 2, sizeof(buf2)); + strlcpy(features, strchr(buf, ':') + 2, sizeof(features)); } - if (strlen(buf2)) { - flags_found = true; - sprintf(buf3, "%s [%s]", host.p_model, buf2); - strlcpy(host.p_model, buf3, sizeof(host.p_model)); + if (strlen(features)) { + features_found = true; } } } + strcpy(model_buf, host.p_model); + if (family>=0 || model>=0 || stepping>0) { + strcat(model_buf, " ["); + if (family>=0) { + sprintf(buf, "Family %d ", family); + strcat(model_buf, buf); + } + if (model>=0) { + sprintf(buf, "Model %d ", model); + strcat(model_buf, buf); + } + if (stepping>=0) { + sprintf(buf, "Stepping %d", stepping); + strcat(model_buf, buf); + } + strcat(model_buf, "]"); + } + if (strlen(features)) { + strcat(model_buf, "["); + strcat(model_buf, features); + strcat(model_buf, "]"); + } + strlcpy(host.p_model, model_buf, sizeof(host.p_model)); fclose(f); } diff --git a/client/main.C b/client/main.C index cae735094f..91be10c484 100644 --- a/client/main.C +++ b/client/main.C @@ -146,8 +146,9 @@ void resume_client() { } // Trap logoff and shutdown events on Win9x so we can clean ourselves up. -LRESULT CALLBACK Win9xMonitorSystemWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ +LRESULT CALLBACK Win9xMonitorSystemWndProc( + HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam +) { if (uMsg == WM_QUERYENDSESSION) { BOINCTRACE("***** Win9x Monitor System Shutdown/Logoff Event Detected *****\n"); // Win95 is stupid, we really only need to wait until we have @@ -297,29 +298,26 @@ static void init_core_client(int argc, char** argv) { #ifndef _WIN32 if (g_use_sandbox) - umask (2); // Set file creation mask to be writable by both user and group - // Our umask will be inherited by all our child processes + // Set file creation mask to be writable by both user and group + // Our umask will be inherited by all our child processes + // + umask (2); #endif // Initialize the BOINC Diagnostics Framework - int dwDiagnosticsFlags = + int flags = BOINC_DIAG_DUMPCALLSTACKENABLED | BOINC_DIAG_HEAPCHECKENABLED | BOINC_DIAG_HEAPCHECKEVERYALLOC | BOINC_DIAG_TRACETOSTDOUT; if (gstate.redirect_io || gstate.executing_as_daemon || gstate.detach_console) { - dwDiagnosticsFlags |= + flags |= BOINC_DIAG_REDIRECTSTDERR | BOINC_DIAG_REDIRECTSTDOUT; } - diagnostics_init( - dwDiagnosticsFlags, - "stdoutdae", - "stderrdae" - ); - + diagnostics_init(flags, "stdoutdae", "stderrdae"); // Win32 - detach from console if requested #ifdef _WIN32 @@ -534,7 +532,9 @@ int finalize() { stprintf(event_message, TEXT("BOINC Core Client Error Message\n" "Failed to cleanup the BOINC Idle Detection Interface\n" - "Unload failed: %s\n"), windows_error_string(event_message, sizeof(event_message)) + "Unload failed: %s\n" + ), + windows_error_string(event_message, sizeof(event_message)) ); if (!gstate.executing_as_daemon) { fprintf(stderr, event_message); @@ -546,11 +546,13 @@ int finalize() { } #ifdef USE_WINSOCK - if ( WinsockCleanup() != 0 ) { + if (WinsockCleanup()) { stprintf(event_message, TEXT("BOINC Core Client Error Message\n" "Failed to cleanup the Windows Sockets interface\n" - "Unload failed: %s\n"), windows_error_string(event_message, sizeof(event_message)) + "Unload failed: %s\n" + ), + windows_error_string(event_message, sizeof(event_message)) ); if (!gstate.executing_as_daemon) { fprintf(stderr, event_message); @@ -561,8 +563,9 @@ int finalize() { } #endif - if (g_bIsWin9x && g_Win9xMonitorSystemThreadID) + if (g_bIsWin9x && g_Win9xMonitorSystemThreadID) { PostThreadMessage(g_Win9xMonitorSystemThreadID, WM_QUIT, 0, 0); + } #endif @@ -582,7 +585,7 @@ int main(int argc, char** argv) { PROCESS_INFORMATION pi; // Allow the system to know it is running as a Windows service - // and adjust it's diagnostics schemes accordingly. + // and adjust its diagnostics schemes accordingly. if ( (argc > 1) && ((*argv[1] == '-') || (*argv[1] == '/')) ) { if ( stricmp( "daemon", argv[1]+1 ) == 0 ) { gstate.executing_as_daemon = true; @@ -641,9 +644,11 @@ int main(int argc, char** argv) { #elif defined linux int i; - for (i = 1; i < argc; i++) { + for (i=1; i: // Detach from the controlling terminal and run in the background as system daemon. // Don't change working directory to root ("/"), but redirect @@ -716,8 +721,9 @@ int main(int argc, char** argv) { // GDB can't attach to applications which are running as a diferent user // or group, so fix up data with current user and group during debugging // - if (check_security(g_use_sandbox, false)) + if (check_security(g_use_sandbox, false)) { SetBOINCDataOwnersGroupsAndPermissions(); + } #endif // _DEBUG && __APPLE__ int i = check_security(g_use_sandbox, false); if (i) { @@ -738,8 +744,8 @@ int main(int argc, char** argv) { #endif // SANDBOX #ifdef __APPLE__ - // Initialize Mac OS X idle time measurement / idle detection - gEventHandle = NXOpenEventStatus(); + // Initialize Mac OS X idle time measurement / idle detection + gEventHandle = NXOpenEventStatus(); #endif // __APPLE__ retval = boinc_main_loop(); diff --git a/doc/client_unix.php b/doc/client_unix.php index 1b56b27ee4..dd97b015f8 100644 --- a/doc/client_unix.php +++ b/doc/client_unix.php @@ -53,65 +53,65 @@ with a running client, is provided by the

"; list_start(); -list_item("-help", +list_item("--help", "Show client options." ); -list_item("-version", +list_item("--version", "Show client version." ); -list_item("-attach_project URL account_key", +list_item("--attach_project URL account_key", "Attach this computer to a new project." ); -list_item("-show_projects", +list_item("--show_projects", "Print a list of projects to which this computer is attached." ); -list_item("-detach_project URL", +list_item("--detach_project URL", "Detach this computer from a project." ); -list_item("-reset_project URL", +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", +list_item("--update_prefs URL", "Contact a project's server to obtain new preferences. This will also report completed results and get new work if needed." ); -list_item("-return_results_immediately", - "Contact scheduler as soon as any result done." +list_item("--return_results_immediately", + "Report each result as soon as it's done." ); -list_item("-run_cpu_benchmarks", +list_item("--run_cpu_benchmarks", "Run CPU benchmarks. Do this if you have modified your computer's hardware." ); -list_item("-check_all_logins", - "If 'run if user active' preference is off, +list_item("--check_all_logins", + "(Unix) If 'run if user active' preference is off, check for input activity on all current logins; default is to check only local mouse/keyboard" ); -list_item("-exit_when_idle", +list_item("--exit_when_idle", "Get, process and report work, then exit." ); -list_item("-gui_rpc_port N", +list_item("--gui_rpc_port N", "Specify port for GUI RPCs" ); -list_item("-allow_remote_gui_rpc", +list_item("--allow_remote_gui_rpc", "Allow GUI RPCs from remote hosts" ); -list_item("-dir abs_path", +list_item("--dir abs_path", "Use the given directory as BOINC home" ); -list_item("-detach", +list_item("--detach", "Detach from console (Windows only)" ); -list_item("-no_gui_rpc", +list_item("--no_gui_rpc", "Don't allow GUI RPCs." ); -list_item("-daemon", - "Run as daemon (detach from controlling terminal; Linux only)" +list_item("--daemon", + "Linux: detach from controlling terminal; Windows: run as service" ); list_end(); echo " @@ -127,28 +127,31 @@ list_item("SOCKS5_USER", "User name for SOCKS authentication"); list_item("SOCKS5_PASSWD", "Password for SOCKS authentication"); list_end(); echo " -

Command-line options for debugging

+

Implementation and debugging command-line options

"; list_start(); -list_item(" -exit_when_idle ", - " Exit when we're not working on anything and a scheduling server +list_item(" --exit_when_idle ", + " Exit when we have no work and a scheduling server gives a 'no work' return." ); -list_item(" -no_time_test", +list_item(" --no_time_test", " Don't run performance benchmarks; used fixed numbers instead." ); -list_item(" -exit_after N", - " Exit after about N seconds" +list_item(" --exit_after_app_start N", + " Exit about N seconds after first application starts" ); -list_item(" -giveup_after N", - " Give up on file transfers after N seconds (default is 2 weeks)" -); -list_item(" -limit_transfer_rate N", - " Limit total network traffic to N bytes/sec." -); -list_item(" -min", +list_item(" --min", " Put client in the background after starting up" ); +list_item(" --skip_cpu_benchmarks", + " Don't run CPU benchmarks" +); +list_item(" --file_xfer_giveup_period N", + " Specify giveup period for file transfers" +); +list_item(" --started_by_screensaver N", + " Passed by screensaver when it launches client" +); list_end(); page_tail(); ?> diff --git a/doc/spoken_languages.php b/doc/spoken_languages.php index 804e8db0a0..d18cc41d32 100644 --- a/doc/spoken_languages.php +++ b/doc/spoken_languages.php @@ -23,6 +23,7 @@ $spoken_languages = array( 'Gujarati', 'Hausa', 'Hindi', + 'Hungarian/Magyar', 'Italian', 'Japanese', 'Javanese',