当前位置: 首页>>代码示例>>Python>>正文


Python EEService.reload_service方法代码示例

本文整理汇总了Python中ee.core.services.EEService.reload_service方法的典型用法代码示例。如果您正苦于以下问题:Python EEService.reload_service方法的具体用法?Python EEService.reload_service怎么用?Python EEService.reload_service使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ee.core.services.EEService的用法示例。


在下文中一共展示了EEService.reload_service方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: enable

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
    def enable(self):
        if not self.app.pargs.site_name:
            try:
                while not self.app.pargs.site_name:
                    self.app.pargs.site_name = (input('Enter site name : ')
                                                .strip())
            except IOError as e:
                Log.error(self, 'could not input site name')

        self.app.pargs.site_name = self.app.pargs.site_name.strip()
        # validate domain name
        (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name)

        # check if site exists
        if not check_domain_exists(self, ee_domain):
            Log.error(self, "site {0} does not exist".format(ee_domain))
        if os.path.isfile('/etc/nginx/sites-available/{0}'
                          .format(ee_domain)):
            Log.info(self, "Enable domain {0:10} \t".format(ee_domain), end='')
            EEFileUtils.create_symlink(self,
                                       ['/etc/nginx/sites-available/{0}'
                                        .format(ee_domain),
                                        '/etc/nginx/sites-enabled/{0}'
                                        .format(ee_domain)])
            EEGit.add(self, ["/etc/nginx"],
                      msg="Enabled {0} "
                      .format(ee_domain))
            updateSiteInfo(self, ee_domain, enabled=True)
            Log.info(self, "[" + Log.ENDC + "OK" + Log.OKBLUE + "]")
            EEService.reload_service(self, 'nginx')
        else:
            Log.error(self, "nginx configuration file does not exist"
                      .format(ee_domain))
开发者ID:etokareva,项目名称:easyengine,代码行数:35,代码来源:site.py

示例2: signal_handler

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
    def signal_handler(self, signal, frame):
        """Handle Ctrl+c hevent for -i option of debug"""
        self.start = False
        if self.app.pargs.nginx:
            self.debug_nginx()
        if self.app.pargs.php:
            self.debug_php()
        if self.app.pargs.fpm:
            self.debug_fpm()
        if self.app.pargs.mysql:
            # MySQL debug will not work for remote MySQL
            if EEVariables.ee_mysql_host is "localhost":
                self.debug_mysql()
            else:
                Log.warn(self, "Remote MySQL found, EasyEngine will not "
                         "enable remote debug")
        if self.app.pargs.wp:
            self.debug_wp()
        if self.app.pargs.rewrite:
            self.debug_rewrite()

        # Reload Nginx
        if self.trigger_nginx:
            EEService.reload_service(self, 'nginx')

        # Reload PHP
        if self.trigger_php:
            EEService.reload_service(self, 'php5-fpm')
        self.app.close(0)
开发者ID:etokareva,项目名称:easyengine,代码行数:31,代码来源:debug.py

示例3: reload

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
 def reload(self):
     """Reload service"""
     services = []
     if self.app.pargs.nginx:
         Log.debug(self, "nginx service reload")
         services = services + ['nginx']
     if self.app.pargs.php:
         Log.debug(self, "php5-fpm service reload")
         services = services + ['php5-fpm']
     if self.app.pargs.mysql:
         if EEVariables.ee_mysql_host is "localhost":
             Log.debug(self, "mysql service reload")
             services = services + ['mysql']
         else:
             Log.warn(self, "Remote MySQL found, "
                      "unable to remote MySQL service")
     if self.app.pargs.postfix:
         Log.debug(self, "postfix service reload")
         services = services + ['postfix']
     if self.app.pargs.memcache:
         Log.debug(self, "memcached service reload")
         services = services + ['memcached']
     if self.app.pargs.dovecot:
         Log.debug(self, "dovecot service reload")
         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 reload")
     elif not services:
         services = services + ['nginx', 'php5-fpm', 'postfix']
         Log.debug(self, "nginx,php5-fpm,postfix services reload")
     for service in services:
         EEService.reload_service(self, service)
