function update_from_master($rmt) { global $gbl, $sgbl, $login, $ghtml; $ver = $rmt->version; //lxfile_rm("lib/gbl.php"); //lxshell_return("cvs", "up"); if (!lx_core_lock_check_only('update.php')) { exec_with_all_closed("{$sgbl->__path_php_path} ../bin/update.php --till-version={$ver}"); //sleep(1); } }
/** * Get the status of Xen virtual machine. * * Check the status of background script. It * could have the create, createfailed or deleted. * * If not is running, it returns on or off searching * by name on xm list command. * * @author Anonymous <*****@*****.**> * @author Ángel Guzmán Maeso <*****@*****.**> * * @param string $virtual_machine_name The name of xen virtual machine * @param string $rootdir The root folder fot the virtual machine * @throws lxException * @return string The status of virtual machine */ public static function getStatus($virtual_machine_name, $rootdir) { self::checkIfXenOK(); // Check if background create script is running if (lx_core_lock_check_only('background.php', $virtual_machine_name . '.create')) { return 'create'; } // Check if background create failed if (lxfile_exists('__path_program_root/tmp/' . $virtual_machine_name . '.createfailed')) { $reason = lfile_get_contents('__path_program_root/tmp/' . $virtual_machine_name . '.createfailed'); return 'createfailed: ' . $reason; } // Check if background script is deleted if (!lxfile_exists($rootdir . '/' . $virtual_machine_name)) { return 'deleted'; } /* if (lx_core_lock("$virtual_machine_name.status")) { throw new lxException("xm_status_locked"); } */ // List info about the virtual machine exec('xm list ' . $virtual_machine_name, $output, $status); if (!empty($status)) { return 'on'; } else { return 'off'; } }
function isUpdating() { return lx_core_lock_check_only("update.php"); }
function checkIfLockedForAction($action) { return lx_core_lock_check_only("{$action}.php", "{$this->get__table()}-{$this->nname}.{$action}"); }