@@ -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' ]
0 commit comments