Bug 248145 - Replace ds_newinst binary with perl script
Replace ds_newinst binary with perl script
Status: CLOSED ERRATA
Product: 389
Classification: Community
Component: Install/Uninstall (Show other bugs)
1.1.0beta
All Linux
low Severity low
: ---
: ---
Assigned To: Rich Megginson
Chandrasekar Kannan
:
Depends On:
Blocks: 240316 FDS1.1.0
  Show dependency treegraph
 
Reported: 2007-07-13 09:47 EDT by Rich Megginson
Modified: 2015-01-04 18:27 EST (History)
1 user (show)

See Also:
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 11:47:43 EDT
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 09:57 EDT, Rich Megginson
no flags Details
mapper for dscreate (3.14 KB, text/plain)
2007-07-13 09:58 EDT, Rich Megginson
no flags Details
mapper for dsorgentries (2.75 KB, text/plain)
2007-07-13 09:58 EDT, Rich Megginson
no flags Details
template for restart-slapd (559 bytes, text/plain)
2007-07-13 09:58 EDT, Rich Megginson
no flags Details
template for base ACIs (771 bytes, text/plain)
2007-07-13 09:59 EDT, Rich Megginson
no flags Details
template for country entries (72 bytes, text/plain)
2007-07-13 10:02 EDT, Rich Megginson
no flags Details
template for domain entries (72 bytes, text/plain)
2007-07-13 10:02 EDT, Rich Megginson
no flags Details
template for locality entries (73 bytes, text/plain)
2007-07-13 10:03 EDT, Rich Megginson
no flags Details
template for organization entries (77 bytes, text/plain)
2007-07-13 10:03 EDT, Rich Megginson
no flags Details
template for orgunit entries (84 bytes, text/plain)
2007-07-13 10:03 EDT, Rich Megginson
no flags Details
template for state entries (74 bytes, text/plain)
2007-07-13 10:04 EDT, Rich Megginson
no flags Details
diffs for ldapserver (48.47 KB, patch)
2007-07-13 10:04 EDT, Rich Megginson
no flags Details | Diff
diffs for adminserver (14.44 KB, patch)
2007-07-13 10:06 EDT, Rich Megginson
no flags Details | Diff
cvs commit log - ldapserver (4.07 KB, text/plain)
2007-07-13 14:38 EDT, Rich Megginson
no flags Details
cvs commit log - ldapserver (6.18 KB, text/plain)
2007-07-13 14:39 EDT, Rich Megginson
no flags Details
cvs commit log - adminserver (1.17 KB, text/plain)
2007-07-13 14:40 EDT, Rich Megginson
no flags Details
more commits - ldapserver (748 bytes, text/plain)
2007-07-13 15:52 EDT, Rich Megginson
no flags Details
more commits - adminserver (192 bytes, text/plain)
2007-07-13 15:54 EDT, Rich Megginson
no flags Details
removed files (2.71 KB, text/plain)
2007-07-18 15:43 EDT, Rich Megginson
no flags Details
diffs to remove files (8.12 KB, patch)
2007-07-18 15:43 EDT, Rich Megginson
no flags Details | Diff
diffs to fix exit code (4.95 KB, patch)
2007-07-18 15:45 EDT, Rich Megginson
no flags Details | Diff
cvs commit log - removal (14.10 KB, text/plain)
2007-07-18 16:52 EDT, Rich Megginson
no flags Details

  None (edit)
Description Rich Megginson 2007-07-13 09:47:59 EDT
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 09:57:36 EDT
Created attachment 159175 [details]
new DSCreate module
Comment 2 Rich Megginson 2007-07-13 09:58:04 EDT
Created attachment 159176 [details]
mapper for dscreate
Comment 3 Rich Megginson 2007-07-13 09:58:23 EDT
Created attachment 159177 [details]
mapper for dsorgentries
Comment 4 Rich Megginson 2007-07-13 09:58:46 EDT
Created attachment 159178 [details]
template for restart-slapd
Comment 5 Rich Megginson 2007-07-13 09:59:14 EDT
Created attachment 159179 [details]
template for base ACIs
Comment 6 Rich Megginson 2007-07-13 10:02:23 EDT
Created attachment 159181 [details]
template for country entries
Comment 7 Rich Megginson 2007-07-13 10:02:50 EDT
Created attachment 159182 [details]
template for domain entries
Comment 8 Rich Megginson 2007-07-13 10:03:16 EDT
Created attachment 159183 [details]
template for locality entries
Comment 9 Rich Megginson 2007-07-13 10:03:36 EDT
Created attachment 159184 [details]
template for organization entries
Comment 10 Rich Megginson 2007-07-13 10:03:58 EDT
Created attachment 159185 [details]
template for orgunit entries
Comment 11 Rich Megginson 2007-07-13 10:04:16 EDT
Created attachment 159186 [details]
template for state entries
Comment 12 Rich Megginson 2007-07-13 10:04:42 EDT
Created attachment 159187 [details]
diffs for ldapserver
Comment 13 Rich Megginson 2007-07-13 10:06:51 EDT
Created attachment 159188 [details]
diffs for adminserver
Comment 14 Noriko Hosoi 2007-07-13 13:55:28 EDT
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 14:02:08 EDT
(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 14:38:29 EDT
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 14:39:41 EDT
Created attachment 159228 [details]
cvs commit log - ldapserver
Comment 18 Rich Megginson 2007-07-13 14:40:14 EDT
Created attachment 159230 [details]
cvs commit log - adminserver
Comment 19 Rich Megginson 2007-07-13 15:52:31 EDT
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 15:54:12 EDT
Created attachment 159235 [details]
more commits - adminserver
Comment 21 Rich Megginson 2007-07-18 15:43:07 EDT
Created attachment 159550 [details]
removed files
Comment 22 Rich Megginson 2007-07-18 15:43:41 EDT
Created attachment 159551 [details]
diffs to remove files
Comment 23 Rich Megginson 2007-07-18 15:45:18 EDT
Created attachment 159552 [details]
diffs to fix exit code
Comment 24 Noriko Hosoi 2007-07-18 16:21:24 EDT
Great!  So, we don't have 2 copies of libds_admin any more!
Comment 25 Rich Megginson 2007-07-18 16:52:29 EDT
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 11:47:30 EDT
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 17:49:58 EDT
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 17:55:00 EDT
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.