From d635a52fd965519eecb717ea5b953a5f12ef9b88 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 7 Jul 2020 16:36:46 +0200 Subject: [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 --- inc/event.inc.php | 22 ---------------------- inc/trigger.inc.php | 45 +++------------------------------------------ 2 files changed, 3 insertions(+), 64 deletions(-) (limited to 'inc') 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 @@ -93,37 +93,6 @@ class Trigger return false; } - /** - * 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. * @@ -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; - } - } -- cgit v1.2.3-55-g7522