[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts Setup.pm.in, 1.10,

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Mon Jul 14 19:30:05 UTC 2008

Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22602/ldapserver/ldap/admin/src/scripts

Modified Files:
      Tag: Directory_Server_8_0_Branch
Log Message:
Resolves: bug 431103
Bug Description: Cannot setup ds with remote config DS
Reviewed by: nkinder (Thanks!)
Branch: Directory_Server_8_0_Branch
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.

Index: Setup.pm.in
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/Setup.pm.in,v
retrieving revision 1.10
retrieving revision
diff -u -r1.10 -r1.10.2.1
--- Setup.pm.in	7 Sep 2007 15:02:25 -0000	1.10
+++ Setup.pm.in	14 Jul 2008 19:30:03 -0000
@@ -124,7 +124,7 @@
 sub init {
     my $self = 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 },
                'version|v' => sub { VersionMessage(); exit 0 },
@@ -133,13 +133,15 @@
                'file|f=s' => \$inffile,
                'keepcache|k' => \$keep,
                'preonly|p' => \$preonly,
-               'logfile|l=s' => \$logfile
+               'logfile|l=s' => \$logfile,
+               'update|u' => \$update
     $self->{silent} = $silent;
     $self->{inffile} = $inffile;
     $self->{keep} = $keep;
     $self->{preonly} = $preonly;
+    $self->{update} = $update;
     $self->{logfile} = $logfile;
     $self->{log} = new SetupLog($self->{logfile});
     # if user supplied inf file, use that to initialize
@@ -251,6 +253,7 @@
         $self->{dirservers} = [];
         for my $dir (glob("$self->{configdir}/slapd-*")) {
             if (-d $dir) {
+                $dir =~ s,$self->{configdir}/,,; # strip off dir part
                 push @{$self->{dirservers}}, $dir;

More information about the Fedora-directory-commits mailing list