开发者ID:rahul286,项目名称:easyengine,代码行数:35,代码来源:stack_services.py

示例4: edit

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
    def edit(self):
        if not self.app.pargs.site_name:
            try:
                while not self.app.pargs.site_name:
                    self.app.pargs.site_name = (input('Enter site name : ')
                                                .strip())
            except IOError as e:
                Log.error(self, 'Unable to read input, Please try again')

        self.app.pargs.site_name = self.app.pargs.site_name.strip()
        (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name)

        if not check_domain_exists(self, ee_domain):
            Log.error(self, "site {0} does not exist".format(ee_domain))
        if os.path.isfile('/etc/nginx/sites-available/{0}'
                          .format(ee_domain)):
            try:
                EEShellExec.invoke_editor(self, '/etc/nginx/sites-available/'
                                          '{0}'.format(ee_domain))
            except CommandExecutionError as e:
                Log.error(self, "Failed invoke editor")
            if (EEGit.checkfilestatus(self, "/etc/nginx",
               '/etc/nginx/sites-available/{0}'.format(ee_domain))):
                EEGit.add(self, ["/etc/nginx"], msg="Edit website: {0}"
                          .format(ee_domain))
                # Reload NGINX
                EEService.reload_service(self, 'nginx')
        else:
            Log.error(self, "nginx configuration file does not exists"
                      .format(ee_domain))
开发者ID:etokareva,项目名称:easyengine,代码行数:32,代码来源:site.py

示例5: secure_port

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
 def secure_port(self):
     """This function Secures port"""
     if self.app.pargs.user_input:
         while not self.app.pargs.user_input.isdigit():
             Log.info(self, "Please Enter valid port number ")
             self.app.pargs.user_input = input("EasyEngine "
                                               "admin port [22222]:")
     if not self.app.pargs.user_input:
         port = input("EasyEngine admin port [22222]:")
         if port == "":
             self.app.pargs.user_input = 22222
         while not port.isdigit() and port != "":
             Log.info(self, "Please Enter valid port number :")
             port = input("EasyEngine admin port [22222]:")
         self.app.pargs.user_input = port
     if EEVariables.ee_platform_distro == 'Ubuntu':
         EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
                              "{port} default_server ssl spdy;/\" "
                              "/etc/nginx/sites-available/22222"
                              .format(port=self.app.pargs.user_input))
     if EEVariables.ee_platform_distro == 'debian':
         EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
                              "{port} default_server ssl;/\" "
                              "/etc/nginx/sites-available/22222"
                              .format(port=self.app.pargs.user_input))
     EEGit.add(self, ["/etc/nginx"],
               msg="Adding changed secure port into Git")
     EEService.reload_service(self, 'nginx')
     Log.info(self, "Successfully port changed {port}"
              .format(port=self.app.pargs.user_input))
开发者ID:dengine,项目名称:easyengine,代码行数:32,代码来源:secure.py

示例6: removeNginxConf

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
def removeNginxConf(self, domain):
    if os.path.isfile("/etc/nginx/sites-available/{0}".format(domain)):
        Log.debug(self, "Removing Nginx configuration")
        EEFileUtils.rm(self, "/etc/nginx/sites-enabled/{0}".format(domain))
        EEFileUtils.rm(self, "/etc/nginx/sites-available/{0}".format(domain))
        EEService.reload_service(self, "nginx")
        EEGit.add(self, ["/etc/nginx"], msg="Deleted {0} ".format(domain))
开发者ID:rjagadishsingh,项目名称:easyengine,代码行数:9,代码来源:site_functions.py

