Skip to content

Commit c5dbffc

Browse files
author
gau1991
committed
Merge branch 'master' of github.com:rtcamp/easyengine
2 parents b4868f8 + 42e3224 commit c5dbffc

File tree

9 files changed

+94
-51
lines changed

9 files changed

+94
-51
lines changed

CHANGELOG.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v 3.1.8 - May 22, 2015
2+
- Fixed PHP Failed to Restart after Upgrade #550
3+
- Improved ee stack services command
4+
- Minor fix and improvements
5+
16
v 3.1.7 - May 21, 2015
27
- Fixed site blank issue after nginx stack upgrade on Debian
38
- Improved update script

ee/cli/plugins/site_functions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import getpass
1818
import glob
1919
import re
20+
import platform
2021

2122

2223
class SiteError(Exception):
@@ -604,6 +605,8 @@ def site_package_check(self, stype):
604605
"/usr/bin/wp", "WP-CLI"]]
605606

606607
if self.app.pargs.hhvm:
608+
if platform.architecture()[0] is '32bit':
609+
Log.error(self, "HHVM is not supported by 32bit system")
607610
Log.debug(self, "Setting apt_packages variable for HHVM")
608611
if not EEAptGet.is_installed(self, 'hhvm'):
609612
apt_packages = apt_packages + EEVariables.ee_hhvm

ee/cli/plugins/stack.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import pwd
2626
import grp
2727
import codecs
28+
import platform
2829
from ee.cli.plugins.stack_services import EEStackStatusController
2930
from ee.cli.plugins.stack_migrate import EEStackMigrateController
3031
from ee.cli.plugins.stack_upgrade import EEStackUpgradeController
@@ -1494,6 +1495,8 @@ def install(self, packages=[], apt_packages=[], disp_msg=True):
14941495

14951496
if self.app.pargs.hhvm:
14961497
Log.debug(self, "Setting apt packages variable for HHVM")
1498+
if platform.architecture()[0] is '32bit':
1499+
Log.error(self, "HHVM is not supported by 32bit system")
14971500
if not EEAptGet.is_installed(self, 'hhvm'):
14981501
apt_packages = apt_packages + EEVariables.ee_hhvm
14991502
else:

ee/cli/plugins/stack_services.py

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,18 @@ def start(self):
5151
Log.info(self, "PHP5-FPM is not installed")
5252

5353
if self.app.pargs.mysql:
54-
if EEVariables.ee_mysql_host is "localhost":
55-
services = services + ['mysql']
56-
else:
57-
Log.warn(self, "Remote MySQL found,"
58-
"Unable to start MySQL service")
54+
if ((EEVariables.ee_mysql_host is "localhost") or
55+
(EEVariables.ee_mysql_host is "127.0.0.1")):
56+
if (EEAptGet.is_installed(self, 'mysql-server') or
57+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
58+
EEAptGet.is_installed(self, 'mariadb-server')):
59+
services = services + ['mysql']
60+
else:
61+
Log.info(self, "MySQL is not installed")
62+
else:
63+
Log.warn(self, "Remote MySQL found, "
64+
"Unable to check MySQL service status")
65+
5966
if self.app.pargs.postfix:
6067
if EEAptGet.is_installed(self, 'postfix'):
6168
services = services + ['postfix']
@@ -115,11 +122,18 @@ def stop(self):
115122
Log.info(self, "PHP5-FPM is not installed")
116123

