[Pki-devel] [PATCH] 611 Fixed pkidaemon to show TPS status.

Endi Sukma Dewata edewata at redhat.com
Thu Jun 18 04:55:27 UTC 2015


The operations script and the server.xml templates have been
modified to display TPS status in pkidaemon.

https://fedorahosted.org/pki/ticket/1278

-- 
Endi S. Dewata
-------------- next part --------------
From 2b4b8e949acd8a2bbed023c9e91a43bc6d070822 Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata at redhat.com>
Date: Wed, 17 Jun 2015 15:12:18 -0400
Subject: [PATCH] Fixed pkidaemon to show TPS status.

The operations script and the server.xml templates have been
modified to display TPS status in pkidaemon.

https://fedorahosted.org/pki/ticket/1278
---
 base/server/scripts/operations      | 27 ++++++++++++++++++++++-----
 base/server/tomcat7/conf/server.xml |  9 +++++++++
 base/server/tomcat8/conf/server.xml |  9 +++++++++
 3 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/base/server/scripts/operations b/base/server/scripts/operations
index 6f6f46ad6a8875a2bccaaf91f0292c78891fab22..0d7790ef4da370cc683ac7003b729dee696316ab 100644
--- a/base/server/scripts/operations
+++ b/base/server/scripts/operations
@@ -189,7 +189,7 @@ get_subsystems()
     PKI_SUBSYSTEMS=""
     case ${PKI_WEB_SERVER_TYPE} in
         tomcat)
-            for SUBSYSTEM in ca kra ocsp tks; do
+            for SUBSYSTEM in ca kra ocsp tks tps; do
                 if [ -d ${PKI_INSTANCE_PATH}/conf/${SUBSYSTEM} ]; then
                     if [ '${PKI_SUBSYSTEMS}' == "" ] ; then
                         PKI_SUBSYSTEMS="${SUBSYSTEM}"
@@ -200,7 +200,7 @@ get_subsystems()
             done
             ;;
         apache)
-            for SUBSYSTEM in ra tps; do
+            for SUBSYSTEM in ra; do
                 if [ -d ${PKI_INSTANCE_PATH}/conf/${SUBSYSTEM} ]; then
                     if [ '${PKI_SUBSYSTEMS}' == "" ] ; then
                         PKI_SUBSYSTEMS="${SUBSYSTEM}"
@@ -471,6 +471,7 @@ get_pki_status_definitions_tomcat()
     begin_kra_status_comment="<!-- KRA Status Definitions -->"
     begin_ocsp_status_comment="<!-- OCSP Status Definitions -->"
     begin_tks_status_comment="<!-- TKS Status Definitions -->"
+    begin_tps_status_comment="<!-- TPS Status Definitions -->"
     end_pki_status_comment="<!-- Begin DO NOT REMOVE - End PKI Status Definitions -->"
     total_ports=0
     unsecure_port_statement="Unsecure Port"
@@ -493,10 +494,12 @@ get_pki_status_definitions_tomcat()
     display_pki_kra_status_banner=0
     display_pki_ocsp_status_banner=0
     display_pki_tks_status_banner=0
+    display_pki_tps_status_banner=0
     process_pki_ca_status=0
     process_pki_kra_status=0
     process_pki_ocsp_status=0
     process_pki_tks_status=0
+    process_pki_tps_status=0
 
     # first check to see that an instance-specific "server.xml" file exists
     if [ ! -f ${PKI_SERVER_XML_CONF} ] ; then
@@ -517,6 +520,9 @@ get_pki_status_definitions_tomcat()
     if [ -e ${PKI_INSTANCE_PATH}/tks ]; then
         display_pki_tks_status_banner=1
     fi
+    if [ -e ${PKI_INSTANCE_PATH}/tps ]; then
+        display_pki_tps_status_banner=1
+    fi
 
     # read this instance-specific "server.xml" file line-by-line
     # to obtain the current PKI Status Definitions
@@ -525,8 +531,8 @@ get_pki_status_definitions_tomcat()
         # first look for the well-known end PKI Status comment
         # (to turn off processing)
         if [ "$line" == "$end_pki_status_comment" ] ; then
-            # always turn off processing TKS status at this point
-            process_pki_tks_status=0
+            # always turn off processing TPS status at this point
+            process_pki_tps_status=0
             pki_status_comment_found=0
             break;
         fi
@@ -579,10 +585,21 @@ get_pki_status_definitions_tomcat()
                      # turn on processing TKS status at this point
                      process_pki_tks_status=1
                  fi