示例7: secure_port

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
 def secure_port(self):
     """This function Secures port"""
     if self.app.pargs.user_input:
         while not self.app.pargs.user_input.isdigit():
             Log.info(self, "Please Enter valid port number ")
             self.app.pargs.user_input = input("EasyEngine "
                                               "admin port [22222]:")
     if not self.app.pargs.user_input:
         port = input("EasyEngine admin port [22222]:")
         if port == "":
             self.app.pargs.user_input = 22222
         while not port.isdigit() and port != "":
             Log.info(self, "Please Enter valid port number :")
             port = input("EasyEngine admin port [22222]:")
         self.app.pargs.user_input = port
     if EEVariables.ee_platform_distro == 'ubuntu':
         EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
                              "{port} default_server ssl {http2};/\" "
                              "/etc/nginx/sites-available/22222"
                              .format(port=self.app.pargs.user_input,http2=("http2" if
                                                        EEAptGet.is_installed(self,'nginx-mainline') else "spdy")))
     if EEVariables.ee_platform_distro == 'debian':
         EEShellExec.cmd_exec(self, "sed -i \"s/listen.*/listen "
                              "{port} default_server ssl {http2};/\" "
                              "/etc/nginx/sites-available/22222"
                              .format(port=self.app.pargs.user_input,http2=("http2" if
                                                        EEAptGet.is_installed(self,'nginx-mainline') else "spdy")))
     EEGit.add(self, ["/etc/nginx"],
               msg="Adding changed secure port into Git")
     if not EEService.reload_service(self, 'nginx'):
         Log.error(self, "service nginx reload failed. "
                   "check issues with `nginx -t` command")
     Log.info(self, "Successfully port changed {port}"
              .format(port=self.app.pargs.user_input))
开发者ID:LitespeedUK,项目名称:easyengine,代码行数:36,代码来源:secure.py

示例8: signal_handler

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
    def signal_handler(self, signal, frame):
        """Handle Ctrl+c hevent for -i option of debug"""
        self.start = False
        if self.app.pargs.nginx:
            self.app.pargs.nginx = 'off'
            self.debug_nginx()
        if self.app.pargs.php:
            self.app.pargs.php = 'off'
            self.debug_php()
        if self.app.pargs.php7:
            self.app.pargs.php7 = 'off'
            self.debug_php7()
        if self.app.pargs.fpm:
            self.app.pargs.fpm = 'off'
            self.debug_fpm()
        if self.app.pargs.fpm7:
            self.app.pargs.fpm7 = 'off'
            self.debug_fpm7()
        if self.app.pargs.mysql:
            # MySQL debug will not work for remote MySQL
            if EEVariables.ee_mysql_host is "localhost":
                self.app.pargs.mysql = 'off'
                self.debug_mysql()
            else:
                Log.warn(self, "Remote MySQL found, EasyEngine will not "
                         "enable remote debug")
        if self.app.pargs.wp:
            self.app.pargs.wp = 'off'
            self.debug_wp()
        if self.app.pargs.rewrite:
            self.app.pargs.rewrite = 'off'
            self.debug_rewrite()

        # Reload Nginx
        if self.trigger_nginx:
            EEService.reload_service(self, 'nginx')

        # Reload PHP
        if self.trigger_php:
            if EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial':
                if EEAptGet.is_installed(self,'php5.6-fpm'):
                    EEService.reload_service(self, 'php5.6-fpm')
                if EEAptGet.is_installed(self,'php7.0-fpm'):
                    EEService.reload_service(self, 'php7.0-fpm')
            else:
                EEService.reload_service(self, 'php5-fpm')
        self.app.close(0)
开发者ID:Backenkoehler,项目名称:easyengine,代码行数:49,代码来源:debug.py

示例9: default

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]

