Author: abartlet
Date: 2007-10-10 23:25:22 +0000 (Wed, 10 Oct 2007)
New Revision: 25616

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25616

Log:
Fedora DS now has a way to install the schema and extra configuration
as part of the setup inf file.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/selftest/env/Samba4.pm
   branches/SAMBA_4_0/source/setup/fedorads.inf
   branches/SAMBA_4_0/source/setup/provision-backend


Changeset:
Modified: branches/SAMBA_4_0/source/selftest/env/Samba4.pm
===================================================================
--- branches/SAMBA_4_0/source/selftest/env/Samba4.pm    2007-10-10 19:40:19 UTC 
(rev 25615)
+++ branches/SAMBA_4_0/source/selftest/env/Samba4.pm    2007-10-10 23:25:22 UTC 
(rev 25616)
@@ -192,18 +192,16 @@
 
        my $pidfile = "$fedora_ds_dir/logs/slapd-samba4.pid";
 
+       system("$self->{bindir}/ad2oLschema $configuration -H 
$ldapdir/schema-tmp.ldb --option=convert:target=fedora-ds -I 
$self->{setupdir}/schema-map-fedora-ds-1.0 -O $ldapdir/99_ad.ldif >&2") == 0 or 
die("schema conversion for Fedora DS failed");
+
 my $dir = getcwd();
 chdir "$ENV{FEDORA_DS_PREFIX}/bin" || die;
-       if (system("perl $ENV{FEDORA_DS_PREFIX}/bin/ds_newinst.pl 
$fedora_ds_inf >&2") != 0) {
+       if (system("perl $ENV{FEDORA_DS_PREFIX}/sbin/setup-ds.pl --silent 
--file=$fedora_ds_inf >&2") != 0) {
             chdir $dir;
-            die("perl $ENV{FEDORA_DS_PREFIX}/bin/ds_newinst.pl $fedora_ds_inf 
FAILED: $?");
+            die("perl $ENV{FEDORA_DS_PREFIX}/sbin/setup-ds.pl --silent 
--file=$fedora_ds_inf FAILED: $?");
         }
         chdir $dir || die;
 
-       system("cat $fedora_ds_extra_ldif >> $fedora_ds_dir/dse.ldif");
-
-       system("$self->{bindir}/ad2oLschema $configuration -H 
$ldapdir/schema-tmp.ldb --option=convert:target=fedora-ds -I 
$self->{setupdir}/schema-map-fedora-ds-1.0 -O $fedora_ds_dir/schema/99_ad.ldif 
>&2") == 0 or die("schema conversion for Fedora DS failed");
-
        return ($fedora_ds_dir, $pidfile);
 }
 

Modified: branches/SAMBA_4_0/source/setup/fedorads.inf
===================================================================
--- branches/SAMBA_4_0/source/setup/fedorads.inf        2007-10-10 19:40:19 UTC 
(rev 25615)
+++ branches/SAMBA_4_0/source/setup/fedorads.inf        2007-10-10 23:25:22 UTC 
(rev 25616)
@@ -24,4 +24,6 @@
 cert_dir= ${LDAPDIR}/slapd-samba4
 
 start_server= 0
-install_full_schema= 0
\ No newline at end of file
+install_full_schema= 0
+SchemaFile=${LDAPDIR}/99_ad.ldif
+ConfigFile = ${LDAPDIR}/fedorads-partitions.ldif

Modified: branches/SAMBA_4_0/source/setup/provision-backend
===================================================================
--- branches/SAMBA_4_0/source/setup/provision-backend   2007-10-10 19:40:19 UTC 
(rev 25615)
+++ branches/SAMBA_4_0/source/setup/provision-backend   2007-10-10 23:25:22 UTC 
(rev 25616)
@@ -97,11 +97,11 @@
 provision_schema(subobj, message, tmp_schema_ldb, paths);
 
 var mapping;
-var ext;
+var backend_schema;
 var slapd_command;
 if (options["ldap-backend-type"] == "fedora-ds") {
        mapping = "schema-map-fedora-ds-1.0";
-       ext = "ldif";
+       backend_schema = "backend-schema.ldif";
        if (options["ldap-backend-port"] != undefined) {
                message("Will listen on TCP port " + 
options["ldap-backend-port"] + "\n");
                subobj.SERVERPORT="ServerPort = " + 
options["ldap-backend-port"];
@@ -116,7 +116,7 @@
 } else if (options["ldap-backend-type"] == "openldap") {
        provision_ldapbase(subobj, message, paths);
        mapping = "schema-map-openldap-2.3";
-       ext = "schema";
+       backend_schema = "99_ad.ldif";
        setup_file("slapd.conf", message, subobj.LDAPDIR + "/slapd.conf", 
subobj);
        setup_file("modules.conf", message, subobj.LDAPDIR + "/modules.conf", 
subobj);
        sys.mkdir(subobj.LDAPDIR + "/db", 0700);
@@ -142,7 +142,7 @@
                slapd_command = "slapd -f " + subobj.LDAPDIR + "/slapd.conf -h 
" + subobj.LDAPI_URI;
        }
 }
-var schema_command = "ad2oLschema --option=convert:target=" + 
options["ldap-backend-type"] + " -I " + lp.get("setup directory") + "/" + 
mapping + " -H tdb://" + tmp_schema_ldb + " -O " + subobj.LDAPDIR + 
"/backend-schema." + ext;
+var schema_command = "ad2oLschema --option=convert:target=" + 
options["ldap-backend-type"] + " -I " + lp.get("setup directory") + "/" + 
mapping + " -H tdb://" + tmp_schema_ldb + " -O " + subobj.LDAPDIR + "/" + 
backend_schema;
 
 message("\nCreate a suitable schema file with:\n%s\n", schema_command);
 message("\nStart slapd with: \n%s\n", slapd_command);

Reply via email to