117124
if self.app.pargs.mysql:
118-
if EEVariables.ee_mysql_host is "localhost":
119-
services = services + ['mysql']
120-
else:
121-
Log.warn(self, "Remote MySQL found,"
122-
"Unable to stop MySQL service")
125+
if ((EEVariables.ee_mysql_host is "localhost") or
126+
(EEVariables.ee_mysql_host is "127.0.0.1")):
127+
if (EEAptGet.is_installed(self, 'mysql-server') or
128+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
129+
EEAptGet.is_installed(self, 'mariadb-server')):
130+
services = services + ['mysql']
131+
else:
132+
Log.info(self, "MySQL is not installed")
133+
else:
134+
Log.warn(self, "Remote MySQL found, "
135+
"Unable to check MySQL service status")
136+
123137
if self.app.pargs.postfix:
124138
if EEAptGet.is_installed(self, 'postfix'):
125139
services = services + ['postfix']
@@ -179,11 +193,18 @@ def restart(self):
179193
Log.info(self, "PHP5-FPM is not installed")
180194

181195
if self.app.pargs.mysql:
182-
if EEVariables.ee_mysql_host is "localhost":
183-
services = services + ['mysql']
184-
else:
185-
Log.warn(self, "Remote MySQL found,"
186-
"Unable to restart MySQL service")
196+
if ((EEVariables.ee_mysql_host is "localhost") or
197+
(EEVariables.ee_mysql_host is "127.0.0.1")):
198+
if (EEAptGet.is_installed(self, 'mysql-server') or
199+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
200+
EEAptGet.is_installed(self, 'mariadb-server')):
201+
services = services + ['mysql']
202+
else:
203+
Log.info(self, "MySQL is not installed")
204+
else:
205+
Log.warn(self, "Remote MySQL found, "
206+
"Unable to check MySQL service status")
207+
187208
if self.app.pargs.postfix:
188209
if EEAptGet.is_installed(self, 'postfix'):
189210
services = services + ['postfix']
@@ -243,11 +264,18 @@ def status(self):
243264
Log.info(self, "PHP5-FPM is not installed")
244265

