diff options
Diffstat (limited to 'base/server')
9 files changed, 43 insertions, 28 deletions
diff --git a/base/server/etc/default.cfg b/base/server/etc/default.cfg index 2cb887d09..aa97e1fe6 100644 --- a/base/server/etc/default.cfg +++ b/base/server/etc/default.cfg @@ -11,6 +11,8 @@ ############################################################################### [DEFAULT] +JAVA_HOME=%(java_home)s + # The sensitive_parameters contains a list of parameters which may contain # sensitive information which must not be displayed to the console nor stored # in log files for security reasons. diff --git a/base/server/python/pki/server/deployment/pkihelper.py b/base/server/python/pki/server/deployment/pkihelper.py index 1be984d12..0145b4926 100644 --- a/base/server/python/pki/server/deployment/pkihelper.py +++ b/base/server/python/pki/server/deployment/pkihelper.py @@ -1818,7 +1818,10 @@ class File: except KeyError: # undefined parameter, skip - pass + config.pki_log.debug( + 'ignoring slot [%s]', + line[begin:end + 1], + extra=config.PKI_INDENTATION_LEVEL_3) # find the next parameter in the remainder of the line begin = line.find('[', end + 1) diff --git a/base/server/python/pki/server/deployment/pkiparser.py b/base/server/python/pki/server/deployment/pkiparser.py index fb569d0d7..b1fc21310 100644 --- a/base/server/python/pki/server/deployment/pkiparser.py +++ b/base/server/python/pki/server/deployment/pkiparser.py @@ -170,9 +170,18 @@ class PKIConfigParser: def init_config(self): + java_home = subprocess.check_output( + '. /usr/share/pki/etc/pki.conf && . /etc/pki/pki.conf ' + '&& echo $JAVA_HOME', + shell=True) + java_home = java_home.decode(sys.getfilesystemencoding()) + # workaround for pylint error E1103 + java_home = java_home.strip() + # RESTEasy resteasy_lib = subprocess.check_output( - '. /etc/pki/pki.conf && echo $RESTEASY_LIB', + '. /usr/share/pki/etc/pki.conf && . /etc/pki/pki.conf ' + '&& echo $RESTEASY_LIB', shell=True) resteasy_lib = resteasy_lib.decode(sys.getfilesystemencoding()) # workaround for pylint error E1103 @@ -203,6 +212,7 @@ class PKIConfigParser: 'pki_subsystem': config.pki_subsystem, 'pki_subsystem_type': config.pki_subsystem.lower(), 'pki_root_prefix': config.pki_root_prefix, + 'java_home': java_home, 'resteasy_lib': resteasy_lib, 'jni_jar_dir': jni_jar_dir, 'home_dir': os.path.expanduser("~"), diff --git a/base/server/python/pki/server/deployment/scriptlets/instance_layout.py b/base/server/python/pki/server/deployment/scriptlets/instance_layout.py index 98d82ff98..57f8537e0 100644 --- a/base/server/python/pki/server/deployment/scriptlets/instance_layout.py +++ b/base/server/python/pki/server/deployment/scriptlets/instance_layout.py @@ -55,6 +55,18 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): deployer.mdict['pki_instance_configuration_path'], ignore_cb=file_ignore_callback_src_server) + # create /etc/sysconfig/<instance> + deployer.file.copy_with_slot_substitution( + deployer.mdict['pki_source_tomcat_conf'], + deployer.mdict['pki_target_tomcat_conf_instance_id'], + uid=0, gid=0, overwrite_flag=True) + + # create /var/lib/pki/<instance>/conf/tomcat.conf + deployer.file.copy_with_slot_substitution( + deployer.mdict['pki_source_tomcat_conf'], + deployer.mdict['pki_target_tomcat_conf'], + overwrite_flag=True) + # Deploy ROOT web application deployer.deploy_webapp( "ROOT", diff --git a/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py b/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py index 1e85e44da..462a682f7 100644 --- a/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py +++ b/base/server/python/pki/server/deployment/scriptlets/slot_substitution.py @@ -61,14 +61,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): deployer.mdict['pki_source_context_xml'], deployer.mdict['pki_target_context_xml'], overwrite_flag=True) - deployer.file.copy_with_slot_substitution( - deployer.mdict['pki_source_tomcat_conf'], - deployer.mdict['pki_target_tomcat_conf_instance_id'], - uid=0, gid=0, overwrite_flag=True) - deployer.file.copy_with_slot_substitution( - deployer.mdict['pki_source_tomcat_conf'], - deployer.mdict['pki_target_tomcat_conf'], - overwrite_flag=True) if deployer.mdict['pki_subsystem'] == "CA": deployer.file.copy_with_slot_substitution( diff --git a/base/server/scripts/operations b/base/server/scripts/operations index cbd329a0d..14443c4a5 100644 --- a/base/server/scripts/operations +++ b/base/server/scripts/operations @@ -30,9 +30,11 @@ # 200-254 reserved # -if [ -f /etc/pki/pki.conf ] ; then - . /etc/pki/pki.conf -fi +# Read default PKI configuration. +. /usr/share/pki/etc/pki.conf + +# Read user-defined PKI configuration. +. /etc/pki/pki.conf default_error=0 @@ -920,7 +922,7 @@ verify_symlinks() jni_jar_dir="/usr/share/java" tomcat_dir="/usr/share/tomcat7" else - jni_jar_dir=`. /usr/share/pki/etc/pki.conf && . /etc/pki/pki.conf && echo $JNI_JAR_DIR` + jni_jar_dir="$JNI_JAR_DIR" tomcat_dir="/usr/share/tomcat" fi @@ -1426,6 +1428,7 @@ find_openjdks() # function used by debian to set JAVA_HOME # taken from /etc/init.d/tomcat7 +# TODO: get JAVA_HOME for Debian from pki.conf set_java_home() { find_openjdks @@ -1439,6 +1442,7 @@ set_java_home() JAVA_HOME="$jdir" fi done + export JAVA_HOME } diff --git a/base/server/share/conf/tomcat.conf b/base/server/share/conf/tomcat.conf index 83a6cf1e6..bd2359c8b 100644 --- a/base/server/share/conf/tomcat.conf +++ b/base/server/share/conf/tomcat.conf @@ -4,23 +4,15 @@ # Modifications: configuration parameters # --- END COPYRIGHT BLOCK --- -# System-wide configuration file for tomcat services -# This will be sourced by tomcat and any secondary service -# Values will be overridden by service-specific configuration -# files in /etc/sysconfig -# -# Use this one to change default values for all services -# Change the service specific ones to affect only one service -# (see, for instance, /etc/sysconfig/tomcat) -# +# This file contains instance-specific configuration. # Where your java installation lives -#JAVA_HOME="/usr/lib/jvm/jre" +JAVA_HOME="[JAVA_HOME]" # Where your tomcat installation lives CATALINA_BASE="[PKI_INSTANCE_PATH]" -#CATALINA_HOME="/usr/share/tomcat" -#JASPER_HOME="/usr/share/tomcat" + +# Instance tmp dir CATALINA_TMPDIR=[PKI_TMPDIR] # NOTE: JAVA_OPTS is now only read once. All desired settings must be concatenated diff --git a/base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson b/base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson index 9926b60bf..c08fbfa11 100755 --- a/base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson +++ b/base/server/upgrade/10.1.99/02-ReplaceJettisonWithJackson @@ -40,7 +40,7 @@ class ReplaceJettisonWithJackson(pki.server.upgrade.PKIServerUpgradeScriptlet): # RESTEasy library resteasy_lib = subprocess.check_output( - '. /etc/pki/pki.conf && echo $RESTEASY_LIB', + '. /usr/share/pki/etc/pki.conf && . /etc/pki/pki.conf && echo $RESTEASY_LIB', shell=True) resteasy_lib = resteasy_lib.decode(sys.getfilesystemencoding()) # workaround for pylint error E1103 diff --git a/base/server/upgrade/10.1.99/03-AddedRESTEasyClient b/base/server/upgrade/10.1.99/03-AddedRESTEasyClient index c38e0a62f..245ad3a32 100755 --- a/base/server/upgrade/10.1.99/03-AddedRESTEasyClient +++ b/base/server/upgrade/10.1.99/03-AddedRESTEasyClient @@ -40,7 +40,7 @@ class AddedRESTEasyClient(pki.server.upgrade.PKIServerUpgradeScriptlet): # RESTEasy library resteasy_lib = subprocess.check_output( - '. /etc/pki/pki.conf && echo $RESTEASY_LIB', + '. /usr/share/pki/etc/pki.conf && . /etc/pki/pki.conf && echo $RESTEASY_LIB', shell=True) resteasy_lib = resteasy_lib.decode(sys.getfilesystemencoding()) # workaround for pylint error E1103 |