[Fedora-directory-devel] Please review and comment: [Bug 210947] Processed: parameterizing the hardcoded paths (phase 3. installed binaries, change log, setup)

Noriko Hosoi nhosoi at redhat.com
Mon Oct 23 23:17:11 UTC 2006


Summary: Processed: parameterizing the hardcoded paths (phase 3. installed binaries, change log, setup)


https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=210947


Description of problem:
Phase 3 of FHS support.
This phase should cover all the leftovers.


------- Additional Comments From nhosoi at redhat.com  2006-10-23 18:38 EST -------
Created an attachment (id=139176)
 --> (https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=139176&action=view)
ldapserver files to be changed

------- Additional Comments From nhosoi at redhat.com  2006-10-23 19:02 EST -------
Created an attachment (id=139180)
 --> (https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=139180&action=view)
cvs diffs (ldapserver)

Changes:
0) lots of makefiles are changed to adjust to the new FHS location and new
library names, which are anyway replaced with makefiles autogenerated by
autotools.  So, they can be ignored.
1) Since ds_newinst.pl is also generated by autotools, I'd like to ask to make
these changes to ds_newinst.am, too.  With this change, ds_newinst program can
get the prefix and branding info.
  Index: ldap/admin/src/ds_newinst.pl
  ===================================================================
  RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/ds_newinst.pl,v
  retrieving revision 1.8
  diff -t -w -U4 -r1.8 ds_newinst.pl
  --- ldap/admin/src/ds_newinst.pl	  27 Sep 2006 23:40:50 -0000	  1.8
  +++ ldap/admin/src/ds_newinst.pl	  23 Oct 2006 21:10:44 -0000
  @@ -164,8 +164,9 @@

  # next, construct a hash table with our arguments

  my %cgiargs = ();
 +my $brand_ds = "fedora-ds";

  # the following items are always required
  addAndCheck(\%cgiargs, "sroot", \%table, "General", "ServerRoot");
  addAndCheck(\%cgiargs, "servname", \%table, "General", "FullMachineName");
  @@ -213,9 +214,14 @@
	 $cgiargs{user_ldap_url} = $cgiargs{ldap_url};
  }

  if ($table{General}->{prefix}) {
  -	   $cgiargs{prefix} = $table{General}->{prefix};
  +	   $prefix = $table{General}->{prefix};
  +}
  +$cgiargs{prefix} = $prefix;
  +
  +if ($table{General}->{BrandDs}) {
  +	   $brand_ds = $table{General}->{BrandDs};
  }

  # populate the DS with this file - the suffix in this file must
  # be the suffix specified in the suffix argument above
  @@ -229,9 +235,9 @@

  my $sroot = $cgiargs{sroot};

  my $rc = &cgiFake($sroot, $verbose,
  -	 $sroot . "/bin/slapd/admin/bin/ds_newinst",
  +	 $prefix . "/usr/lib/$brand_ds/ds_newinst",
				   \%cgiargs);

  if (!$rc) {
	 print "Success!  Your new directory server instance was created\n";

As you could easily guess from this line:
  +$cgiargs{prefix} = $prefix;
you can send these key-value pairs to ds_newinst:
  $cgiargs(config_dir) = ...	=== dse.ldif is put
  $cgiargs(schema_dir) = ...	=== schema files are put
  $cgiargs(lock_dir) = ...	=== lock file is put
  $cgiargs(log_dir) = ...	=== errors, access, and audit logs are put
  $cgiargs(run_dir) = ...	=== pid file is put
  $cgiargs(db_dir) = ...	=== db dir
  $cgiargs(bak_dir) = ...	=== back up dir
  $cgiargs(ldif_dir) = ...	=== default location db2ldif uses
  $cgiargs(tmp_dir) = ...	=== snmp puts the stat file here
  $cgiargs(cert_dir) = ...	=== key and cert db's are put
2) As for perl task scripts, would it be okay to set PATH and LD_LIBRARY_PATH
like this and run the command?	It could call LDAP C SDK tools as well as libdb
tools.
Index: ldap/admin/src/scripts/template-db2bak.pl
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/template-db2bak.pl,v
retrieving revision 1.5
diff -t -w -U4 -r1.5 template-db2bak.pl
--- ldap/admin/src/scripts/template-db2bak.pl	13 Oct 2006 01:06:21 -0000
1.5
+++ ldap/admin/src/scripts/template-db2bak.pl	23 Oct 2006 21:10:44 -0000
@@ -114,8 +114,10 @@
 $nsdbtype = "nsDatabaseType: $dbtype\n";
 $entry = "${dn}${misc}${cn}${nsarchivedir}${nsdbtype}";
 $vstr = "";
 if ($verbose != 0) { $vstr = "-v"; }
-chdir("$prefix{{SEP}}shared{{SEP}}bin");
-open(FOO, "| $prefix{{SEP}}shared{{SEP}}bin{{SEP}}ldapmodify $vstr -h
{{SERVER-NAME}} -p {{SERVER-PORT}} -D \"$rootdn\" -w \"$passwd\" -a" );
+$ENV{'PATH'} =
'$prefix{{SEP}}usr{{SEP}}lib:{{SEP}}usr{{SEP}}lib{{SEP}}mozldap6';
+$ENV{'LD_LIBRARY_PATH'} =
'$prefix{{SEP}}usr{{SEP}}lib:{{SEP}}usr{{SEP}}lib{{SEP}}dirsec';
+$ENV{'SHLIB_PATH'} =
'$prefix{{SEP}}usr{{SEP}}lib:{{SEP}}usr{{SEP}}lib{{SEP}}dirsec';
+open(FOO, "| ldapmodify $vstr -h {{SERVER-NAME}} -p {{SERVER-PORT}} -D
\"$rootdn\" -w \"$passwd\" -a" );
 print(FOO "$entry");
 close(FOO);



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3170 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/fedora-directory-devel/attachments/20061023/c1a57e37/attachment.bin>


More information about the Fedora-directory-devel mailing list