245266
if self.app.pargs.mysql:
246-
if EEVariables.ee_mysql_host is "localhost":
247-
services = services + ['mysql']
248-
else:
249-
Log.warn(self, "Remote MySQL found,"
267+
if ((EEVariables.ee_mysql_host is "localhost") or
268+
(EEVariables.ee_mysql_host is "127.0.0.1")):
269+
if (EEAptGet.is_installed(self, 'mysql-server') or
270+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
271+
EEAptGet.is_installed(self, 'mariadb-server')):
272+
services = services + ['mysql']
273+
else:
274+
Log.info(self, "MySQL is not installed")
275+
else:
276+
Log.warn(self, "Remote MySQL found, "
250277
"Unable to check MySQL service status")
278+
251279
if self.app.pargs.postfix:
252280
if EEAptGet.is_installed(self, 'postfix'):
253281
services = services + ['postfix']
@@ -306,11 +334,18 @@ def reload(self):
306334
Log.info(self, "PHP5-FPM is not installed")
307335

308336
if self.app.pargs.mysql:
309-
if EEVariables.ee_mysql_host is "localhost":
310-
services = services + ['mysql']
311-
else:
312-
Log.warn(self, "Remote MySQL found,"
313-
"Unable to reload MySQL service")
337+
if ((EEVariables.ee_mysql_host is "localhost") or
338+
(EEVariables.ee_mysql_host is "127.0.0.1")):
339+
if (EEAptGet.is_installed(self, 'mysql-server') or
340+
EEAptGet.is_installed(self, 'percona-server-server-5.6') or
341+
EEAptGet.is_installed(self, 'mariadb-server')):
342+
services = services + ['mysql']
343+
else:
344+
Log.info(self, "MySQL is not installed")
345+
else:
346+
Log.warn(self, "Remote MySQL found, "
347+
"Unable to check MySQL service status")
348+
314349
if self.app.pargs.postfix:
315350
if EEAptGet.is_installed(self, 'postfix'):
316351
services = services + ['postfix']

ee/cli/plugins/stack_upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def default(self):
216216
EEService.restart_service(self, 'nginx')
217217

218218
if set(EEVariables.ee_php).issubset(set(apt_packages)):
219-
EEService.restart_service(self, 'php')
219+
EEService.restart_service(self, 'php5-fpm')
220220
if set(EEVariables.ee_hhvm).issubset(set(apt_packages)):
221221
EEService.restart_service(self, 'hhvm')
222222
if set(EEVariables.ee_postfix).issubset(set(apt_packages)):

ee/core/services.py

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,14 @@ def start_service(self, service_name):
1818
Similar to `service xyz start`
1919
"""
2020
try:
21+
if service_name in ['nginx', 'php5-fpm']:
22+
service_cmd = ('{0} -t && service {0} start'
23+
.format(service_name))
24+
else:
25+
service_cmd = ('service {0} start'.format(service_name))
26+
2127
Log.info(self, "Start : {0:10}" .format(service_name), end='')
22-
retcode = subprocess.getstatusoutput('service {0} start'
23-
.format(service_name))
28+
retcode = subprocess.getstatusoutput(service_cmd)
2429
if retcode[0] == 0:
2530
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
2631
return True
@@ -60,9 +65,14 @@ def restart_service(self, service_name):
6065
Similar to `service xyz restart`
6166
"""
6267
try:
68+
if service_name in ['nginx', 'php5-fpm']:
69+
service_cmd = ('{0} -t && service {0} restart'
70+
.format(service_name))
71+
else:
72+
service_cmd = ('service {0} restart'.format(service_name))
73+
6374
Log.info(self, "Restart : {0:10}".format(service_name), end='')
64-
retcode = subprocess.getstatusoutput('service {0} restart'
65-
.format(service_name))
75+
retcode = subprocess.getstatusoutput(service_cmd)
6676
if retcode[0] == 0:
6777
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
6878
return True
@@ -82,26 +92,13 @@ def reload_service(self, service_name):
8292
"""
8393
try:
8494
if service_name in ['nginx', 'php5-fpm']:
85-
Log.info(self, "Reload : {0:10}".format(service_name),
86-
end='')
87-
retcode = subprocess.getstatusoutput('{0} -t &&'
88-
' service {0} reload'
89-
.format(service_name))
90-
if retcode[0] == 0:
91-
# print(retcode[0])
92-
# subprocess.getstatusoutput('service {0} reload'
93-
# .format(service_name))
94-
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE +
95-
"]")
96-
return True
97-
else:
98-
Log.debug(self, "{0}".format(retcode[1]))
99-
Log.info(self, "[" + Log.FAIL + "Failed" +
100-
Log.OKBLUE+"]")
101-
return False
95+
service_cmd = ('{0} -t && service {0} reload'
96+
.format(service_name))
97+
else:
98+
service_cmd = ('service {0} reload'.format(service_name))
99+
102100
Log.info(self, "Reload : {0:10}".format(service_name), end='')
103-
retcode = subprocess.getstatusoutput('service {0} reload'
104-
.format(service_name))
101+
retcode = subprocess.getstatusoutput(service_cmd)
105102
if retcode[0] == 0:
106103
Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
107104
return True

ee/core/variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class EEVariables():
1212
"""Intialization of core variables"""
1313

1414
# EasyEngine version
15-
ee_version = "3.1.7"
15+
ee_version = "3.1.8"
1616

1717
# EasyEngine packages versions
1818
ee_wp_cli = "0.19.1"

install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fi
4848
# Define variables for later use
4949
ee_branch=$1
5050
readonly ee_version_old="2.2.3"
51-
readonly ee_version_new="3.1.7"
51+
readonly ee_version_new="3.1.8"
5252
readonly ee_log_dir=/var/log/ee/
5353
readonly ee_install_log=/var/log/ee/install.log
5454
readonly ee_linux_distro=$(lsb_release -i | awk '{print $3}')

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
os.system("git config --global user.email {0}".format(ee_email))
5555

5656
setup(name='ee',
57-
version='3.1.7',
57+
version='3.1.8',
5858
description=long_description,
5959
long_description=long_description,
6060
classifiers=[],

0 commit comments

Comments
 (0)