Hide Forgot
Description of problem: This problem manifests itself if there is more than one instance of a subsystem on a machine. When pkiremove is executed, it removes the registry directory /etc/sysconfig/pki/<subsystem_type> rather than the registry entry for that specific instance. (/etc/sysconfig/pki/<type>/foo). My guess is that its going through its installation manifest and sees that it created the directory - and then blows it away. The problem of course, is that any other instances of the same type then lose their own entries and become inoperable. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Install two instances of a CA using pkicreate 2. Remove one instance using pkicreate (maybe the first instance created). 3. All other instances of the same type become inoperable. Actual results: Expected results: Only the registry entries for the instance being removed should be removed. If no other instances exist, then the top level can safely be removed. Additional info:
This should be an easy fix, when you create an file or directory in pkicreate you can specify it's uninstall action, by default it's 'remove' but you can set it to 'preserve'. So all I think we need to do is set the uninstall action for /etc/sysconfig/pki/<subsystem_type> to 'preserve'. Maybe there should be an uninstall action called 'preserve_unless_empty' so we don't leave empty directories around.
Created attachment 487683 [details] preserve pki registry directory during uninstall The fix in the patch prevents /etc/sysconfig/<subsystem> from being nuked even if it wasn't empty. However, if /etc/sysconfig and it's children are empty the directories are still removed because of this code in pkiremove. I'm pretty sure this is the desired behaviour. # Establish PKI subsystem-level registry $pki_registry_subsystem_path = "$pki_registry_path/$subsystem_type"; # If empty, remove the PKI subsystem-level registry if (directory_exists($pki_registry_subsystem_path)) { if (is_directory_empty($pki_registry_subsystem_path)) { remove_directory($pki_registry_subsystem_path); } } # If empty, remove the PKI-level registry if (directory_exists($pki_registry_path)) { if (is_directory_empty($pki_registry_path)) { remove_directory($pki_registry_path); } }
Oh BTW, I did test the various scenarios, each does what is expected.
Fixed and committed. Sending base/setup/pkicreate Transmitting file data . Committed revision 1933.