- Timestamp:
- May 21, 2008, 8:45:07 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
system/freeze_restart.php
r357 r365 4 4 $LoopSleepTime = 10; // Checking period [seconds] 5 5 $MangosProcessName = '/a/mangos/bin/mangos-worldd'; 6 $RestartDelay = 2 * 60;7 6 8 7 include('../global.php'); … … 20 19 echo('Uptime DB: '.$DbUptime.' vs. Real: '.$RealUptime." [s], Restart condition ".$TimeDifference." > ".$RestartDeadTime. 21 20 " (".round($TimeDifference / $RestartDeadTime * 100)."%)\n"); 22 if(($TimeDifference > $RestartDeadTime) and ($Restarted == 0)) 23 { 24 echo("Restarting MaNGOS...\n"); 25 exec("ps -ef | grep '".$MangosProcessName."' | grep -v grep | awk '{print $2}' | xargs -i kill {}"); 26 $Restarted = 1; // Restart only once and wait for new good uptime 27 echo('Start delay '.$RestartDelay."\n"); 28 Sleep($RestartDelay); 29 } else $Restarted = 0; 21 if($TimeDifference > $RestartDeadTime) 22 { 23 if($Restarted == 0) 24 { 25 echo("Restarting MaNGOS...\n"); 26 exec("ps -ef | grep '".$MangosProcessName."' | grep -v grep | awk '{print $2}' | xargs -i kill {}"); 27 $Restarted = 1; // Restart only once and wait for new good uptime 28 echo("Waiting for new good uptime...\n"); 29 } 30 } else 31 { 32 if($Restarted == 1) 33 { 34 echo("MaNGOS is back online.\n"); 35 $Restarted = 0; 36 } 37 } 30 38 Sleep($LoopSleepTime); 31 39 }
Note:
See TracChangeset
for help on using the changeset viewer.