#49760 Ticket 49754 - instances created with dscreate can not be upgraded with setup-ds.pl
Closed 3 years ago by spichugi. Opened 5 years ago by mreynolds.
mreynolds/389-ds-base ticket49754  into  master

@@ -37,7 +37,7 @@ 

  # This is the expected location of ldapi.

  ldapi = @localstatedir@/run/slapd-{instance_name}.socket

  pid_file = @localstatedir@/run/dirsrv/slapd-{instance_name}.pid

- inst_dir = @serverdir@

+ inst_dir = @serverdir@/slapd-{instance_name}

  plugin_dir = @serverplugindir@

  system_schema_dir = @systemschemadir@

  

@@ -36,7 +36,7 @@ 

      my $backend_entry;

      my $mtentry = $conn->search($mappingtree, "onelevel", "(cn=*)", 0, @attr);

      if (!$mtentry) {

-         return ("error_no_mapping_tree_entries", $!);

+         return ();

      }

  

      my $db_config_entry = 

@@ -40,7 +40,7 @@ 

    "user = USER\n" +

    "group = GROUP\n" +

    "initconfig_dir = /etc/sysconfig\n" +

-   "inst_dir = /usr/lib64/dirsrv\n" +

+   "inst_dir = /usr/lib64/dirsrv/slapd-{instance_name}\n" +

    "instance_name = localhost\n" +

    "ldif_dir = /var/lib/dirsrv/slapd-{instance_name}/ldif\n" +

    "lib_dir = /usr/lib64\n" +
@@ -72,7 +72,7 @@ 

    "root_password = ROOTPW\n" +

    "secure_port = SECURE_PORT\n" +

    "self_sign_cert = SELF_SIGN\n";

-   // TODO LDAPI Option (WIP)

+ 

  

  function load_server_config() {

    var mark = document.getElementById("server-config-title");

@@ -399,7 +399,7 @@ 

                  ldif_dir=slapd['ldif_dir'],

                  bak_dir=slapd['backup_dir'],

                  run_dir=slapd['run_dir'],

-                 inst_dir="",

+                 inst_dir=slapd['inst_dir'],

                  log_dir=slapd['log_dir'],

                  fqdn=general['full_machine_name'],

                  ds_port=slapd['port'],

Bug Description: If you create an instance with dscreate and try to
upgrade that instance using setup-ds.pl it will fail.
While you should not mix and match the python and perl
tools, it is still possible and it should work.

Fix Description: The first problem was that the instance dir (inst_dir)
was not set during dscreate, and second we were also not
setting the correct inst_dir in defaults.inf.

              Also dscreate does not create a backend by default,
              which caused 80upgradednformat.pl to fail on an upgrade.

              Finally updated UI's instance creation template to use
              the correct inst_dir.

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

Reviewed by: ?

With these changes nsslapd-instancedir in cn=config is populated and upgrade works. LGTM.

rebased onto 9d8887a

5 years ago

Pull-Request has been merged by mreynolds

5 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/2819

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