Bug 214276

Summary: "rpm -e fedora-ds" uninstall doesn't remove server from configuration directory
Product: [Retired] 389 Reporter: Graham Leggett <minfrin>
Component: Install/UninstallAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0.2CC: nkinder, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 16:31:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 152373, 240316, 427409    
Attachments:
Description Flags
New file: admserv/cgi-src40/ds_unregister.in
none
New file: admserv/cfgstuff/ds_unregister.in
none
cvs diff Makefile.am
none
cvs commit message none

Description Graham Leggett 2006-11-06 21:02:37 UTC
When an attempt is made to uninstall fedora-ds, followed by a "refresh" in the
console view, the details of the just-uninstalled machine are still in the
configuration directory.

Comment 1 Noriko Hosoi 2007-07-27 23:10:10 UTC
Note: unregister script needs to be implemented.

Comment 2 Noriko Hosoi 2007-08-03 20:55:28 UTC
Created attachment 160660 [details]
New file: admserv/cgi-src40/ds_unregister.in

Unregister CGI script, that removes the server info from the Configuration DS. 
The server is specified by InstanceName=slapd-ID in QUERY_STRING.

Comment 3 Noriko Hosoi 2007-08-03 20:57:43 UTC
Created attachment 160661 [details]
New file: admserv/cfgstuff/ds_unregister.in

Shell script which calls the CGI script ds_unregister.

Usage: sbin/ds_unregister -s server_id -w admin_password
       server_id: Directory server identifier; slapd-<server_id>
       admin_password: Administration user password

Comment 4 Noriko Hosoi 2007-08-03 21:00:44 UTC
Created attachment 160662 [details]
cvs diff Makefile.am

File: Makefile.am

Change: adding admserv/cgi-src40/ds_unregister and
admserv/cfgstuff/ds_unregister to the makefile.

Comment 5 Noriko Hosoi 2007-08-03 21:09:36 UTC
Per discussion on the Fedora-directory-users mailing list, we decided "rpm -e"
removes files and directories which are installed by "rpm -i | -U".  Generated
files won't be removed.  I.e., after running "rpm -e", binaries including
ns-slapd shoud have been removed, while the server information in the
Configuration DS db are.

It sounds the original problem is "rpm -e" does not shutdown the servers?  Once
they are shutdown, since ns-slapd is removed, there is no way to bring it up and
see the instances?

That's said, ds_unregsiter may not be needed in this scenario, but it'd be a
useful tool for the administrators.

Comment 6 Rich Megginson 2007-08-03 21:15:20 UTC
(In reply to comment #5)
> Per discussion on the Fedora-directory-users mailing list, we decided "rpm -e"
> removes files and directories which are installed by "rpm -i | -U".  Generated
> files won't be removed.  I.e., after running "rpm -e", binaries including
> ns-slapd shoud have been removed, while the server information in the
> Configuration DS db are.
> 
> It sounds the original problem is "rpm -e" does not shutdown the servers?

Yes, it is supposed to - from the ds-base spec file:
%preun
if [ $1 = 0 ]; then
        /sbin/service %{shortname} stop >/dev/null 2>&1 || :
        /sbin/chkconfig --del %{shortname}
fi

preun is called before any files are removed.  This should shutdown all
instances and remove the initscripts from being called again.

> Once
> they are shutdown, since ns-slapd is removed, there is no way to bring it up and
> see the instances?

I'm not sure what you mean by "bring it up".

> 
> That's said, ds_unregsiter may not be needed in this scenario, but it'd be a
> useful tool for the administrators.

Agreed.

Comment 7 Rich Megginson 2007-08-03 21:18:25 UTC
In your perl.in scripts, change the first line
#!/usr/bin/env perl
to be
#!@perlexec@

and change
use lib '@perllib@';
to be
use lib qw(@perlpath@);

Otherwise, looks good.

Comment 8 Noriko Hosoi 2007-08-03 21:50:15 UTC
(In reply to comment #6) 
> Yes, it is supposed to - from the ds-base spec file:
> %preun
> if [ $1 = 0 ]; then
>         /sbin/service %{shortname} stop >/dev/null 2>&1 || :
>         /sbin/chkconfig --del %{shortname}
> fi
> 
> preun is called before any files are removed.  This should shutdown all
> instances and remove the initscripts from being called again.

Great!  I think the code had fixed the original problem reported in this bug.

> > Once
> > they are shutdown, since ns-slapd is removed, there is no way to bring it up and
> > see the instances?
> 
> I'm not sure what you mean by "bring it up".

Sorry. :p  I just meant we cannot start any Directory Server instances on the
machine any more, therefore there is no chance to see them on the Console as
stated in the first report.

(In reply to comment #7) 
Thank you for your reviews!  I fixed them.

Comment 9 Noriko Hosoi 2007-08-03 22:07:56 UTC
Created attachment 160673 [details]
cvs commit message

Reviewed by Rich (Thank you!!)

Checked in into HEAD.

Comment 10 Michael Gregg 2007-11-21 19:51:56 UTC
The extra directory sercer seems to disappear from the console view after refresh.

Verified aginst:
1195673560 redhat-ds-base-8.0.0-11.el5dsrv Wed Nov 21 2007 
1195673563 redhat-ds-admin-8.0.0-1.15.el5dsrv Wed Nov 21 2007 
1195673564 redhat-ds-console-8.0.0-8.el5dsrv Wed Nov 21 2007 
1195673565 redhat-admin-console-8.0.0-9.el5dsrv Wed Nov 21 2007