| | 678 | | diagnose_cant_start_pvm( hostline ) |
| | 679 | | char *hostline; |
| | 680 | | { |
| | 681 | | FILE *fp; |
| | 682 | | |
| | 683 | | #ifndef WIN32 |
| | 684 | | struct passwd *pw; |
| | 685 | | #endif |
| | 686 | | |
| | 687 | | struct hostd hp; |
| | 688 | | |
| | | | ... |
| | 691 | | char lhost[1024]; |
| | 692 | | char pvmarch[1024]; |
| | 693 | | char pvmroot[1024]; |
| | 694 | | char pvmtmp[1024]; |
| | 695 | | char result[1024]; |
| | 696 | | char result2[1024]; |
| | 697 | | char tcmd[1024]; |
| | 698 | | char tmp[255]; |
| | 699 | | char user[1024]; |
| | 700 | | |
| | 701 | | int remote_os = -1; |
| | 702 | | int len; |
| | 703 | | int i; |
| | 704 | | |
| | 705 | | |
| | 706 | | |
| | 707 | | if ( parsehost(hostline, &hp) < 0 ) { |
| | 708 | | printf( "Error Parsing Host String!\n" ); |
| | 709 | | printf( "Cannot Auto-Diagnose!\n" ); |
| | 710 | | return( 0 ); |
| | 711 | | } |
| | 712 | | |
| | 713 | | |
| | 714 | | |
| | 715 | | gethostname( lhost, 1024 ); |
| | 716 | | |
| | 717 | | |
| | 718 | | |
| | 719 | | #ifndef WIN32 |
| | 720 | | if ( (pw = getpwuid( getuid() )) != NULL )
|
| | 721 | | strcpy( user, pw->pw_name ); |
| | 722 | | else |
| | 723 | | strcpy( user, "<your_user_name>" ); |
| | 724 | | #else |
| | 725 | | strcpy( user, MyGetUserName() ); |
| | 726 | | #endif |
| | 727 | | |
| | 728 | | |
| | 729 | | |
| | 730 | | |
| | 731 | | |
| | 732 | | |
| | 733 | | |
| | | | ... |
| | 745 | | |
| | 746 | | |
| | 747 | | |
| | 748 | | |
| | 749 | | |
| | 750 | | |
| | 751 | | |
| | 752 | | |
| | 753 | | |
| | 754 | | |
| | 755 | | printf( "Verifying Local Path to \"rsh\"...\n" ); |
| | 756 | | |
| | 757 | | strcpy( tcmd, pvmgetrsh() ); |
| | 758 | | |
| | 759 | | if ( stat( tcmd, &statck ) < 0 ) { |
| | 760 | | printf( "\nError - File %s Not Found!\n", tcmd ); |
| | 761 | | #ifndef WIN32 |
| | 762 | | printf( "Use \"whereis rsh\" or \"which rsh\" to determine\n" ); |
| | 763 | | printf( "where \"rsh\" is on your system and modify the\n" ); |
| | 764 | | printf( "$PVM_ROOT/conf/$PVM_ARCH.def configuration file\n" ); |
| | 765 | | #else |
| | 766 | | printf( "Determine the path to the \"rsh\" command on your\n" ); |
| | 767 | | printf( "system, and edit %PVM_ROOT%\\conf\\WIN32.def\n" ); |
| | 768 | | #endif |
| | 769 | | printf( "to adjust the path for the -DRSHCOMMAND=\\\"\\\"\n" ); |
| | 770 | | printf( "flag. Then recompile PVM and your applications.\n" ); |
| | 771 | | |
| | 772 | | return( 0 ); |
| | 773 | | } |
| | 774 | | else |
| | 775 | | printf( "Rsh found in %s - O.K.\n", tcmd ); |
| | 776 | | |
| | 777 | | |
| | 778 | | |
| | 779 | | if ( do_rsh_cmd( &hp, "Testing Rsh/Rhosts Access to", |
| | 780 | | "echo YES", result, 1024 ) ) { |
| | 781 | | |
| | 782 | | |
| | 783 | | if ( !strncmp( result, "YES", 3 ) ) |
| | 784 | | printf( "Rsh/Rhosts Access is O.K.\n" ); |
| | 785 | | else { |
| | 786 | | printf( "\nRsh/Rhosts Access FAILED - \"%s\"\n", result ); |
| | 787 | | printf( "Make sure host %s is up and connected to\n", |
| | 788 | | hp.hd_name ); |
| | 789 | | printf( "a network and check its DNS / IP address.\n" ); |
| | 790 | | printf( "Also verify that %s is allowed\n", lhost ); |
| | 791 | | printf( "rsh access on %s\n", hp.hd_name ); |
| | 792 | | printf( "Add this line to the $HOME/.rhosts on %s:\n", |
| | 793 | | hp.hd_name ); |
| | 794 | | printf( "%s %s\n", lhost, user ); |
| | 795 | | |
| | 796 | | return( 0 ); |
| | 797 | | } |
| | 798 | | } |
| | 799 | | else |
| | 800 | | return( 0 ); |
| | 801 | | |
| | 802 | | |
| | 803 | | |
| | 804 | | if ( do_rsh_cmd( &hp, "Checking O.S. Type (Unix test) on", |
| | 805 | | "pwd", result, 1024 ) ) { |
| | 806 | | |
| | 807 | | |
| $input_12 > 1022 | 808 | | if ( result[0] == '/' ) { |
| | 809 | | printf( "Host %s is Unix-based.\n", hp.hd_name ); |
| | 810 | | remote_os = 0; |
| | 811 | | } |
| | 812 | | else if ( do_rsh_cmd( &hp, "Checking O.S. Type (Win test) on", |