def stop(self): """Stop services""" services = [] if self.app.pargs.nginx: Log.debug(self, "nginx service stop") services = services + ['nginx'] if self.app.pargs.php: Log.debug(self, "php5-fpm service stop") services = services + ['php5-fpm'] if self.app.pargs.mysql: if EEVariables.ee_mysql_host is "localhost": Log.debug(self, "mysql service stop") services = services + ['mysql'] else: Log.warn(self, "Remote MySQL found, " "unable to stop MySQL service") if self.app.pargs.postfix: Log.debug(self, "postfix service stop") services = services + ['postfix'] if self.app.pargs.memcache: Log.debug(self, "memcached service stop") services = services + ['memcached'] if self.app.pargs.dovecot: Log.debug(self, "dovecot service stop") services = services + ['dovecot'] if not services and EEVariables.ee_mysql_host is "localhost": services = services + ['nginx', 'php5-fpm', 'mysql', 'postfix'] Log.debug(self, "nginx,php5-fpm,mysql,postfix services stop") elif not services: services = services + ['nginx', 'php5-fpm', 'postfix'] Log.debug(self, "nginx,php5-fpm,postfix services stop") for service in services: EEService.stop_service(self, service)
def stop(self): """Stop services""" services = [] if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7 or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): self.app.pargs.nginx = True self.app.pargs.php = True self.app.pargs.mysql = True self.app.pargs.postfix = True if self.app.pargs.nginx: if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self,'nginx-mainline'): services = services + ['nginx'] else: Log.info(self, "Nginx is not installed") if self.app.pargs.php: if EEVariables.ee_platform_codename != 'trusty': if EEAptGet.is_installed(self, 'php5-fpm'): services = services + ['php5-fpm'] else: Log.info(self, "PHP5-FPM is not installed") else: if EEAptGet.is_installed(self, 'php5.6-fpm'): services = services + ['php5.6-fpm'] else: Log.info(self, "PHP5.6-FPM is not installed") if EEAptGet.is_installed(self, 'php7.0-fpm'): services = services + ['php7.0-fpm'] else: Log.info(self, "PHP7.0-FPM is not installed") if self.app.pargs.php7: if EEVariables.ee_platform_codename == 'trusty': if EEAptGet.is_installed(self, 'php7.0-fpm'): services = services + ['php7.0-fpm'] else: Log.info(self, "PHP7.0-FPM is not installed") else: Log.info(self, "Your platform does not support PHP 7") if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or (EEVariables.ee_mysql_host is "127.0.0.1")): if (EEAptGet.is_installed(self, 'mysql-server') or EEAptGet.is_installed(self, 'percona-server-server-5.6') or EEAptGet.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.postfix: if EEAptGet.is_installed(self, 'postfix'): services = services + ['postfix'] else: Log.info(self, "Postfix is not installed") if self.app.pargs.hhvm: if EEAptGet.is_installed(self, 'hhvm'): services = services + ['hhvm'] else: Log.info(self, "HHVM is not installed") if self.app.pargs.memcache: if EEAptGet.is_installed(self, 'memcached'): services = services + ['memcached'] else: Log.info(self, "Memcache is not installed") if self.app.pargs.dovecot: if EEAptGet.is_installed(self, 'dovecot-core'): services = services + ['dovecot'] else: Log.info(self, "Mail server is not installed") if self.app.pargs.redis: if EEAptGet.is_installed(self, 'redis-server'): services = services + ['redis-server'] else: Log.info(self, "Redis server is not installed") for service in services: Log.debug(self, "Stopping service: {0}".format(service)) EEService.stop_service(self, service)
def stop(self): """Stop services""" services = [] if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): self.app.pargs.nginx = True self.app.pargs.php = True self.app.pargs.mysql = True self.app.pargs.postfix = True if self.app.pargs.nginx: if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed( self, 'nginx-mainline'): services = services + ['nginx'] else: Log.info(self, "Nginx is not installed") if self.app.pargs.php: if EEAptGet.is_installed(self, 'php5-fpm'): services = services + ['php5-fpm'] else: Log.info(self, "PHP5-FPM is not installed") if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or (EEVariables.ee_mysql_host is "127.0.0.1")): if (EEAptGet.is_installed(self, 'mysql-server') or EEAptGet.is_installed(self, 'percona-server-server-5.6') or EEAptGet.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.postfix: if EEAptGet.is_installed(self, 'postfix'): services = services + ['postfix'] else: Log.info(self, "Postfix is not installed") if self.app.pargs.hhvm: if EEAptGet.is_installed(self, 'hhvm'): services = services + ['hhvm'] else: Log.info(self, "HHVM is not installed") if self.app.pargs.memcache: if EEAptGet.is_installed(self, 'memcached'): services = services + ['memcached'] else: Log.info(self, "Memcache is not installed") if self.app.pargs.dovecot: if EEAptGet.is_installed(self, 'dovecot-core'): services = services + ['dovecot'] else: Log.info(self, "Mail server is not installed") if self.app.pargs.redis: if EEAptGet.is_installed(self, 'redis-server'): services = services + ['redis-server'] else: Log.info(self, "Redis server is not installed") for service in services: Log.debug(self, "Stopping service: {0}".format(service)) EEService.stop_service(self, service)