Merge pull request #113 from WordOps/develop

Develop
This commit is contained in:
VirtuBox
2019-08-12 20:23:00 +02:00
committed by GitHub
5 changed files with 34 additions and 39 deletions

View File

@@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### v3.9.x - [Unreleased] ### v3.9.x - [Unreleased]
### v3.9.7.2 - 2019-08-12
#### Fixed
- redis.conf permissions additional fix
### v3.9.7.1 - 2019-08-09 ### v3.9.7.1 - 2019-08-09
#### Changed #### Changed

View File

@@ -7,10 +7,10 @@
# Copyright (c) 2019 - WordOps # Copyright (c) 2019 - WordOps
# This script is licensed under M.I.T # This script is licensed under M.I.T
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Version 3.9.7.1 - 2019-08-08 # Version 3.9.7.2 - 2019-08-12
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
readonly wo_version_old="2.2.3" readonly wo_version_old="2.2.3"
readonly wo_version_new="3.9.7.1" readonly wo_version_new="3.9.7.2"
# CONTENTS # CONTENTS
# --- # ---
# 1. VARIABLES AND DECLARATIONS # 1. VARIABLES AND DECLARATIONS

View File

@@ -56,7 +56,7 @@ if not os.path.isfile('/root/.gitconfig'):
shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig') shutil.copy2(os.path.expanduser("~")+'/.gitconfig', '/root/.gitconfig')
setup(name='wo', setup(name='wo',
version='3.9.7.1', version='3.9.7.2',
description=long_description, description=long_description,
long_description=long_description, long_description=long_description,
classifiers=[], classifiers=[],

View File

@@ -1000,7 +1000,7 @@ class WOStackController(CementBaseController):
comment='MySQL optimization cronjob ' comment='MySQL optimization cronjob '
'added by WordOps') 'added by WordOps')
WOGit.add(self, ["/etc/mysql"], msg="Adding MySQL into Git") WOGit.add(self, ["/etc/mysql"], msg="Adding MySQL into Git")
WOService.reload_service(self, 'mysql') WOService.restart_service(self, 'mysql')
# create fail2ban configuration files # create fail2ban configuration files
if set(WOVariables.wo_fail2ban).issubset(set(apt_packages)): if set(WOVariables.wo_fail2ban).issubset(set(apt_packages)):
@@ -1721,7 +1721,7 @@ class WOStackController(CementBaseController):
Log.debug(self, "Calling pre_pref") Log.debug(self, "Calling pre_pref")
self.pre_pref(apt_packages) self.pre_pref(apt_packages)
if (apt_packages): if (apt_packages):
meminfo = (os.popen('cat /proc/meminfo ' meminfo = (os.popen('/bin/cat /proc/meminfo '
'| grep MemTotal').read()).split(":") '| grep MemTotal').read()).split(":")
memsplit = re.split(" kB", meminfo[1]) memsplit = re.split(" kB", meminfo[1])
wo_mem = int(memsplit[0]) wo_mem = int(memsplit[0])
@@ -1755,24 +1755,6 @@ class WOStackController(CementBaseController):
"maxmemory {0}" "maxmemory {0}"
.format .format
(int(wo_ram*1024*1024*0.1))) (int(wo_ram*1024*1024*0.1)))
Log.debug(
self, "Setting maxmemory-policy variable to "
"allkeys-lru in redis.conf")
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"# maxmemory-policy "
"noeviction",
"maxmemory-policy "
"allkeys-lru")
Log.debug(
self, "Setting tcp-backlog variable to "
"in redis.conf")
WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf",
"tcp-backlog 511",
"tcp-backlog 32768")
WOService.restart_service(self, 'redis-server')
else: else:
Log.debug(self, "Setting maxmemory variable to {0} " Log.debug(self, "Setting maxmemory variable to {0} "
"in redis.conf" "in redis.conf"
@@ -1782,21 +1764,28 @@ class WOStackController(CementBaseController):
"# maxmemory <bytes>", "# maxmemory <bytes>",
"maxmemory {0}" "maxmemory {0}"
.format .format
(int(wo_ram*1024*1024*0.1))) (int(wo_ram*1024*1024*0.2)))
Log.debug( Log.debug(
self, "Setting maxmemory-policy variable " self, "Setting maxmemory-policy variable to "
"to allkeys-lru in redis.conf") "allkeys-lru in redis.conf")
WOFileUtils.searchreplace(self, WOFileUtils.searchreplace(self,
"/etc/redis/redis.conf", "/etc/redis/redis.conf",
"# maxmemory-policy " "# maxmemory-policy "
"noeviction", "noeviction",
"maxmemory-policy " "maxmemory-policy "
"allkeys-lru") "allkeys-lru")
WOFileUtils.chown(self, '/etc/redis/redis.conf', Log.debug(
'redis', self, "Setting tcp-backlog variable to "
'redis', "in redis.conf")
recursive=False) WOFileUtils.searchreplace(self,
WOService.restart_service(self, 'redis-server') "/etc/redis/redis.conf",
"tcp-backlog 511",
"tcp-backlog 32768")
WOFileUtils.chown(self, '/etc/redis/redis.conf',
'redis',
'redis',
recursive=False)
WOService.restart_service(self, 'redis-server')
if 'mariadb-server' in apt_packages: if 'mariadb-server' in apt_packages:
# setting innodb memory usage # setting innodb memory usage
wo_ram = psutil.virtual_memory().total / (1024 * 1024) wo_ram = psutil.virtual_memory().total / (1024 * 1024)

View File

@@ -10,7 +10,7 @@ class WOVariables():
"""Intialization of core variables""" """Intialization of core variables"""
# WordOps version # WordOps version
wo_version = "3.9.7.1" wo_version = "3.9.7.2"
# WordOps packages versions # WordOps packages versions
wo_wp_cli = "2.2.0" wo_wp_cli = "2.2.0"
wo_adminer = "4.7.2" wo_adminer = "4.7.2"