Bug 248145 - Replace ds_newinst binary with perl script
Summary: Replace ds_newinst binary with perl script
Status: CLOSED ERRATA
Alias: None
Product: 389
Classification: Retired
Component: Install/Uninstall   
(Show other bugs)
Version: 1.1.0beta
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 240316 FDS1.1.0
TreeView+ depends on / blocked
 
Reported: 2007-07-13 13:47 UTC by Rich Megginson
Modified: 2015-01-04 23:27 UTC (History)
1 user (show)

Fixed In Version: 1.1.0-0.3.20070720.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-07-23 15:47:43 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
new DSCreate module (25.47 KB, text/plain)
2007-07-13 13:57 UTC, Rich Megginson
no flags Details
mapper for dscreate (3.14 KB, text/plain)
2007-07-13 13:58 UTC, Rich Megginson
no flags Details
mapper for dsorgentries (2.75 KB, text/plain)
2007-07-13 13:58 UTC, Rich Megginson
no flags Details
template for restart-slapd (559 bytes, text/plain)
2007-07-13 13:58 UTC, Rich Megginson
no flags Details
template for base ACIs (771 bytes, text/plain)
2007-07-13 13:59 UTC, Rich Megginson
no flags Details
template for country entries (72 bytes, text/plain)
2007-07-13 14:02 UTC, Rich Megginson
no flags Details
template for domain entries (72 bytes, text/plain)
2007-07-13 14:02 UTC, Rich Megginson
no flags Details
template for locality entries (73 bytes, text/plain)
2007-07-13 14:03 UTC, Rich Megginson
no flags Details
template for organization entries (77 bytes, text/plain)
2007-07-13 14:03 UTC, Rich Megginson
no flags Details
template for orgunit entries (84 bytes, text/plain)
2007-07-13 14:03 UTC, Rich Megginson
no flags Details
template for state entries (74 bytes, text/plain)
2007-07-13 14:04 UTC, Rich Megginson
no flags Details
diffs for ldapserver (48.47 KB, patch)
2007-07-13 14:04 UTC, Rich Megginson
no flags Details | Diff
diffs for adminserver (14.44 KB, patch)
2007-07-13 14:06 UTC, Rich Megginson
no flags Details | Diff
cvs commit log - ldapserver (4.07 KB, text/plain)
2007-07-13 18:38 UTC, Rich Megginson
no flags Details
cvs commit log - ldapserver (6.18 KB, text/plain)
2007-07-13 18:39 UTC, Rich Megginson
no flags Details
cvs commit log - adminserver (1.17 KB, text/plain)
2007-07-13 18:40 UTC, Rich Megginson
no flags Details
more commits - ldapserver (748 bytes, text/plain)
2007-07-13 19:52 UTC, Rich Megginson
no flags Details
more commits - adminserver (192 bytes, text/plain)
2007-07-13 19:54 UTC, Rich Megginson
no flags Details
removed files (2.71 KB, text/plain)
2007-07-18 19:43 UTC, Rich Megginson
no flags Details
diffs to remove files (8.12 KB, patch)
2007-07-18 19:43 UTC, Rich Megginson
no flags Details | Diff
diffs to fix exit code (4.95 KB, patch)
2007-07-18 19:45 UTC, Rich Megginson
no flags Details | Diff
cvs commit log - removal (14.10 KB, text/plain)
2007-07-18 20:52 UTC, Rich Megginson
no flags Details

Description Rich Megginson 2007-07-13 13:47:59 UTC
We need to get rid of the ldap/admin/lib and ldap/admin/src C code that does
instance creation (e.g. ds_newinst binary).

Comment 1 Rich Megginson 2007-07-13 13:57:36 UTC
Created attachment 159175 [details]
new DSCreate module

Comment 2 Rich Megginson 2007-07-13 13:58:04 UTC
Created attachment 159176 [details]
mapper for dscreate

Comment 3 Rich Megginson 2007-07-13 13:58:23 UTC
Created attachment 159177 [details]
mapper for dsorgentries

Comment 4 Rich Megginson 2007-07-13 13:58:46 UTC
Created attachment 159178 [details]
template for restart-slapd

Comment 5 Rich Megginson 2007-07-13 13:59:14 UTC
Created attachment 159179 [details]
template for base ACIs

Comment 6 Rich Megginson 2007-07-13 14:02:23 UTC
Created attachment 159181 [details]
template for country entries

Comment 7 Rich Megginson 2007-07-13 14:02:50 UTC
Created attachment 159182 [details]
template for domain entries

Comment 8 Rich Megginson 2007-07-13 14:03:16 UTC
Created attachment 159183 [details]
template for locality entries

Comment 9 Rich Megginson 2007-07-13 14:03:36 UTC
Created attachment 159184 [details]
template for organization entries

Comment 10 Rich Megginson 2007-07-13 14:03:58 UTC
Created attachment 159185 [details]
template for orgunit entries

Comment 11 Rich Megginson 2007-07-13 14:04:16 UTC
Created attachment 159186 [details]
template for state entries

