355 |
CommonServer.check_server_implementations (); |
CommonServer.check_server_implementations (); |
356 |
CommonFile.check_file_implementations (); |
CommonFile.check_file_implementations (); |
357 |
(* CommonResult.check_result_implementations (); *) |
(* CommonResult.check_result_implementations (); *) |
358 |
lprintf_nl ""; |
lprint_newline (); |
359 |
exit 0), |
exit 0), |
360 |
_s " : display information on the implementations"; |
_s " : display information on the implementations"; |
361 |
"-stdout", Arg.Unit (fun _ -> |
"-stdout", Arg.Unit (fun _ -> |
463 |
end; |
end; |
464 |
|
|
465 |
(* lprintf "(3) networks_iter load_complex_options\n"; *) |
(* lprintf "(3) networks_iter load_complex_options\n"; *) |
466 |
lprint_string (DriverControlers.text_of_html !!motd_html); |
lprintf_nl "%s" (DriverControlers.text_of_html !!motd_html); |
467 |
lprintf (_b "\nCheck http://www.mldonkey.net/ for updates\n"); |
lprintf_nl (_b "Check http://www.mldonkey.net/ for updates"); |
468 |
networks_iter (fun r -> network_load_complex_options r); |
networks_iter (fun r -> network_load_complex_options r); |
469 |
lprintf (_b "enabling networks: "); |
lprintf (_b "%senabling networks: ") (log_time ()); |
470 |
networks_iter (fun r -> |
networks_iter (fun r -> |
471 |
(* lprintf "(4) networks_iter enabling\n"; *) |
(* lprintf "(4) networks_iter enabling\n"; *) |
472 |
network_enable r; |
network_enable r; |
475 |
if !!recover_temp_on_startup then |
if !!recover_temp_on_startup then |
476 |
network_recover_temp r; |
network_recover_temp r; |
477 |
); |
); |
478 |
lprintf (_b "\ndisabled networks: "); |
lprintf (_b "\n%sdisabled networks: ") (log_time ()); |
479 |
let found = ref false in |
let found = ref false in |
480 |
networks_iter_all (fun r -> |
networks_iter_all (fun r -> |
481 |
if not (network_is_enabled r) then |
if not (network_is_enabled r) then |
484 |
lprintf (_b "%s ") r.network_name |
lprintf (_b "%s ") r.network_name |
485 |
end); |
end); |
486 |
if not !found then lprintf (_b "none"); |
if not !found then lprintf (_b "none"); |
487 |
lprintf_nl ""; |
lprint_newline (); |
488 |
CommonOptions.start_running_plugins := true; |
CommonOptions.start_running_plugins := true; |
489 |
CommonInteractive.force_download_quotas (); |
CommonInteractive.force_download_quotas (); |
490 |
|
|
512 |
Options.prune_file users_ini; |
Options.prune_file users_ini; |
513 |
(* Options.prune_file downloads_expert_ini; *) |
(* Options.prune_file downloads_expert_ini; *) |
514 |
add_timer 20. (fun _ -> try CommonWeb.load_web_infos () with _ -> ()); |
add_timer 20. (fun _ -> try CommonWeb.load_web_infos () with _ -> ()); |
515 |
lprintf (_b "To command: telnet %s %d\n") |
lprintf_nl (_b "To command: telnet %s %d") |
516 |
(if !!telnet_bind_addr = Ip.any then "127.0.0.1" |
(if !!telnet_bind_addr = Ip.any then "127.0.0.1" |
517 |
else Ip.to_string !!telnet_bind_addr) !!telnet_port; |
else Ip.to_string !!telnet_bind_addr) !!telnet_port; |
518 |
lprintf (_b "Or with browser: http://%s:%d\n") |
lprintf_nl (_b "Or with browser: http://%s:%d") |
519 |
(if !!http_bind_addr = Ip.any then "127.0.0.1" |
(if !!http_bind_addr = Ip.any then "127.0.0.1" |
520 |
else Ip.to_string !!http_bind_addr) !!http_port; |
else Ip.to_string !!http_bind_addr) !!http_port; |
521 |
lprintf (_b "For a GUI check out http://sancho-gui.sourceforge.net\n"); |
lprintf_nl (_b "For a GUI check out http://sancho-gui.sourceforge.net"); |
522 |
lprintf (_b "Connect to IP %s, port %d\n") |
lprintf_nl (_b "Connect to IP %s, port %d") |
523 |
(if !!gui_bind_addr = Ip.any then "127.0.0.1" |
(if !!gui_bind_addr = Ip.any then "127.0.0.1" |
524 |
else Ip.to_string !!gui_bind_addr) !!gui_port; |
else Ip.to_string !!gui_bind_addr) !!gui_port; |
525 |
lprintf (_b "If you connect from a remote machine adjust allowed_ips\n"); |
lprintf_nl (_b "If you connect from a remote machine adjust allowed_ips"); |
526 |
if Autoconf.system = "windows" then lprintf (_b "%s") win_message; |
if Autoconf.system = "windows" then lprintf (_b "%s") win_message; |
527 |
|
|
528 |
if Autoconf.system <> "windows" then |
if Autoconf.system <> "windows" then |
584 |
if Autoconf.system <> "windows" then |
if Autoconf.system <> "windows" then |
585 |
MlUnix.set_signal Sys.sighup |
MlUnix.set_signal Sys.sighup |
586 |
(Sys.Signal_handle (fun _ -> |
(Sys.Signal_handle (fun _ -> |
|
CommonGlobals.print_localtime (); |
|
587 |
lprintf_nl "SIGHUP"; |
lprintf_nl "SIGHUP"; |
588 |
BasicSocket.close_all (); |
BasicSocket.close_all (); |
589 |
Unix32.close_all () |
Unix32.close_all () |
601 |
(Sys.Signal_handle (fun _ -> lprintf_nl "SIGTERM"; |
(Sys.Signal_handle (fun _ -> lprintf_nl "SIGTERM"; |
602 |
CommonGlobals.exit_properly 0)); |
CommonGlobals.exit_properly 0)); |
603 |
|
|
604 |
if !verbose then lprintf_nl (_b "Activated system signal handling\n"); |
if !verbose then lprintf_nl (_b "Activated system signal handling"); |
605 |
|
|
606 |
Unix32.max_cache_size := MlUnix.max_filedescs |
Unix32.max_cache_size := MlUnix.max_filedescs |
607 |
|
|
608 |
let _ = |
let _ = |
609 |
let security_space_filename = "config_files_space.tmp" in |
let security_space_filename = "config_files_space.tmp" in |
610 |
|
|
|
CommonGlobals.print_localtime (); |
|
611 |
lprintf_nl (_b "Core started"); |
lprintf_nl (_b "Core started"); |
612 |
core_included := true; |
core_included := true; |
613 |
|
|
650 |
DriverInteractive.save_config (); |
DriverInteractive.save_config (); |
651 |
CommonComplexOptions.save_sources (); |
CommonComplexOptions.save_sources (); |
652 |
|
|
|
CommonGlobals.print_localtime (); |
|
653 |
lprintf_nl (_b "Core stopped") |
lprintf_nl (_b "Core stopped") |
654 |
); |
); |
655 |
|
|