#.........这里部分代码省略.........
                                                    "| crontab -\""
                                                    .format(cron_time)):
                            Log.error(self, "failed to update crontab entry")
                    else:
                        Log.info(self, "removing crontab entry,"
                                 " please wait...")
                        if not EEShellExec.cmd_exec(self, "/bin/bash -c "
                                                    "\"crontab "
                                                    "-l | sed '/EasyEngine "
                                                    "start MySQL slow "
                                                    "log/,+2d'"
                                                    "| crontab -\""
                                                    .format(cron_time)):
                            Log.error(self, "failed to remove crontab entry")
            except CommandExecutionError as e:
                Log.debug(self, str(e))

        if self.app.pargs.all == 'on':
            if self.app.pargs.site_name:
                self.app.pargs.wp = 'on'
            self.app.pargs.nginx = 'on'
            self.app.pargs.php = 'on'
            self.app.pargs.fpm = 'on'
            if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial') and EEAptGet.is_installed(self,'php7.0-fpm'):
                self.app.pargs.php7 = 'on'
                self.app.pargs.fpm7 = 'on'
            self.app.pargs.mysql = 'on'
            self.app.pargs.rewrite = 'on'

        if self.app.pargs.all == 'off':
            if self.app.pargs.site_name:
                self.app.pargs.wp = 'off'
            self.app.pargs.nginx = 'off'
            self.app.pargs.php = 'off'
            self.app.pargs.fpm = 'off'
            if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial') and EEAptGet.is_installed(self,'php7.0-fpm'):
                self.app.pargs.php7 = 'off'
                self.app.pargs.fpm7 = 'off'
            self.app.pargs.mysql = 'off'
            self.app.pargs.rewrite = 'off'

        if ((not self.app.pargs.nginx) and (not self.app.pargs.php) and (not self.app.pargs.php7)
           and (not self.app.pargs.fpm) and (not self.app.pargs.fpm7) and (not self.app.pargs.mysql)
           and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
           and self.app.pargs.site_name):
            self.app.args.print_help()
            # self.app.pargs.nginx = 'on'
            # self.app.pargs.wp = 'on'
            # self.app.pargs.rewrite = 'on'

        if self.app.pargs.nginx:
            self.debug_nginx()
        if self.app.pargs.php:
            self.debug_php()
        if self.app.pargs.fpm:
            self.debug_fpm()
        if self.app.pargs.php7:
            self.debug_php7()
        if self.app.pargs.fpm7:
            self.debug_fpm7()
        if self.app.pargs.mysql:
            # MySQL debug will not work for remote MySQL
            if EEVariables.ee_mysql_host is "localhost":
                self.debug_mysql()
            else:
                Log.warn(self, "Remote MySQL found, EasyEngine will not "
                         "enable remote debug")
        if self.app.pargs.wp:
            self.debug_wp()
        if self.app.pargs.rewrite:
            self.debug_rewrite()

        if self.app.pargs.interactive:
            self.interactive = True

        # Reload Nginx
        if self.trigger_nginx:
            EEService.reload_service(self, 'nginx')
        # Reload PHP
        if self.trigger_php:
            if (EEVariables.ee_platform_codename == 'trusty' or EEVariables.ee_platform_codename == 'xenial'):
                if EEAptGet.is_installed(self,'php5.6-fpm'):
                    EEService.restart_service(self, 'php5.6-fpm')
                if EEAptGet.is_installed(self,'php7.0-fpm'):
                    EEService.restart_service(self, 'php7.0-fpm')
            else:
                EEService.restart_service(self, 'php5-fpm')

        if len(self.msg) > 0:
            if not self.app.pargs.interactive:
                disp_msg = ' '.join(self.msg)
                Log.info(self, "Use following command to check debug logs:\n"
                         + Log.ENDC + "tail -f {0}".format(disp_msg))
            else:
                signal.signal(signal.SIGINT, self.signal_handler)
                watch_list = []
                for w_list in self.msg:
                    watch_list = watch_list + glob.glob(w_list)

                logwatch(self, watch_list)
开发者ID:Backenkoehler,项目名称:easyengine,代码行数:104,代码来源:debug.py

