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

Endi Sukma Dewata edewata at redhat.com
Thu Jun 18 22:09:22 UTC 2015


On 6/17/2015 11:55 PM, Endi Sukma Dewata wrote:
> The operations script and the server.xml templates have been
> modified to display TPS status in pkidaemon.
>
> https://fedorahosted.org/pki/ticket/1278

ACKed by jmagne with some changes. Pushed to master.

-- 
Endi S. Dewata
-------------- next part --------------
>From 4622bfe3313941b023913a0c809a3dfdf8df117b 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      | 29 ++++++++++++++++++++++++-----
 base/server/tomcat7/conf/server.xml |  6 ++++++
 base/server/tomcat8/conf/server.xml |  6 ++++++
 3 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/base/server/scripts/operations b/base/server/scripts/operations
index 6f6f46ad6a8875a2bccaaf91f0292c78891fab22..8fa58e1ba3b589ce666cbd0064ce1b36f18cbdac 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"
@@ -480,6 +481,7 @@ get_pki_status_definitions_tomcat()
     secure_admin_port_statement="Secure Admin Port"
     pki_console_port_statement="PKI Console Port"
     unsecure_url_statement="Unsecure URL"
+    secure_url_statement="Secure URL"
     secure_agent_url_statement="Secure Agent URL"
     secure_ee_url_statement="Secure EE URL"
     secure_ee_client_auth_url_statement="EE Client Auth URL"
@@ -493,10 +495,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 +521,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 +532,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 +586,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" ]          ||
@@ -591,6 +609,7 @@ get_pki_status_definitions_tomcat()
                     [ "$head" == "$secure_ee_client_auth_port_statement" ] ||
                     [ "$head" == "$pki_console_port_statement"  ]          ||
                     [ "$head" == "$unsecure_url_statement"      ]          ||
+                    [ "$head" == "$secure_url_statement"        ]          ||
                     [ "$head" == "$secure_agent_url_statement"  ]          ||
                     [ "$head" == "$secure_ee_url_statement"     ]          ||
                     [ "$head" == "$secure_admin_url_statement"  ]          ||
diff --git a/base/server/tomcat7/conf/server.xml b/base/server/tomcat7/conf/server.xml
index e6c4bd20113af494d997326f87ba02770acbf857..81ed5c4e3c6fb73d797868c2838e112998d47c3f 100644
--- a/base/server/tomcat7/conf/server.xml
+++ b/base/server/tomcat7/conf/server.xml
@@ -63,6 +63,12 @@ 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 URL          = https://[PKI_HOSTNAME]:[PKI_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..3a6c559340d1f88360847f594326b2df528f88f8 100644
--- a/base/server/tomcat8/conf/server.xml
+++ b/base/server/tomcat8/conf/server.xml
@@ -63,6 +63,12 @@ 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 URL          = https://[PKI_HOSTNAME]:[PKI_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