Comment 12 Rich Megginson 2007-07-13 14:04:42 UTC
Created attachment 159187 [details]
diffs for ldapserver

Comment 13 Rich Megginson 2007-07-13 14:06:51 UTC
Created attachment 159188 [details]
diffs for adminserver

Comment 14 Noriko Hosoi 2007-07-13 17:55:28 UTC
Your new implementation looks good to me.

After switching to the new DSCreate module, are we dropping ds_newinst all
together including ds_newinst.pl?

Comment 15 Rich Megginson 2007-07-13 18:02:08 UTC
(In reply to comment #14)
> Your new implementation looks good to me.
> 
> After switching to the new DSCreate module, are we dropping ds_newinst all
> together including ds_newinst.pl?

I think we should just get rid of ds_newinst.pl - setup-ds.pl does the same and
more.  setup-ds.pl -s -f file.inf is the same as ds_newinst.pl file.inf

Comment 16 Rich Megginson 2007-07-13 18:38:29 UTC
Created attachment 159227 [details]
cvs commit log - ldapserver

Reviewed by: nhosoi (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: The time has come.  We can finally get rid of the instance
creation C code
once and for all.  I've created a DSCreate module that has all of the
functionality of the old
create_instance.c code, along with a few items from ldap/admin/lib.  The way it
works is
this: it first creates the dse.ldif file using template-dse.ldif and the
suffix-db template to
create the initial db and suffix.  It then adds additional optional
configuration depending
on what optional features have been enabled.  It creates other config files and
copies in
the schema.  It then initializes the database.	It uses a template file based
on the type of
entry implied by the suffix, then adds the default ACIs.  If the user chose to
do so, it
will also create the ou=people, ou=groups, etc. entries.  The user can also
supply an LDIF
file which will be used to populate the initial database, in which case none of
the default
entries or ACIs will be used.  It then starts the server (if desired).
I had to create a function makePaths that works like mkdir -p except that it
will chown,
chgrp, and chmod all paths created.
I had to change the other places where instance creation was called to use the
new
calling semantics.  ds_create changed quite a bit, since it can just use an Inf
to pass in the
information instead of calling ds_newinst as a CGI program.
I had to change FileConn to add support for namingContexts (i.e. entries with
no parent),
and to have it write each change each time, and to return copies of entries
when searching,
to avoid modifying the tree in place.  This makes it act much more like LDAP.
I found and fixed a few bugs in Migration along the way that were revealed
while integrating
the new DSCreate code.
Platforms tested: RHEL4, FC6
Flag Day: Yes.	New instance creation code and autotool changes.
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none

Comment 17 Rich Megginson 2007-07-13 18:39:41 UTC
Created attachment 159228 [details]
cvs commit log - ldapserver

Comment 18 Rich Megginson 2007-07-13 18:40:14 UTC
Created attachment 159230 [details]
cvs commit log - adminserver

Comment 19 Rich Megginson 2007-07-13 19:52:31 UTC
Created attachment 159234 [details]
more commits - ldapserver

Fix Description: 1) Inf needs to be able to read the .inf file from stdin. 
This is what ds_newinst.pl does currently.
2) getlogin seems not to work in all cases, so add a more robust replacement.
Platforms tested: RHEL4, FC6

Comment 20 Rich Megginson 2007-07-13 19:54:12 UTC
Created attachment 159235 [details]
more commits - adminserver

Comment 21 Rich Megginson 2007-07-18 19:43:07 UTC
Created attachment 159550 [details]
removed files

Comment 22 Rich Megginson 2007-07-18 19:43:41 UTC
Created attachment 159551 [details]
diffs to remove files

Comment 23 Rich Megginson 2007-07-18 19:45:18 UTC
Created attachment 159552 [details]
diffs to fix exit code

Comment 24 Noriko Hosoi 2007-07-18 20:21:24 UTC
Great!  So, we don't have 2 copies of libds_admin any more!

Comment 25 Rich Megginson 2007-07-18 20:52:29 UTC
Created attachment 159558 [details]
cvs commit log - removal

Reviewed by: nhosoi (Thanks!)
Fix Description: This is my favorite part - removing all of the now dead code.
I also had to fix the exit code so that you could use $? to test for the
success or failure of the new setup scripts.
Platforms tested: RHEL4, FC6
Flag Day: no
Doc impact: no

Comment 26 Fedora Update System 2007-07-23 15:47:30 UTC
fedora-ds-base-1.1.0-0.3.20070720.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 27 Rich Megginson 2007-07-25 21:49:58 UTC
Chandra, Fedora has marked this as CLOSED, but I assume you would still want
this bug to go through the DS8.0 QA process?

Comment 28 Chandrasekar Kannan 2007-07-25 21:55:00 UTC
yes , please leave the bugs in Fedora in MODIFIED state so that we will pick it up
and move it to VERIFIED when we get to the bug verification cycle.


Note You need to log in before you can comment on or make changes to this bug.