"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/web/lib/service/fogservice.class.php" between
fogproject-1.5.8.tar.gz and fogproject-1.5.9.tar.gz

About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.

fogservice.class.php  (fogproject-1.5.8):fogservice.class.php  (fogproject-1.5.9)
skipping to change at line 61 skipping to change at line 61
* @var array * @var array
*/ */
public $procRef = array(); public $procRef = array();
/** /**
* Process pipes * Process pipes
* *
* @var array * @var array
*/ */
public $procPipes = array(); public $procPipes = array();
/** /**
* Node IPs we have in the database to check in service startup
*
* @var array
*/
public static $knownips = array();
/**
* Initializes the FOGService class * Initializes the FOGService class
* *
* @return void * @return void
*/ */
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$logpath = trim(trim(self::getSetting('SERVICE_LOG_PATH'), '/')); $logpath = trim(trim(self::getSetting('SERVICE_LOG_PATH'), '/'));
if (!$logpath) { if (!$logpath) {
$logpath = 'opt/fog/log'; $logpath = 'opt/fog/log';
} }
self::$logpath = sprintf( self::$logpath = sprintf(
'/%s/', '/%s/',
$logpath $logpath
); );
Route::listem(
'storagenode',
'name',
false,
[ 'isEnabled' => [1] ]
);
$StorageNodes = json_decode(
Route::getData()
)->storagenodes;
foreach ((array)$StorageNodes as &$StorageNode) {
self::$knownips[] = $StorageNode->ip;
}
} }
/** /**
* Checks if the node runnning this is indeed the master * Checks if the node runnning this is indeed the master
* *
* @return array * @return array
*/ */
protected function checkIfNodeMaster() protected function checkIfNodeMaster()
{ {
self::getIPAddress(); self::getIPAddress();
$find = [ $find = [
skipping to change at line 134 skipping to change at line 152
); );
} }
/** /**
* Wait to ensure the network interface is ready * Wait to ensure the network interface is ready
* *
* @return void * @return void
*/ */
public function waitInterfaceReady() public function waitInterfaceReady()
{ {
self::getIPAddress(true); self::getIPAddress(true);
if (!count(self::$ips) || !in_array(self::getSetting('FOG_WEB_HOST'), se lf::$ips)) { if (!count(self::$ips) || !array_intersect(self::$knownips, self::$ips)) {
self::outall( self::outall(
sprintf( sprintf(
'%s: %s', '%s: %s',
_('Interface not ready, waiting for it to come up'), _('Interface not ready, waiting for it to come up'),
self::getSetting('FOG_WEB_HOST') self::getSetting('FOG_WEB_HOST')
) )
); );
sleep(10); sleep(10);
$this->waitInterfaceReady(); $this->waitInterfaceReady();
return;
} }
foreach (self::$ips as &$ip) { foreach (self::$ips as &$ip) {
self::outall( self::outall(
_("Interface Ready with IP Address: $ip") _("Interface Ready with IP Address: $ip")
); );
unset($ip); unset($ip);
} }
} }
/** /**
* Wait to ensure the DB is ready * Wait to ensure the DB is ready
 End of changes. 4 change blocks. 
1 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)