#1172 Add forced instance removal

Created 3 years ago by edewata
Modified 3 months ago

Sometimes when pkispawn fails it might leave the machine in an inconsistent state. When that happens the pkidestroy might fail and subsequent pkispawn might also fail, so the machine would become unusable. The only recourse is a manual cleanup which might not be very well documented.

The pkidestroy should provide a way to remove the entire instance regardless of the status of the installation. For example:

$ pkidestroy -i pki-tomcat

In this case the pkidestroy should perform the following cleanup operations:

# kill Tomcat instance
pids="`ps -ef | grep catalina.base=/var/lib/pki/$INSTANCE_NAME | grep -v grep | awk '{print $2}'`"
for pid in $pids; do
    kill -9 $pid
done

# remove DS instance
remove-ds.pl -f -i slapd-$INSTANCE_NAME

# remove instance files
rm -rf /etc/pki/$INSTANCE_NAME
rm -rf /etc/sysconfig/$INSTANCE_NAME
rm -rf /etc/sysconfig/pki/tomcat/$INSTANCE_NAME
rm -rf /var/lib/pki/$INSTANCE_NAME
rm -rf /var/log/pki/$INSTANCE_NAME
rm -rf $HOME/.dogtag/$INSTANCE_NAME

To ensure the machine will return into a consistent state, each of these operations should be executed regardless of the result of any other operations.

Ticket #2426 is a duplicate of this ticket.

a year ago

Metadata Update from @edewata:
- Issue set to the milestone: 10.4

a year ago

Metadata Update from @mharmsen:
- Custom field feature adjusted to ''
- Custom field proposedmilestone adjusted to ''
- Custom field proposedpriority adjusted to ''
- Custom field reviewer adjusted to ''
- Custom field version adjusted to ''
- Issue close_status updated to: None
- Issue priority set to: 3 (was: 2)

Per CS/DS Meeting of August 7, 2017, it was determined to move this issue from 10.4 ==> FUTURE.

11 months ago

Metadata Update from @mharmsen:
- Issue set to the milestone: FUTURE (was: 10.4)

11 months ago

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.5 (was: FUTURE)

[20171025] - Offline Triage ==> 10.6

9 months ago

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.6 (was: 10.5)

Per 10.5.x/10.6 Triage: 10.5.x

alee: this is related to dogtagpki Pagure Issue #2712. Fixing this will help ipa and other installs in cases of install failure.

3 months ago

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.5 (was: 10.6)

Login to comment on this ticket.

enhancement

Installation/Configuration

''

''

Community

''

''

''

cancel