diff options
author | Simon Rettberg | 2020-07-07 16:36:46 +0200 |
---|---|---|
committer | Simon Rettberg | 2020-07-07 16:36:46 +0200 |
commit | d635a52fd965519eecb717ea5b953a5f12ef9b88 (patch) | |
tree | 621d70b385d35409ff5a9f93edbf42ba39ad584f /inc | |
parent | [systemstatus] Add dnbd3-master-proxy to service status (diff) | |
download | slx-admin-d635a52fd965519eecb717ea5b953a5f12ef9b88.tar.gz slx-admin-d635a52fd965519eecb717ea5b953a5f12ef9b88.tar.xz slx-admin-d635a52fd965519eecb717ea5b953a5f12ef9b88.zip |
[systemstatus/sysconfig] Manage LDADP via systemd
Finally got rid of our own little service manager. Status/restart
handling capabilities were added to the system status page.
TODO: Permissions for dnbd3, service (re)starting in general
Diffstat (limited to 'inc')
-rw-r--r-- | inc/event.inc.php | 22 | ||||
-rw-r--r-- | inc/trigger.inc.php | 45 |
2 files changed, 3 insertions, 64 deletions
diff --git a/inc/event.inc.php b/inc/event.inc.php index 16e5323a..e5ade41b 100644 --- a/inc/event.inc.php +++ b/inc/event.inc.php @@ -41,7 +41,6 @@ class Event // Tasks: fire away $mountStatus = false; $mountId = Trigger::mount(); - $ldadpId = Trigger::ldadp(); $ipxeId = Trigger::ipxe(); // Check status of all tasks @@ -53,17 +52,6 @@ class Event $mountStatus = Taskmanager::waitComplete($mountId, 5000); } - // LDAP AD Proxy - if ($ldadpId === false) { - EventLog::failure('Cannot start LDAP-AD-Proxy: Taskmanager unreachable!'); - $everythingFine = false; - } else { - $res = Taskmanager::waitComplete($ldadpId, 5000); - if (Taskmanager::isFailed($res)) { - EventLog::failure('Starting LDAP-AD-Proxy failed', $res['data']['messages']); - $everythingFine = false; - } - } // Primary IP address if (!$autoIp) { EventLog::failure("The server's IP address could not be determined automatically, and there is no valid address configured."); @@ -116,15 +104,5 @@ class Event } } - /** - * The activated configuration changed. - */ - public static function activeConfigChanged() - { - $task = Trigger::ldadp(); - if ($task === false) - return; - TaskmanagerCallback::addCallback($task, 'ldadpStartup'); - } } diff --git a/inc/trigger.inc.php b/inc/trigger.inc.php index 8ed098fc..134bab53 100644 --- a/inc/trigger.inc.php +++ b/inc/trigger.inc.php @@ -94,37 +94,6 @@ class Trigger } /** - * Launch all ldadp instances that need to be running. - * - * @param int $exclude if not NULL, id of config module NOT to start - * @param string $parent if not NULL, this will be the parent task of the launch-task - * @return boolean|string false on error, id of task otherwise - */ - public static function ldadp($exclude = NULL, $parent = NULL) - { - // TODO: Fetch list from ConfigModule_AdAuth (call loadDb first) - $res = Database::simpleQuery("SELECT DISTINCT moduleid FROM configtgz_module" - . " INNER JOIN configtgz_x_module USING (moduleid)" - . " INNER JOIN configtgz USING (configid)" - . " INNER JOIN configtgz_location USING (configid)" - . " WHERE moduletype IN ('AdAuth', 'LdapAuth')"); - $id = array(); - while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - if (!is_null($exclude) && (int)$row['moduleid'] === (int)$exclude) - continue; - $id[] = (int)$row['moduleid']; - } - $task = Taskmanager::submit('LdadpLauncher', array( - 'ids' => $id, - 'parentTask' => $parent, - 'failOnParentFail' => false - )); - if (!isset($task['id'])) - return false; - return $task['id']; - } - - /** * Mount the VM store into the server. * * @param array $vmstore VM Store configuration to use. If false, read from properties @@ -220,6 +189,9 @@ class Trigger return $parent; } + /** + * Stop any daemons that might be sitting on the VMstore, or database. + */ public static function stopDaemons($parent, &$taskids) { $parent = self::triggerDaemons('stop', $parent, $taskids); @@ -235,15 +207,4 @@ class Trigger return $parent; } - public static function startDaemons($parent, &$taskids) - { - $parent = self::triggerDaemons('start', $parent, $taskids); - $taskid = self::ldadp($parent); - if ($taskid !== false) { - $taskids['ldadpid'] = $taskid; - $parent = $taskid; - } - return $parent; - } - } |