Browse Source

Resolves: bug 431103
Bug Description: Cannot setup ds with remote config DS
Reviewed by: nkinder (Thanks!)
Branch: HEAD
Fix Description: This fix has two main parts. The first part is to fix setup. I took parts out of the 01nsroot template and put them into the templates that set up the directory server and admin server. So when those servers are registered, they will create those common entries if not present, or otherwise modify them to add the necessary information. I had to add uname_m and uname_a and some other items to the mapping files. I fixed a typo in one of the template files. I changed setup to create new directory server instances shutdown, so that when they are configured for the passthrough auth plugin, it will be working when started. Otherwise, directory servers you create with setup will not be manageable in the console until after they are restarted. This is the same way that ds_create works.
The second part of the fix is to allow people to fix "broken" installs. I added a -u (update) option to setup. This will scan for exsiting installations are re-register all servers found. The dialog flow is pretty simple - it just confirms that you want to run update mode, then asks for the config ds information, then re-registers all servers with the config ds, updating any information that is missing or outdated.
Platforms tested: RHEL5, Fedora 8, Fedora 9
Flag Day: no
Doc impact: Yes - need to document the new -u option.

Rich Megginson 17 years ago
parent
commit
a0b0c1bcbd
1 changed files with 5 additions and 2 deletions
  1. 5 2
      ldap/admin/src/scripts/Setup.pm.in

+ 5 - 2
ldap/admin/src/scripts/Setup.pm.in

@@ -124,7 +124,7 @@ sub new {
 sub init {
 sub init {
     my $self = shift;
     my $self = shift;
     $self->{res} = shift;
     $self->{res} = shift;
-    my ($silent, $inffile, $keep, $preonly, $logfile);
+    my ($silent, $inffile, $keep, $preonly, $logfile, $update);
 
 
     GetOptions('help|h|?' => sub { VersionMessage(); HelpMessage(); exit 0 },
     GetOptions('help|h|?' => sub { VersionMessage(); HelpMessage(); exit 0 },
                'version|v' => sub { VersionMessage(); exit 0 },
                'version|v' => sub { VersionMessage(); exit 0 },
@@ -133,13 +133,15 @@ sub init {
                'file|f=s' => \$inffile,
                'file|f=s' => \$inffile,
                'keepcache|k' => \$keep,
                'keepcache|k' => \$keep,
                'preonly|p' => \$preonly,
                'preonly|p' => \$preonly,
-               'logfile|l=s' => \$logfile
+               'logfile|l=s' => \$logfile,
+               'update|u' => \$update
                );
                );
 
 
     $self->{silent} = $silent;
     $self->{silent} = $silent;
     $self->{inffile} = $inffile;
     $self->{inffile} = $inffile;
     $self->{keep} = $keep;
     $self->{keep} = $keep;
     $self->{preonly} = $preonly;
     $self->{preonly} = $preonly;
+    $self->{update} = $update;
     $self->{logfile} = $logfile;
     $self->{logfile} = $logfile;
     $self->{log} = new SetupLog($self->{logfile});
     $self->{log} = new SetupLog($self->{logfile});
     # if user supplied inf file, use that to initialize
     # if user supplied inf file, use that to initialize
@@ -251,6 +253,7 @@ sub getDirServers {
         $self->{dirservers} = [];
         $self->{dirservers} = [];
         for my $dir (glob("$self->{configdir}/slapd-*")) {
         for my $dir (glob("$self->{configdir}/slapd-*")) {
             if (-d $dir) {
             if (-d $dir) {
+                $dir =~ s,$self->{configdir}/,,; # strip off dir part
                 push @{$self->{dirservers}}, $dir;
                 push @{$self->{dirservers}}, $dir;
             }
             }
         }
         }