diff options
author | Simon Rettberg | 2017-06-07 14:07:47 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-06-07 14:07:47 +0200 |
commit | 56b653126088a9a3f0423aa8eb1cd215e6ec0e73 (patch) | |
tree | 06bdecf9ee1063ff000270f8e310e83b7c572530 | |
parent | [systemstatus] Show updated packages requiring reboot (diff) | |
download | slx-admin-56b653126088a9a3f0423aa8eb1cd215e6ec0e73.tar.gz slx-admin-56b653126088a9a3f0423aa8eb1cd215e6ec0e73.tar.xz slx-admin-56b653126088a9a3f0423aa8eb1cd215e6ec0e73.zip |
[inc/event] Retry mounting vmstore on bootup
-rw-r--r-- | inc/event.inc.php | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/inc/event.inc.php b/inc/event.inc.php index 89e68650..a16be97b 100644 --- a/inc/event.inc.php +++ b/inc/event.inc.php @@ -25,11 +25,12 @@ class Event Property::clearList('cron.key.blocked'); // Tasks: fire away + $mountStatus = false; $mountId = Trigger::mount(); $autoIp = Trigger::autoUpdateServerIp(); $ldadpId = Trigger::ldadp(); $ipxeId = Trigger::ipxe(); - + Taskmanager::submit('DozmodLauncher', array( 'operation' => 'start' )); @@ -40,11 +41,8 @@ class Event EventLog::info('No VM store type defined.'); $everythingFine = false; } else { - $res = Taskmanager::waitComplete($mountId, 5000); - if (Taskmanager::isFailed($res)) { - EventLog::failure('Mounting VM store failed', $res['data']['messages']); - $everythingFine = false; - } + $mountStatus = Taskmanager::waitComplete($mountId, 5000); + } // LDAP AD Proxy if ($ldadpId === false) { @@ -74,6 +72,22 @@ class Event } } + if ($mountStatus !== false && !Taskmanager::isFinished($mountStatus)) { + $mountStatus = Taskmanager::waitComplete($mountStatus, 5000); + } + if (Taskmanager::isFailed($mountStatus)) { + // One more time, network could've been down before + sleep(10); + $mountId = Trigger::mount(); + $mountStatus = Taskmanager::waitComplete($mountId, 10000); + } + if ($mountId !== false && Taskmanager::isFailed($mountStatus)) { + EventLog::failure('Mounting VM store failed', $mountStatus['data']['messages']); + $everythingFine = false; + } elseif ($mountId !== false && !Taskmanager::isFinished($mountStatus)) { + // TODO: Still running - create callback + } + // Just so we know booting is done (and we don't expect any more errors from booting up) if ($everythingFine) { EventLog::info('Bootup finished without errors.'); |