#50936 Ticket 50935 - systemd override in lib389 for dscontainer
Closed 3 years ago by spichugi. Opened 4 years ago by firstyear.
firstyear/389-ds-base 50935-systemd-override  into  master

@@ -405,8 +405,8 @@ 

          # We can't assume the paths state yet ...

          self.ds_paths = Paths(instance=self, local=False)

          # Set the default systemd status. This MAY be overidden in the setup utils

-         # as required.

-         # self.systemd = self.ds_paths.with_systemd

+         # as required, generally for containers.

+         self.systemd_override = None

  

          # Reset the args (py.test reuses the args_instance for each test case)

          # We allocate a "default" prefix here which allows an un-allocate or
@@ -1721,6 +1721,8 @@ 

          return self.ds_paths.asan_enabled

  

      def with_systemd(self):

+         if self.systemd_override is not None:

+             return self.systemd_override

          return self.ds_paths.with_systemd

  

      def get_server_tls_subject(self):

@@ -811,14 +811,15 @@ 

          # Create certdb in sysconfidir

          self.log.debug("ACTION: Creating certificate database is %s", slapd['cert_dir'])

  

-         # BELOWE THIS LINE - all actions are now ONLINE changes to the directory server.

+         # BELOW THIS LINE - all actions are now ONLINE changes to the directory server.

          # if it all possible, ALWAYS ADD NEW INSTALLER CHANGES AS ONLINE ACTIONS.

  

          # Should I move this import? I think this prevents some recursion

          from lib389 import DirSrv

          ds_instance = DirSrv(self.verbose)

-         # if self.containerised:

-         #     ds_instance.systemd = general['systemd']

+         if self.containerised:

+             ds_instance.systemd_override = general['systemd']

+ 

          args = {

              SER_PORT: slapd['port'],

              SER_SERVERID_PROP: slapd['instance_name'],

Bug Description: A change to how with_systemd works has caused dscontainer
to no longer be able to setup instances, as with_systemd always evals to
true from defaults.inf as the marker file isn't written yet - post setup
this works.

Fix Description: To resolve this, a systemd override is required, that
allows the setup to ignore the systemd status as the external tools
"know better" than defaults inf up to that point. Post install, this
works as the marker would be inplace.

https://pagure.io/389-ds-base/issue/50935

Author: William Brown william@blackhats.net.au

Review by: ???

rebased onto 13fdda212230d17147e9b548b9d54934f106ff1d

4 years ago

Pull-Request has been merged by firstyear

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3989

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago