summaryrefslogtreecommitdiffstats
path: root/pki/base/common
diff options
context:
space:
mode:
authormharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2011-02-03 18:42:02 +0000
committermharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2011-02-03 18:42:02 +0000
commit4621eaf7f389989076d70244217530f1aa8bae5c (patch)
treed23f67fa36b6e8bbfc109667350c5205c611dc79 /pki/base/common
parent9f679598437b6b0d0e596e377de300f0d75d26d6 (diff)
downloadpki-4621eaf7f389989076d70244217530f1aa8bae5c.tar.gz
pki-4621eaf7f389989076d70244217530f1aa8bae5c.tar.xz
pki-4621eaf7f389989076d70244217530f1aa8bae5c.zip
Bugzilla Bug #674917 - Restore identification of Tomcat-based PKI subsystem
instances git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1816 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/common')
-rw-r--r--pki/base/common/scripts/functions47
1 files changed, 45 insertions, 2 deletions
diff --git a/pki/base/common/scripts/functions b/pki/base/common/scripts/functions
index 812bc6aee..1fb5e65bb 100644
--- a/pki/base/common/scripts/functions
+++ b/pki/base/common/scripts/functions
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# From "http://fedoraproject.org/wiki/FCNewInit/Initscripts":
#
@@ -728,7 +728,37 @@ start_instance()
# 6 program is not configured
return 6
else
- # 0 success
+ # 0 success
+
+ # Tomcat instances automatically place pid files under
+ # '/var/run' and lock files under '/var/lock/subsys'.
+ #
+ # However, since PKI subsystem instances can have any name,
+ # in order to identify the PKI subsystem type of a particular
+ # PKI instance, we create a separate "pki subsystem identity"
+ # symlink to the PKI instance pid file and place it under
+ # '/var/run/pki/<pki subsystem>', and a separate
+ # "pki subsystem identity" symlink to the PKI instance
+ # lock file and place it under '/var/lock/pki/<pki subsystem>'.
+ #
+ case $PKI_SUBSYSTEM_TYPE in
+ ca|kra|ocsp|tks)
+ if [ -h ${PKI_PIDFILE} ]; then
+ rm -f ${PKI_PIDFILE}
+ fi
+ if [ -f ${TOMCAT_PIDFILE} ]; then
+ ln -s ${TOMCAT_PIDFILE} ${PKI_PIDFILE}
+ chown -h ${TOMCAT_USER}:${TOMCAT_GROUP} ${PKI_PIDFILE}
+ fi
+ if [ -h ${PKI_LOCKFILE} ]; then
+ rm -f ${PKI_LOCKFILE}
+ fi
+ if [ -f ${TOMCAT_LOCKFILE} ]; then
+ ln -s ${TOMCAT_LOCKFILE} ${PKI_LOCKFILE}
+ fi
+ ;;
+ esac
+
return 0
fi
fi
@@ -743,6 +773,19 @@ stop_instance()
$PKI_INSTANCE_INITSCRIPT stop
rv=$?
+ # On Tomcat subsystems, always remove the "pki subsystem identity" symlinks
+ # that were previously associated with the Tomcat 'pid' and 'lock' files.
+ case $PKI_SUBSYSTEM_TYPE in
+ ca|kra|ocsp|tks)
+ if [ -h ${PKI_PIDFILE} ]; then
+ rm -f ${PKI_PIDFILE}
+ fi
+ if [ -h ${PKI_LOCKFILE} ]; then
+ rm -f ${PKI_LOCKFILE}
+ fi
+ ;;
+ esac
+
return $rv
}