RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1645262 - pkidestroy may not remove all files [rhel-7.6.z]
Summary: pkidestroy may not remove all files [rhel-7.6.z]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pki-core
Version: 7.4
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Dinesh Prasanth
QA Contact: Asha Akkiangady
Marc Muehlfeld
URL:
Whiteboard:
Depends On: 1372056
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-01 18:42 UTC by Oneata Mircea Teodor
Modified: 2022-03-13 15:56 UTC (History)
5 users (show)

Fixed In Version: pki-core-10.5.9-8.el7_6
Doc Type: Enhancement
Doc Text:
Previously, Certificate System removed all corresponding logs when you uninstalled subsystems. With this update, by default, the pkidestroy utility no longer removes the logs. To remove the logs when you uninstall a subsystem, pass the new --remove-logs parameter to pkidestroy. Additionally, this update adds the --force parameter to pkidestroy. Previously, an incomplete installation left some files and directories, which prevented a complete uninstallation of a Certificate System instance. Pass --force to pkidestroy to completely remove a subsystem and all corresponding files of an instance.
Clone Of: 1372056
Environment:
Last Closed: 2019-01-29 17:21:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Uninstall Log file (3.08 KB, text/plain)
2018-12-28 13:09 UTC, Sudhir Menon
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0168 0 None None None 2019-01-29 17:22:01 UTC

Description Oneata Mircea Teodor 2018-11-01 18:42:10 UTC
This bug has been copied from bug #1372056 and has been proposed to be backported to 7.6 z-stream (EUS).

Comment 3 Matthew Harmsen 2018-11-30 00:20:21 UTC
commit 7f0af3958605c9826c5bb71fcb43cfccb3056d90
Author: Dinesh Prasanth M K <dmoluguw>
Date:   Thu Nov 1 16:43:36 2018 -0400

    Add --remove-logs flag to pki-destroy
    
    Partially resolves: Bug 1372056
    
    List of changes by this commit:
    
    - Logs are preserved by default (comment #1 in BZ)
    - Add `--remove-flags` flag to pkidestroy to remove logs
    
    Signed-off-by: Dinesh Prasanth M K <dmoluguw>
    (cherry picked from commit 9e2cdb0b2f5df552ef50ba7883b4c686adec41b3)

commit 9c24a655511c911c8acc724a45f79b3ea4986b9f
Author: Dinesh Prasanth M K <dmoluguw>
Date:   Thu Nov 1 16:29:11 2018 -0400

    Add --force flag to pki-destroy
    
    Resolves: Bug 1372056
    Ticket: https://pagure.io/dogtagpki/issue/1172
    
    List of changes with this commit:
    - Adds new flag `--force` to pkidestroy to force remove a subsystem
    - Use `os.path.join()` instead of appending '/' between path names
    - Remove the `pki_database_path` dir instead of removing contents of the dir
        - This is moved to `security_database.py` instead of `configuration.py`
    - pkidestroy and pkispawn logs are owned by `root` instead of configured pki
    
    Signed-off-by: Dinesh Prasanth M K<dmoluguw>
    (cherry picked from commit 926c26e10db1b3fde8f24802d7a77419d0f2f28d)

Comment 4 Matthew Harmsen 2018-11-30 00:32:47 UTC







(In reply to Matthew Harmsen from comment #3)
> commit 7f0af3958605c9826c5bb71fcb43cfccb3056d90
> Author: Dinesh Prasanth M K <dmoluguw>
> Date:   Thu Nov 1 16:43:36 2018 -0400
> 
>     Add --remove-logs flag to pki-destroy
>     
>     Partially resolves: Bug 1372056
>     
>     List of changes by this commit:
>     
>     - Logs are preserved by default (comment #1 in BZ)
>     - Add `--remove-flags` flag to pkidestroy to remove logs
>     
>     Signed-off-by: Dinesh Prasanth M K <dmoluguw>
>     (cherry picked from commit 9e2cdb0b2f5df552ef50ba7883b4c686adec41b3)
> 
> commit 9c24a655511c911c8acc724a45f79b3ea4986b9f
> Author: Dinesh Prasanth M K <dmoluguw>
> Date:   Thu Nov 1 16:29:11 2018 -0400
> 
>     Add --force flag to pki-destroy
>     
>     Resolves: Bug 1372056
>     Ticket: https://pagure.io/dogtagpki/issue/1172
>     
>     List of changes with this commit:
>     - Adds new flag `--force` to pkidestroy to force remove a subsystem
>     - Use `os.path.join()` instead of appending '/' between path names
>     - Remove the `pki_database_path` dir instead of removing contents of the
> dir
>         - This is moved to `security_database.py` instead of
> `configuration.py`
>     - pkidestroy and pkispawn logs are owned by `root` instead of configured
> pki
>     
>     Signed-off-by: Dinesh Prasanth M K<dmoluguw>
>     (cherry picked from commit 926c26e10db1b3fde8f24802d7a77419d0f2f28d)

Cherry-picked to DOGTAG_10_5_9_RHEL_BRANCH

Comment 6 Sudhir Menon 2018-12-28 13:08:16 UTC
Observations:

1. --remove-logs flag available and working for pki-destroy command
2. --force flag available and working to pki-destroy command
3. Executed the below test scenarios but found that in 3 scenario below, the log file is not removed.

Test Cases:
* https://bugzilla.redhat.com/show_bug.cgi?id=1372056#c8
* https://bugzilla.redhat.com/show_bug.cgi?id=1372056#c9
* https://bugzilla.redhat.com/show_bug.cgi?id=1372056#c10

Attaching the logs for reference.

Comment 7 Sudhir Menon 2018-12-28 13:09:29 UTC
Created attachment 1517199 [details]
Uninstall Log file

Comment 8 Dinesh Prasanth 2019-01-02 19:16:59 UTC
(In reply to Sudhir Menon from comment #7)
> Created attachment 1517199 [details]
> Uninstall Log file

Sudhir, based on your logs attached, for scenario 3:

BEFORE FORCED UNINSTALLATION: 4 directories, 13 files
AFTER FORCED UNINSTALLATION:  0 directories, 2 files

The **pkispawn** and **pkidestroy** logs are *intentionally* stored for sysadmin's reference. The subsystem related logs are to be removed using the --remove-logs option. What you observe is the expected behavior.

Comment 9 Sudhir Menon 2019-01-03 05:41:21 UTC
Dinesh,
Thank you for confirming this behaviour. Marking the bug as VERIFIED.

Tested on RHEL7.6 
[root@master ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.6 (Maipo)

[root@master ~]# rpm -qa | grep pki
pki-server-10.5.9-10.el7_6.noarch
redhat-pki-console-theme-10.5.9-2.el7pki.noarch
redhat-pki-server-theme-10.5.9-2.el7pki.noarch
pki-console-10.5.9-1.el7pki.noarch
pki-kra-10.5.9-10.el7_6.noarch
pki-base-10.5.9-10.el7_6.noarch
pki-ca-10.5.9-10.el7_6.noarch
pki-tools-10.5.9-10.el7_6.x86_64
pki-base-java-10.5.9-10.el7_6.noarch

Comment 13 errata-xmlrpc 2019-01-29 17:21:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0168


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