summaryrefslogtreecommitdiffstats
path: root/base/server/cmscore
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2015-01-23 13:23:53 -0500
committerEndi S. Dewata <edewata@redhat.com>2015-01-28 14:15:55 -0500
commit22ff1fbd2de37395e219a7e7362722517a3f4dc3 (patch)
treed78393aa2ace7bf5bca3a8b5108f77593b5c6061 /base/server/cmscore
parent3294ac64d9e71f76309d2cc12a2c256838fe8666 (diff)
downloadpki-22ff1fbd2de37395e219a7e7362722517a3f4dc3.tar.gz
pki-22ff1fbd2de37395e219a7e7362722517a3f4dc3.tar.xz
pki-22ff1fbd2de37395e219a7e7362722517a3f4dc3.zip
Disabling subsystem on selftest failure.
The SelfTestSubsystem has been modified such that if the selftest fails it will invoke the pki-server CLI to undeploy and disable the failing subsystem. The Tomcat instance and other subsystems not depending on this subsystem will continue to run. Once the problem is fixed, the admin can enable the subsystem again with the pki-server CLI. https://fedorahosted.org/pki/ticket/745
Diffstat (limited to 'base/server/cmscore')
-rw-r--r--base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java b/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
index c44476dd6..2a2cf8b2c 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/selftests/SelfTestSubsystem.java
@@ -885,6 +885,25 @@ public class SelfTestSubsystem
// shutdown the system gracefully
CMS.shutdown();
+ IConfigStore cs = CMS.getConfigStore();
+ String instanceID = cs.get("instanceId");
+ String subsystemID = cs.get("cs.type").toLowerCase();
+
+ System.out.println("SelfTestSubsystem: Disabling \"" + subsystemID + "\" subsystem due to selftest failure.");
+
+ try {
+ ProcessBuilder pb = new ProcessBuilder("pki-server", "subsystem-disable", "-i", instanceID, subsystemID);
+ Process process = pb.inheritIO().start();
+ int rc = process.waitFor();
+
+ if (rc != 0) {
+ System.out.println("SelfTestSubsystem: Unable to disable \"" + subsystemID + "\". RC: " + rc);
+ }
+
+ } catch (Exception e2) {
+ e.printStackTrace();
+ }
+
return;
}
}