示例10: default

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
    def default(self):
        """Default function of debug"""
        # self.start = True
        self.interactive = False
        self.msg = []
        self.trigger_nginx = False
        self.trigger_php = False

        if ((not self.app.pargs.nginx) and (not self.app.pargs.php)
           and (not self.app.pargs.fpm) and (not self.app.pargs.mysql)
           and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
           and (not self.app.pargs.all)
           and (not self.app.pargs.site_name)):
            if self.app.pargs.stop or self.app.pargs.start:
                print("--start/stop option is deprecated since ee3.0.5")
                self.app.args.print_help()
            else:
                self.app.args.print_help()

        if self.app.pargs.all == 'on':
            if self.app.pargs.site_name:
                self.app.pargs.wp = 'on'
            self.app.pargs.nginx = 'on'
            self.app.pargs.php = 'on'
            self.app.pargs.fpm = 'on'
            self.app.pargs.mysql = 'on'
            self.app.pargs.rewrite = 'on'

        if self.app.pargs.all == 'off':
            if self.app.pargs.site_name:
                self.app.pargs.wp = 'off'
            self.app.pargs.nginx = 'off'
            self.app.pargs.php = 'off'
            self.app.pargs.fpm = 'off'
            self.app.pargs.mysql = 'off'
            self.app.pargs.rewrite = 'off'

        if ((not self.app.pargs.nginx) and (not self.app.pargs.php)
           and (not self.app.pargs.fpm) and (not self.app.pargs.mysql)
           and (not self.app.pargs.wp) and (not self.app.pargs.rewrite)
           and self.app.pargs.site_name):
            self.app.args.print_help()
            # self.app.pargs.nginx = 'on'
            # self.app.pargs.wp = 'on'
            # self.app.pargs.rewrite = 'on'

        if self.app.pargs.nginx:
            self.debug_nginx()
        if self.app.pargs.php:
            self.debug_php()
        if self.app.pargs.fpm:
            self.debug_fpm()
        if self.app.pargs.mysql:
            # MySQL debug will not work for remote MySQL
            if EEVariables.ee_mysql_host is "localhost":
                self.debug_mysql()
            else:
                Log.warn(self, "Remote MySQL found, EasyEngine will not "
                         "enable remote debug")
        if self.app.pargs.wp:
            self.debug_wp()
        if self.app.pargs.rewrite:
            self.debug_rewrite()

        if self.app.pargs.interactive:
            self.interactive = True

        # Reload Nginx
        if self.trigger_nginx:
            EEService.reload_service(self, 'nginx')
        # Reload PHP
        if self.trigger_php:
            EEService.restart_service(self, 'php5-fpm')

        if len(self.msg) > 0:
            if not self.app.pargs.interactive:
                disp_msg = ' '.join(self.msg)
                Log.info(self, "Use following command to check debug logs:\n"
                         + Log.ENDC + "tail -f {0}".format(disp_msg))
            else:
                signal.signal(signal.SIGINT, self.signal_handler)
                watch_list = []
                for w_list in self.msg:
                    watch_list = watch_list + glob.glob(w_list)

                logwatch(self, watch_list)
开发者ID:etokareva,项目名称:easyengine,代码行数:88,代码来源:debug.py

示例11: reload

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
    def reload(self):
        """Reload service"""
        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:
            Log.info(self, "HHVM does not support to reload")

        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, "Reloading service: {0}".format(service))
            EEService.reload_service(self, service)
开发者ID:MansoorMajeed,项目名称:easyengine,代码行数:89,代码来源:stack_services.py

示例12: default

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]
    def default(self):
        """Default function of debug"""
        self.start = True
        self.interactive = False
        self.msg = []
        self.trigger_nginx = False
        self.trigger_php = False

        if self.app.pargs.stop:
            self.start = False

        if (
            (not self.app.pargs.nginx)
            and (not self.app.pargs.php)
            and (not self.app.pargs.fpm)
            and (not self.app.pargs.mysql)
            and (not self.app.pargs.wp)
            and (not self.app.pargs.rewrite)
            and (not self.app.pargs.site_name)
        ):
            self.app.pargs.nginx = True
            self.app.pargs.php = True
            self.app.pargs.fpm = True
            self.app.pargs.mysql = True
            self.app.pargs.rewrite = True

        if (
            (not self.app.pargs.nginx)
            and (not self.app.pargs.php)
            and (not self.app.pargs.fpm)
            and (not self.app.pargs.mysql)
            and (not self.app.pargs.wp)
            and (not self.app.pargs.rewrite)
            and self.app.pargs.site_name
        ):
            self.app.pargs.nginx = True
            self.app.pargs.wp = True
            self.app.pargs.rewrite = True

        if self.app.pargs.nginx:
            self.debug_nginx()
        if self.app.pargs.php:
            self.debug_php()
        if self.app.pargs.fpm:
            self.debug_fpm()
        if self.app.pargs.mysql:
            # MySQL debug will not work for remote MySQL
            if EEVariables.ee_mysql_host is "localhost":
                self.debug_mysql()
            else:
                Log.warn(self, "Remote MySQL found, EasyEngine will not " "enable remote debug")
        if self.app.pargs.wp:
            self.debug_wp()
        if self.app.pargs.rewrite:
            self.debug_rewrite()

        if self.app.pargs.interactive:
            self.interactive = True

        # Reload Nginx
        if self.trigger_nginx:
            EEService.reload_service(self, "nginx")
        # Reload PHP
        if self.trigger_php:
            EEService.reload_service(self, "php5-fpm")

        if len(self.msg) > 0:
            if not self.app.pargs.interactive:
                disp_msg = " ".join(self.msg)
                Log.info(
                    self, "Use following command to check debug logs:\n" + Log.ENDC + "tail -f {0}".format(disp_msg)
                )
            else:
                signal.signal(signal.SIGINT, self.signal_handler)
                watch_list = []
                for w_list in self.msg:
                    watch_list = watch_list + glob.glob(w_list)

                logwatch(self, watch_list)