+            elif [ "$line" == "$begin_tps_status_comment" ] ; then
+                 # always turn off processing TKS status at this point
+                 process_pki_tks_status=0
+                 if [ $display_pki_tps_status_banner -eq 1 ] ; then
+                     # print TPS Status Definition banner
+                     echo
+                     echo "    [TPS Status Definitions]"
+                     # turn on processing TPS status at this point
+                     process_pki_tps_status=1
+                 fi
             elif [ $process_pki_ca_status -eq 1 ]    ||
                  [ $process_pki_kra_status -eq 1 ]   ||
                  [ $process_pki_ocsp_status -eq 1 ]  ||
-                 [ $process_pki_tks_status -eq 1 ] ; then
+                 [ $process_pki_tks_status -eq 1 ]   ||
+                 [ $process_pki_tps_status -eq 1 ] ; then
                  # look for a PKI Status Definition and print it
                  if [ "$head" == "$unsecure_port_statement"     ]          ||
                     [ "$head" == "$secure_agent_port_statement" ]          ||
diff --git a/base/server/tomcat7/conf/server.xml b/base/server/tomcat7/conf/server.xml
index e6c4bd20113af494d997326f87ba02770acbf857..6d9cd05f6f6381993c26644a4ca29d27ef3f6aee 100644
--- a/base/server/tomcat7/conf/server.xml
+++ b/base/server/tomcat7/conf/server.xml
@@ -63,6 +63,15 @@ Secure Admin URL    = https://[PKI_HOSTNAME]:[PKI_ADMIN_SECURE_PORT]/tks/service
 PKI Console Command = pkiconsole https://[PKI_HOSTNAME]:[PKI_ADMIN_SECURE_PORT]/tks
 Tomcat Port         = [TOMCAT_SERVER_PORT] (for shutdown)
 -->
+<!-- TPS Status Definitions -->
+<!--
+Unsecure URL        = http://[PKI_HOSTNAME]:[PKI_UNSECURE_PORT]/tps
+Secure Agent URL    = https://[PKI_HOSTNAME]:[PKI_AGENT_SECURE_PORT]/tps
+Secure EE URL       = https://[PKI_HOSTNAME]:[PKI_EE_SECURE_PORT]/tps
+Secure Admin URL    = https://[PKI_HOSTNAME]:[PKI_ADMIN_SECURE_PORT]/tps
+PKI Console Command = pkiconsole https://[PKI_HOSTNAME]:[PKI_ADMIN_SECURE_PORT]/tps
+Tomcat Port         = [TOMCAT_SERVER_PORT] (for shutdown)
+-->
 <!-- DO NOT REMOVE - End PKI Status Definitions -->
 
 <Server port="[TOMCAT_SERVER_PORT]" shutdown="SHUTDOWN">
diff --git a/base/server/tomcat8/conf/server.xml b/base/server/tomcat8/conf/server.xml
index 6484239034093a174f23156c1e70d47c11836569..a5ca3c8ac02b2ff68d12879c90b8900d08dd5e84 100644
--- a/base/server/tomcat8/conf/server.xml
+++ b/base/server/tomcat8/conf/server.xml
@@ -63,6 +63,15 @@ Secure Admin URL    = https://[PKI_HOSTNAME]:[PKI_ADMIN_SECURE_PORT]/tks/service
 PKI Console Command = pkiconsole https://[PKI_HOSTNAME]:[PKI_ADMIN_SECURE_PORT]/tks
 Tomcat Port         = [TOMCAT_SERVER_PORT] (for shutdown)
 -->
+<!-- TPS Status Definitions -->
+<!--
+Unsecure URL        = http://[PKI_HOSTNAME]:[PKI_UNSECURE_PORT]/tps
+Secure Agent URL    = https://[PKI_HOSTNAME]:[PKI_AGENT_SECURE_PORT]/tps
+Secure EE URL       = https://[PKI_HOSTNAME]:[PKI_EE_SECURE_PORT]/tps
+Secure Admin URL    = https://[PKI_HOSTNAME]:[PKI_ADMIN_SECURE_PORT]/tps
+PKI Console Command = pkiconsole https://[PKI_HOSTNAME]:[PKI_ADMIN_SECURE_PORT]/tps
+Tomcat Port         = [TOMCAT_SERVER_PORT] (for shutdown)
+-->
 <!-- DO NOT REMOVE - End PKI Status Definitions -->
 
 <Server port="[TOMCAT_SERVER_PORT]" shutdown="SHUTDOWN">
-- 
1.9.3



More information about the Pki-devel mailing list