def stop(self): """Stop services""" services = [] if not (self.app.pargs.apache2 or self.app.pargs.php or self.app.pargs.mysql or self.app.pargs.memcache): self.app.pargs.apache2 = True self.app.pargs.php = True self.app.pargs.mysql = True if self.app.pargs.apache2: if SSSAptGet.is_installed(self, 'apache2'): services = services + ['apache2'] else: Log.info(self, 'Apache is not installed') if self.app.pargs.php: if SSSAptGet.is_installed(self, 'php7.0-fpm'): services = services + ['php7.0-fpm'] else: Log.info(self, "PHP7-FPM is not installed") if self.app.pargs.mysql: if ((SSSVariables.sss_mysql_host is "localhost") or (SSSVariables.sss_mysql_host is "127.0.0.1")): if (SSSAptGet.is_installed(self, 'mysql-server') or SSSAptGet.is_installed(self, 'percona-server-server-5.6') or SSSAptGet.is_installed(self, 'mariadb-server')): services = services + ['mysql'] else: Log.info(self, "MySQL is not installed") else: Log.warn( self, "Remote MySQL found, " "Unable to check MySQL service status") if self.app.pargs.memcache: if SSSAptGet.is_installed(self, 'memcached'): services = services + ['memcached'] else: Log.info(self, "Memcache is not installed") for service in services: Log.debug(self, "Stopping service: {0}".format(service)) SSSService.stop_service(self, service)
def stop(self): """Stop services""" services = [] if not (self.app.pargs.apache2 or self.app.pargs.php or self.app.pargs.mysql or self.app.pargs.memcache): self.app.pargs.apache2 = True self.app.pargs.php = True self.app.pargs.mysql = True if self.app.pargs.apache2: if SSSAptGet.is_installed(self,'apache2'): services = services + ['apache2'] else: Log.info(self,'Apache is not installed') if self.app.pargs.php: if SSSAptGet.is_installed(self, 'php7.0-fpm'): services = services + ['php7.0-fpm'] else: Log.info(self, "PHP7-FPM is not installed") if self.app.pargs.mysql: if ((SSSVariables.sss_mysql_host is "localhost") or (SSSVariables.sss_mysql_host is "127.0.0.1")): if (SSSAptGet.is_installed(self, 'mysql-server') or SSSAptGet.is_installed(self, 'percona-server-server-5.6') or SSSAptGet.is_installed(self, 'mariadb-server')): services = services + ['mysql'] else: Log.info(self, "MySQL is not installed") else: Log.warn(self, "Remote MySQL found, " "Unable to check MySQL service status") if self.app.pargs.memcache: if SSSAptGet.is_installed(self, 'memcached'): services = services + ['memcached'] else: Log.info(self, "Memcache is not installed") for service in services: Log.debug(self, "Stopping service: {0}".format(service)) SSSService.stop_service(self, service)