开发者ID:rahul286,项目名称:easyengine,代码行数:81,代码来源:debug.py

示例13: default

# 需要导入模块: from ee.core.services import EEService [as 别名]
# 或者: from ee.core.services.EEService import reload_service [as 别名]

#.........这里部分代码省略.........
                pagespeed = False

        if not data:
            Log.error(self, " Cannot update {0}, Invalid Options"
                      .format(ee_domain))

        ee_auth = site_package_check(self, stype)
        data['ee_db_name'] = check_site.db_name
        data['ee_db_user'] = check_site.db_user
        data['ee_db_pass'] = check_site.db_password
        data['ee_db_host'] = check_site.db_host
        try:
            sitebackup(self, data)
        except Exception as e:
            Log.debug(self, str(e))
            Log.error(self, "Check logs for reason "
                      "`tail /var/log/ee/ee.log` & Try Again!!!")

        # setup NGINX configuration, and webroot
        try:
            setupdomain(self, data)
        except SiteError as e:
            Log.debug(self, str(e))
            Log.error(self, "Update site failed. Check logs for reason "
                      "`tail /var/log/ee/ee.log` & Try Again!!!")

        # Update pagespeed config
        if self.app.pargs.pagespeed:
            operateOnPagespeed(self, data)

        if stype == oldsitetype and cache == oldcachetype:

            # Service Nginx Reload
            EEService.reload_service(self, 'nginx')

            updateSiteInfo(self, ee_domain, stype=stype, cache=cache,
                           hhvm=hhvm, pagespeed=pagespeed)

            Log.info(self, "Successfully updated site"
                     " http://{0}".format(ee_domain))
            self.app.close(0)

        if 'ee_db_name' in data.keys() and not data['wp']:
            try:
                data = setupdatabase(self, data)
            except SiteError as e:
                Log.debug(self, str(e))
                Log.error(self, "Update site failed. Check logs for reason "
                          "`tail /var/log/ee/ee.log` & Try Again!!!")
            try:
                eedbconfig = open("{0}/ee-config.php".format(ee_site_webroot),
                                  encoding='utf-8', mode='w')
                eedbconfig.write("<?php \ndefine('DB_NAME', '{0}');"
                                 "\ndefine('DB_USER', '{1}'); "
                                 "\ndefine('DB_PASSWORD', '{2}');"
                                 "\ndefine('DB_HOST', '{3}');\n?>"
                                 .format(data['ee_db_name'],
                                         data['ee_db_user'],
                                         data['ee_db_pass'],
                                         data['ee_db_host']))
                eedbconfig.close()
            except IOError as e:
                Log.debug(self, str(e))
                Log.debug(self, "creating ee-config.php failed.")
                Log.error(self, "Update site failed. Check logs for reason "
                          "`tail /var/log/ee/ee.log` & Try Again!!!")
开发者ID:etokareva,项目名称:easyengine,代码行数:70,代码来源:site.py


注:本文中的ee.core.services.EEService.reload_service方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。