[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kolab-commits
Subject:    richard: server/kolabd/kolabd ChangeLog, 1.183,
From:       cvs () kolab ! org
Date:       2008-08-20 20:15:42
Message-ID: 20080820201542.4DE2360C4A6 () lists ! intevation ! de
[Download RAW message or body]

Author: richard

Update of /kolabrepository/server/kolabd/kolabd
In directory doto:/tmp/cvs-serv19157

Modified Files:
	ChangeLog kolab_bootstrap.in 
Log Message:
Added syncrepl support, see kolab/issue1755



Index: ChangeLog
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/ChangeLog,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -d -r1.183 -r1.184
--- ChangeLog	14 Aug 2008 19:33:06 -0000	1.183
+++ ChangeLog	20 Aug 2008 20:15:40 -0000	1.184
@@ -1,3 +1,7 @@
+2008-08-20 Richard Bos <richard@radoeka.nl>
+
+	* kolab_bootstrap.in: added syncrepl support, see kolab/issue1755
+
 2008-08-14 Richard Bos <richard@radoeka.nl>
 
 	* templates/slapd.conf.template.in: added syncrepl support,

Index: kolab_bootstrap.in
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/kolab_bootstrap.in,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- kolab_bootstrap.in	11 Aug 2008 19:22:55 -0000	1.39
+++ kolab_bootstrap.in	20 Aug 2008 20:15:40 -0000	1.40
@@ -17,6 +17,8 @@
 use Socket;
 use IO::File;
 use IO::Select;
+use Kolab;
+use Kolab::Conf;
 use Net::Domain qw(hostfqdn);
 use Net::LDAP;
 use Net::LDAP::Entry;
@@ -393,73 +395,24 @@
         exit 1;
       }
 
-      # Creating slapd.conf from template
-      my $tmpl = IO::File->new("@sysconfdir@/kolab/templates/slapd.conf.template", \
                "r") || die "could not read \
                @sysconfdir@/kolab/templates/slapd.conf.template";
-      my $slpd = IO::File->new("@ldapserver_confdir@/slapd.conf","w+") || die "could \
                not write to @ldapserver_confdir@/slapd.conf";
-      chmod (0640,"@ldapserver_confdir@/slapd.conf");
-      while (<$tmpl>) {
-        if (/^KOLAB_META_START$/) {
-           my $found_end;
-           while (!$found_end) {
-               $_ = <$tmpl>;
-               $found_end = /^KOLAB_META_END$/;
-           }
-           $_ = <$tmpl>;
-        }
-        s/\@\@\@base_dn\@\@\@/$base_dn/g;
-        s/\@\@\@bind_dn\@\@\@/$bind_dn/g;
-        s/\@\@\@bind_pw_hash\@\@\@/$bind_pw/g;
-        s/\@\@\@slurpd_addr\@\@\@/$slurpd_addr/g;
-        s/\@\@\@slurpd_port\@\@\@/$slurpd_port/g;
-        s/TLSCertificate/\#TLSCertificate/g;
-        print $slpd $_;
-      }
-      undef $slpd;
-      undef $tmpl;
-      kolab_chown "@ldapserver_usr@","@ldapserver_grp@","@ldapserver_confdir@/slapd.conf";
                
-      
-      my $tmplname = "@sysconfdir@/kolab/templates/slapd.replicas.template";
-      $confname = "@ldapserver_confdir@/slapd.replicas";
+      # Read the variables templatedir and log_level from kolab.globals.
+      # These variables are needed by the kolab configuration functions of
+      # Kolab::Conf need the variables.
+      %Kolab::config = Kolab::readConfig("@sysconfdir@/kolab/kolab.globals");
+      $Kolab::config{'directory_replication_mode_is_syncrepl'} = 'true' if \
($Kolab::config{'directory_mode'} eq 'syncrepl'); +      $Kolab::config{"base_dn"} = \
$base_dn; +      $Kolab::config{"bind_dn"} = $bind_dn;
+      $Kolab::config{"bind_pw_hash"} = $bind_pw;
+      $Kolab::config{"slurpd_addr"} = $slurpd_addr;
+      $Kolab::config{"slurpd_port"} = $slurpd_port;
 
-      $tmpl = IO::File->new($tmplname, "r") || die "could not read $tmplname";
-      $slpd = IO::File->new($confname,"w+") || die "could not write to $confname";
-      chmod (0640,$confname);
-      while (<$tmpl>) {
-        if (/^KOLAB_META_START$/) {
-           my $found_end;
-           while (!$found_end) {
-               $_ = <$tmpl>;
-               $found_end = /^KOLAB_META_END$/;
-           }
-           $_ = <$tmpl>;
-        }
-        print $slpd $_;
-      }
-      undef $slpd;
-      undef $tmpl;
-      kolab_chown "@ldapserver_usr@","@ldapserver_grp@",$confname;
-		
-      $tmplname = "@sysconfdir@/kolab/templates/slapd.access.template";
-      $confname = "@ldapserver_confdir@/slapd.access";
+      # During boot some settings like TLS certificates are not defined yet and
+      # hence can't be used, these definitons are skipped when
+      # bootstrap_config = true
+      $Kolab::config{"bootstrap_config"} = 'true';
+      Kolab::Conf::bootstrapConfig();
+      $Kolab::config{"bootstrap_config"} = 'false';
 
-      $tmpl = IO::File->new($tmplname, "r") || die "could not read $tmplname";
-      $slpd = IO::File->new($confname,"w+") || die "could not write to $confname";
-      chmod (0640,$confname);
-      while (<$tmpl>) {
-        if (/^KOLAB_META_START$/) {
-           my $found_end;
-           while (!$found_end) {
-               $_ = <$tmpl>;
-               $found_end = /^KOLAB_META_END$/;
-           }
-           $_ = <$tmpl>;
-        }
-        print $slpd $_;
-      }
-      undef $slpd;
-      undef $tmpl;
-      kolab_chown "@ldapserver_usr@","@ldapserver_grp@",$confname;
-		
       # now we must startup slapd
       print "temporarily starting slapd\n";
       $ldap_uri = "ldap://127.0.0.1:389/";


_______________________________________________
Kolab-commits mailing list
Kolab-commits@kolab.org
https://kolab.org/mailman/listinfo/kolab-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic