summaryrefslogtreecommitdiffstats
path: root/base/server/upgrade/10.1.0
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2013-09-18 11:34:07 -0400
committerAde Lee <alee@redhat.com>2013-09-18 16:18:34 -0400
commitfb32217fe98603dbe20563ce9836eb86813ebc98 (patch)
tree222ca43637ec0f5844a576e30ed54116598465a1 /base/server/upgrade/10.1.0
parentf37ae8f1d9743c9c17ccc5714865f5c1e5b9db5c (diff)
downloadpki-fb32217fe98603dbe20563ce9836eb86813ebc98.tar.gz
pki-fb32217fe98603dbe20563ce9836eb86813ebc98.tar.xz
pki-fb32217fe98603dbe20563ce9836eb86813ebc98.zip
Upgrade script to fix JAVA_OPTS
Diffstat (limited to 'base/server/upgrade/10.1.0')
-rwxr-xr-xbase/server/upgrade/10.1.0/01-FixJavaOpts39
1 files changed, 39 insertions, 0 deletions
diff --git a/base/server/upgrade/10.1.0/01-FixJavaOpts b/base/server/upgrade/10.1.0/01-FixJavaOpts
new file mode 100755
index 000000000..d89f7b425
--- /dev/null
+++ b/base/server/upgrade/10.1.0/01-FixJavaOpts
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# Authors:
+# Ade Lee <alee@redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Copyright (C) 2013 Red Hat, Inc.
+# All rights reserved.
+#
+
+import os
+import re
+import pki.server.upgrade
+
+
+class FixJavaOpts(pki.server.upgrade.PKIServerUpgradeScriptlet):
+
+ def __init__(self):
+ self.message = 'Fix JAVA_OPTS in tomcat startup'
+
+ def upgrade_instance(self, instance):
+ fname = "/etc/sysconfig/" + instance.name
+ with open(fname, "r") as infile:
+ lines = infile.readlines()
+ with open(fname, "w") as outfile:
+ for line in lines:
+ outfile.write(re.sub(r'\$JAVA_OPTS *', '', line))
+