Browse Source

Improved MySQL service check

stable
gau1991 10 years ago
parent
commit
7b8ce6a98f
  1. 74
      ee/cli/plugins/stack_services.py

74
ee/cli/plugins/stack_services.py

@ -115,14 +115,17 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if (EEVariables.ee_mysql_host is "localhost" and if (EEVariables.ee_mysql_host is "localhost"):
(EEAptGet.is_installed(self, 'mysql-server') or if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server'))): EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
"Unable to stop MySQL service") else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']
@ -182,14 +185,17 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if (EEVariables.ee_mysql_host is "localhost" and if (EEVariables.ee_mysql_host is "localhost"):
(EEAptGet.is_installed(self, 'mysql-server') or if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server'))): EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
"Unable to restart MySQL service") else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']
@ -249,14 +255,17 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if (EEVariables.ee_mysql_host is "localhost" and if (EEVariables.ee_mysql_host is "localhost"):
(EEAptGet.is_installed(self, 'mysql-server') or if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server'))): EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status") "Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']
@ -315,14 +324,17 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if (EEVariables.ee_mysql_host is "localhost" and if (EEVariables.ee_mysql_host is "localhost"):
(EEAptGet.is_installed(self, 'mysql-server') or if (EEAptGet.is_installed(self, 'mysql-server') or
EEAptGet.is_installed(self, 'percona-server-server-5.6') or EEAptGet.is_installed(self, 'percona-server-server-5.6') or
EEAptGet.is_installed(self, 'mariadb-server'))): EEAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql'] services = services + ['mysql']
else: else:
Log.warn(self, "Remote MySQL found," Log.info(self, "MySQL is not installed")
"Unable to reload MySQL service") else:
Log.warn(self, "Remote MySQL found, "
"Unable to check MySQL service status")
if self.app.pargs.postfix: if self.app.pargs.postfix:
if EEAptGet.is_installed(self, 'postfix'): if EEAptGet.is_installed(self, 'postfix'):
services = services + ['postfix'] services = services + ['postfix']

Loading…
Cancel
Save