Mariusz Muszyński 9 lat temu
rodzic
commit
c9f66e8a02
1 zmienionych plików z 15 dodań i 6 usunięć
  1. 15 6
      SE/superedit-INSTALL_SES_PROCESY_A.php

+ 15 - 6
SE/superedit-INSTALL_SES_PROCESY_A.php

@@ -2918,9 +2918,9 @@ echo \''.$plist.'\' > /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.pl
                 $result_jdecoded = json_decode($result);
                 $state = $result_jdecoded[0]->GuestTools->state;
                 if ($i++>18) {
-                    execOnParallels('sudo launchctl load /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.plist');
+                    execOnParallels('sudo launchctl unload /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.plist');
                     execOnParallels('sudo rm -f /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.plist');
-                    execOnParallels('prlctl stop "'.$h->SERVER_ADDRESS.'"');
+                    execOnParallels('prlctl stop "'.$h->SERVER_ADDRESS.'" --kill');
                     execOnParallels('prlctl delete "'.$h->SERVER_ADDRESS.'"');
                     throw new Exception("Wystąpił problem z uruchomieniem maszyny wirtualnej, usuwam maszynę i przerywam...");
                 }
@@ -2933,12 +2933,13 @@ echo \''.$plist.'\' > /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.pl
             
             $result = execOnParallels('prlctl exec "'.$h->SERVER_ADDRESS.'" "networksetup -setdnsservers Ethernet '.$subnets[$subnet]["dns"].'"');
             DEBUG_S(-3, 'Ustawienie serwera DNS', $result);
+            sleep(2);
 
             exec("ping ".$h->SERVER_ADDRESS_IP." -c 5 -t 1 >/dev/null", $output, $exit);
             if (!$exit) {
-                execOnParallels('sudo launchctl load /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.plist');
+                execOnParallels('sudo launchctl unload /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.plist');
                 execOnParallels('sudo rm -f /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.plist');
-                execOnParallels('prlctl stop "'.$h->SERVER_ADDRESS.'"');
+                execOnParallels('prlctl stop "'.$h->SERVER_ADDRESS.'" --kill');
                 execOnParallels('prlctl delete "'.$h->SERVER_ADDRESS.'"');
                 throw new Exception('Błąd - maszyna wirtualna nie odpowiada na pingi, usuwam maszynę i przerywam...');
             }
@@ -3009,8 +3010,16 @@ echo \''.$plist.'\' > /Library/LaunchDaemons/parallels.'.$h->SERVER_ADDRESS.'.pl
                         echo " lub <a href='https://".$h->SERVER_ADDRESS.".procesy5.pl' target=_blank>https://".$h->SERVER_ADDRESS.".procesy5.pl</a>";
                 }
                 echo "</b></font><br/><br/>";
-            } else echo "<br/><font size=4 color=orange><b>Instalacja Procesy5 na ".$h->SERVER_ADDRESS." w trakcie. Odśwież stronę celem ponownej weryfikacji stanu instalacji.</b></font><br/><br/>";
-            
+            } else {
+                $cmd = 'prlctl exec biuro.bzyk.org \'ps ax|egrep "installer.*4_Procesy5|install\.bash"|grep -v grep\'';
+                $result = execOnParallels($cmd);
+                if ($result) {
+                    echo "<br/><font size=4 color=orange><b>Instalacja Procesy5 na ".$h->SERVER_ADDRESS." w trakcie. Odśwież stronę celem ponownej weryfikacji stanu
+                    instalacji.</b></font><br/><br/>";
+                    DEBUG_S(-3, "Uruchomione procesy", "<pre>".$result."</pre>");
+                }
+                else echo "<br/><font size=4 color=red><b>Instalacja Procesy5 na ".$h->SERVER_ADDRESS." zakończyła się niepowodzeniem.</b></font><br/><br/>";
+            }
             $cmd = 'prlctl exec "'.$h->SERVER_ADDRESS.'" \'cat /var/root/procesy5_install.log\'';
             $result = execOnParallels($cmd);
             DEBUG_S(-3, "Log z instalatora", "<pre>".$result."</pre>");