diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-09-14 15:42:01 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-09-19 10:36:43 -0500 |
commit | 7b737b2ea9d798cbbfb27ad15d157a7cb42fdb08 (patch) | |
tree | 23222ca196e468a3ef0dac917c94ebc2dcf93830 | |
parent | e6895613ea1c116003166e456fdca3ac86dfaeec (diff) | |
download | pki-7b737b2ea9d798cbbfb27ad15d157a7cb42fdb08.tar.gz pki-7b737b2ea9d798cbbfb27ad15d157a7cb42fdb08.tar.xz pki-7b737b2ea9d798cbbfb27ad15d157a7cb42fdb08.zip |
Fixed conflicting log4j.properties.
The <instance>/lib link has been replaced with a real folder
which contains links to the files in /usr/share/tomcat/lib. This
way the log4j.properties can be placed in this folder without
causing conflicts with other instances.
Ticket: #284
-rw-r--r-- | base/deploy/scripts/operations | 1 | ||||
-rw-r--r-- | base/deploy/src/scriptlets/instance_layout.py | 34 | ||||
-rw-r--r-- | base/deploy/src/scriptlets/pkiparser.py | 8 |
3 files changed, 22 insertions, 21 deletions
diff --git a/base/deploy/scripts/operations b/base/deploy/scripts/operations index 60b66efdc..d4c03d084 100644 --- a/base/deploy/scripts/operations +++ b/base/deploy/scripts/operations @@ -961,7 +961,6 @@ verify_symlinks() [alias]=/etc/pki/${PKI_INSTANCE_ID}/alias [bin]=/usr/share/tomcat/bin [conf]=/etc/pki/${PKI_INSTANCE_ID} - [lib]=/usr/share/tomcat/lib [logs]=/var/log/pki/${PKI_INSTANCE_ID}) # '${PKI_INSTANCE_PATH}' symlinks (root:root ownership) diff --git a/base/deploy/src/scriptlets/instance_layout.py b/base/deploy/src/scriptlets/instance_layout.py index c5f884ec3..5b48b87b5 100644 --- a/base/deploy/src/scriptlets/instance_layout.py +++ b/base/deploy/src/scriptlets/instance_layout.py @@ -45,9 +45,25 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.directory.create(master['pki_instance_configuration_path']) # establish Apache/Tomcat specific instance if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS: + # establish Tomcat instance configuration + util.directory.copy(master['pki_source_shared_path'], + master['pki_instance_configuration_path'], + overwrite_flag=True) # establish Tomcat instance base util.directory.create(master['pki_tomcat_common_path']) util.directory.create(master['pki_tomcat_common_lib_path']) + # establish Tomcat instance library + util.directory.create(master['pki_instance_lib']) + for name in os.listdir(master['pki_tomcat_lib_path']): + util.symlink.create( + os.path.join( + master['pki_tomcat_lib_path'], + name), + os.path.join( + master['pki_instance_lib'], + name)) + util.symlink.create(master['pki_instance_conf_log4j_properties'], + master['pki_instance_lib_log4j_properties']) util.directory.create(master['pki_tomcat_tmpdir_path']) util.directory.create(master['pki_tomcat_webapps_path']) util.directory.create(master['pki_tomcat_webapps_common_path']) @@ -74,19 +90,10 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.directory.create( master['pki_tomcat_work_catalina_host_subsystem_path']) # establish Tomcat instance logs - # establish Tomcat instance configuration - util.directory.copy(master['pki_source_shared_path'], - master['pki_instance_configuration_path'], - overwrite_flag=True) # establish Tomcat instance registry # establish Tomcat instance convenience symbolic links util.symlink.create(master['pki_tomcat_bin_path'], master['pki_tomcat_bin_link']) - util.symlink.create(master['pki_tomcat_lib_path'], - master['pki_tomcat_lib_link']) - util.symlink.create(master['pki_instance_log4j_properties'], - master['pki_tomcat_lib_log4j_properties_link'], - uid=0, gid=0) util.symlink.create(master['pki_tomcat_systemd'], master['pki_instance_systemd_link'], uid=0, gid=0) @@ -166,6 +173,8 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): # update Tomcat instance base util.directory.modify(master['pki_tomcat_common_path']) util.directory.modify(master['pki_tomcat_common_lib_path']) + util.directory.modify(master['pki_instance_lib']) + util.directory.modify(master['pki_instance_lib_log4j_properties']) util.directory.modify(master['pki_tomcat_webapps_path']) util.directory.copy( os.path.join( @@ -195,9 +204,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): # update Tomcat instance registry # update Tomcat instance convenience symbolic links util.symlink.modify(master['pki_tomcat_bin_link']) - util.symlink.modify(master['pki_tomcat_lib_link']) - util.symlink.modify(master['pki_tomcat_lib_log4j_properties_link'], - uid=0, gid=0) util.symlink.modify(master['pki_instance_systemd_link'], uid=0, gid=0) # update Tomcat instance common lib jar symbolic links @@ -274,8 +280,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): # remove shared NSS security database path for this instance util.directory.delete(master['pki_database_path']) # remove Tomcat instance configuration - util.symlink.delete( - master['pki_tomcat_lib_log4j_properties_link']) util.directory.delete(master['pki_instance_configuration_path']) # remove PKI 'tomcat.conf' instance file util.file.delete(master['pki_target_tomcat_conf_instance_id']) @@ -311,8 +315,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): # remove shared NSS security database path for this instance util.directory.delete(master['pki_database_path']) # remove Tomcat instance configuration - util.symlink.delete( - master['pki_tomcat_lib_log4j_properties_link']) util.directory.delete(master['pki_instance_configuration_path']) # remove PKI 'tomcat.conf' instance file util.file.delete(master['pki_target_tomcat_conf_instance_id']) diff --git a/base/deploy/src/scriptlets/pkiparser.py b/base/deploy/src/scriptlets/pkiparser.py index dd70874fe..a235c5917 100644 --- a/base/deploy/src/scriptlets/pkiparser.py +++ b/base/deploy/src/scriptlets/pkiparser.py @@ -587,7 +587,7 @@ def compose_pki_master_dictionary(): config.pki_master_dict['pki_subsystem'].lower()) # Tomcat instance log name/value pairs # Tomcat instance configuration name/value pairs - config.pki_master_dict['pki_instance_log4j_properties'] =\ + config.pki_master_dict['pki_instance_conf_log4j_properties'] =\ os.path.join( config.pki_master_dict['pki_instance_configuration_path'], "log4j.properties") @@ -604,11 +604,11 @@ def compose_pki_master_dictionary(): config.pki_master_dict['pki_tomcat_bin_link'] =\ os.path.join(config.pki_master_dict['pki_instance_path'], "bin") - config.pki_master_dict['pki_tomcat_lib_link'] =\ + config.pki_master_dict['pki_instance_lib'] =\ os.path.join(config.pki_master_dict['pki_instance_path'], "lib") - config.pki_master_dict['pki_tomcat_lib_log4j_properties_link'] =\ - os.path.join(config.pki_master_dict['pki_tomcat_lib_path'], + config.pki_master_dict['pki_instance_lib_log4j_properties'] =\ + os.path.join(config.pki_master_dict['pki_instance_lib'], "log4j.properties") config.pki_master_dict['pki_instance_systemd_link'] =\ os.path.join(config.pki_master_dict['pki_instance_path'], |