Skip to content

Commit 6564784

Browse files
committed
Speed up Tomcat startup (SOFTWARE-2383)
1 parent 448a65d commit 6564784

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

osgtest/tests/test_24_tomcat.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,21 @@ def test_02_config_tomcat_properties(self):
2525
new_contents = pattern.sub('crlRequired="false"', old_contents)
2626
files.write(server_xml_path, new_contents, owner='tomcat')
2727

28-
def test_03_config_tomcat_endorsed_jars(self):
28+
def test_03_config_tomcat(self):
2929
core.skip_ok_unless_installed(tomcat.pkgname())
3030

3131
old_contents = files.read(tomcat.conffile(), True)
32-
line = 'JAVA_ENDORSED_DIRS="${JAVA_ENDORSED_DIRS+$JAVA_ENDORSED_DIRS:}/usr/share/voms-admin/endorsed"\n'
33-
if old_contents.find(line) == -1:
34-
new_contents = old_contents + "\n" + line
35-
files.write(tomcat.conffile(), new_contents, owner='tomcat')
32+
# Endorse JARs
33+
lines = ['JAVA_ENDORSED_DIRS="${JAVA_ENDORSED_DIRS+$JAVA_ENDORSED_DIRS:}/usr/share/voms-admin/endorsed"']
34+
# Improve Tomcat 7 startup times (SOFTWARE-2383)
35+
lines.append('JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"')
36+
37+
for line in lines:
38+
if old_contents.find(line) != -1:
39+
lines.remove(line)
40+
41+
new_contents = '\n'.join([old_contents] + lines)
42+
files.write(tomcat.conffile(), new_contents, owner='tomcat')
3643

3744
def test_04_configure_gratia(self):
3845
core.skip_ok_unless_installed(tomcat.pkgname(), 'gratia-service')

0 commit comments

Comments
 (0)