Browse Source

Fixed Percona configuration issues

bugfixes
gau1991 10 years ago
parent
commit
d6c890413c
  1. 28
      ee/cli/plugins/stack.py
  2. 3
      ee/core/shellexec.py

28
ee/cli/plugins/stack.py

@ -318,13 +318,27 @@ class EEStackController(CementBaseController):
EEGit.add(self, ["/etc/php5"], msg="Adding PHP into Git")
if set(EEVariables.ee_mysql).issubset(set(apt_packages)):
config = configparser.ConfigParser()
config.read('/etc/mysql/my.cnf')
config['mysqld']['wait_timeout'] = 30
config['mysqld']['interactive_timeout'] = 60
config['mysqld']['performance_schema'] = 0
with open('/etc/mysql/my.cnf', 'w') as configfile:
config.write(configfile)
# TODO: Currently we are using, we need to remove it in future
# config = configparser.ConfigParser()
# config.read('/etc/mysql/my.cnf')
# config['mysqld']['wait_timeout'] = 30
# config['mysqld']['interactive_timeout'] = 60
# config['mysqld']['performance_schema'] = 0
# with open('/etc/mysql/my.cnf', 'w') as configfile:
# config.write(configfile)
if not os.path.isfile("/etc/mysql/my.cnf"):
config = ("[mysqld]\nwait_timeout = 30\n"
"interactive_timeout=60\nperformance_schema = 0")
config_file = open("/etc/mysql/my.cnf", "w")
config_file.write(config)
config_file.close()
else:
EEShellExec.cmd_exec(self, "sed -i \"/#max_connections/a "
"wait_timeout = 30 \\n"
"interactive_timeout = 60 \\n"
"performance_schema = 0\" "
"/etc/mysql/my.cnf")
EEGit.add(self, ["/etc/mysql"], msg="Adding Nginx into Git")
if set(EEVariables.ee_mail).issubset(set(apt_packages)):

3
ee/core/shellexec.py

@ -12,11 +12,12 @@ class EEShellExec():
def cmd_exec(self, command, errormsg=''):
try:
self.app.log.debug("Running command: {0}".format(command))
retcode = subprocess.getstatusoutput(command)
if retcode[0] == 0:
return True
else:
self.app.log.warn(retcode[1])
self.app.log.debug(retcode[1])
return False
except OSError as e:
if errormsg:

Loading…
Cancel
Save