Bug 214276 - "rpm -e fedora-ds" uninstall doesn't remove server from configuration directory
"rpm -e fedora-ds" uninstall doesn't remove server from configuration directory
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Install/Uninstall (Show other bugs)
1.0.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Noriko Hosoi
Viktor Ashirov
:
Depends On:
Blocks: 152373 240316 FDS1.1.0
  Show dependency treegraph
 
Reported: 2006-11-06 16:02 EST by Graham Leggett
Modified: 2015-12-07 11:31 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 11:31:01 EST
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 file: admserv/cgi-src40/ds_unregister.in (2.86 KB, text/plain)
2007-08-03 16:55 EDT, Noriko Hosoi
no flags Details
New file: admserv/cfgstuff/ds_unregister.in (3.32 KB, text/plain)
2007-08-03 16:57 EDT, Noriko Hosoi
no flags Details
cvs diff Makefile.am (1.13 KB, patch)
2007-08-03 17:00 EDT, Noriko Hosoi
no flags Details | Diff
cvs commit message (1.51 KB, text/plain)
2007-08-03 18:07 EDT, Noriko Hosoi
no flags Details

  None (edit)
Description Graham Leggett 2006-11-06 16:02:37 EST
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 19:10:10 EDT
Note: unregister script needs to be implemented.
Comment 2 Noriko Hosoi 2007-08-03 16:55:28 EDT
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 16:57:43 EDT
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 17:00:44 EDT
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 17:09:36 EDT
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 17:15:20 EDT
(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 17:18:25 EDT
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 17:50:15 EDT
(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 18:07:56 EDT
Created attachment 160673 [details]
cvs commit message

Reviewed by Rich (Thank you!!)

Checked in into HEAD.
Comment 10 Michael Gregg 2007-11-21 14:51:56 EST
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 

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