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


Python ServiceMultiplexor.get方法代码示例

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


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

示例1: restart

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
    def restart(self):
        open(self.paniclog, 'w').close()

        ServiceMultiplexor.get().get_one(platform_select(
            debian='exim4',
            default='exim',
        )).command('restart')
开发者ID:Eugeny,项目名称:ajenti-v,代码行数:9,代码来源:api.py

示例2: restart

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def restart(self):
     ServiceMultiplexor.get().get_one(
         platform_select(debian="courier-imap", centos="courier-imap", default="courier-imapd")
     ).restart()
     if ajenti.platform != "centos":  # centos runs both
         ServiceMultiplexor.get().get_one(
             platform_select(debian="courier-imap-ssl", default="courier-imapd-ssl")
         ).restart()
开发者ID:MaximKiselev,项目名称:ajenti-v,代码行数:10,代码来源:api.py

示例3: save

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
    def save(self):
        self.binder.update()
        
        mib = MIBData()
        mib.name = ':'.join([x.name for x in self.mibs if x.selected])
        for x in list(self.snmp_config.tree.mibs):
            self.snmp_config.tree.mibs.remove(x)
        self.snmp_config.tree.mibs.append(mib)

        self.snmp_config.save()
        self.refresh()
        self.context.notify('info', _('Saved'))
        ServiceMultiplexor.get().get_one(self.service_name).restart()
开发者ID:mmplayer,项目名称:ajenti,代码行数:15,代码来源:main.py

示例4: restart

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def restart(self):
     s = ServiceMultiplexor.get().get_one(fpm_service_name)
     print fpm_service_name, s, s.running
     if not s.running:
         s.start()
     else:
         s.restart()
开发者ID:Carl-Gaudreault,项目名称:ajenti-v,代码行数:9,代码来源:phpfpm.py

示例5: apply_configuration

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
    def apply_configuration(self):
        log_dir = '/var/log/unicorn'
        if not os.path.exists(log_dir):
            os.makedirs(log_dir)

        s = ServiceMultiplexor.get().get_one('unicorn')
        if not s.running:
            s.start()
        else:
            s.command('reload')

        s = ServiceMultiplexor.get().get_one('supervisor')
        if not s.running:
            s.start()
        else:
            subprocess.call(['supervisorctl', 'reload'])
开发者ID:Random-Primate,项目名称:ajenti-v,代码行数:18,代码来源:unicorn.py

示例6: apply_configuration

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
    def apply_configuration(self):
        log_dir = "/var/log/unicorn"
        if not os.path.exists(log_dir):
            os.makedirs(log_dir)

        s = ServiceMultiplexor.get().get_one("unicorn")
        if not s.running:
            s.start()
        else:
            s.command("reload")

        s = ServiceMultiplexor.get().get_one(platform_select(debian="supervisor", centos="supervisord"))
        if not s.running:
            s.start()
        else:
            subprocess.call(["supervisorctl", "reload"])
开发者ID:qudexin1986,项目名称:ajenti-v,代码行数:18,代码来源:unicorn.py

示例7: apply_configuration

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def apply_configuration(self):
     s = ServiceMultiplexor.get().get_one(platform_select(
         debian='php5-fpm',
         centos='php-fpm',
     ))
     if not s.running:
         s.start()
     else:
         s.command('reload')
开发者ID:qudexin1986,项目名称:ajenti-v,代码行数:11,代码来源:phpfpm.py

示例8: apply_configuration

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def apply_configuration(self):
     s = ServiceMultiplexor.get().get_one(platform_select(
         debian='supervisor',
         centos='supervisord',
     ))
     if not s.running:
         s.start()
     else:
         subprocess.call(['supervisorctl', 'reload'])
开发者ID:RandomStuffs22,项目名称:ajenti-v,代码行数:11,代码来源:nodejs.py

示例9: configure

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
    def configure(self, config):
        open(self.exim_cfg_path, 'w').write(templates.EXIM_CONFIG % {
            'mailname': open('/etc/mailname').read().strip(),
            'maildomains': self.maildomains,
            'mailroot': config.mailroot,
            'custom_mta_acl': config.custom_mta_acl,
            'custom_mta_routers': config.custom_mta_routers,
            'custom_mta_config': config.custom_mta_config,
            'custom_mta_transports': config.custom_mta_transports,
        })
        open(self.courier_authdaemonrc, 'w').write(templates.COURIER_AUTHRC)
        open(self.courier_imaprc, 'w').write(templates.COURIER_IMAP)

        os.chmod('/var/run/courier/authdaemon', 0755)

        if os.path.exists(self.courier_userdb):
            os.unlink(self.courier_userdb)

        if os.path.exists(self.maildomains):
            shutil.rmtree(self.maildomains)

        os.makedirs(self.maildomains)

        for mb in config.mailboxes:
            root = os.path.join(config.mailroot, mb.name)
            if not os.path.exists(root):
                os.makedirs(root)
                os.chown(root, mailuid, mailgid)


            with open(os.path.join(self.maildomains, mb.domain), 'a+') as f:
                f.write(mb.local + '\n')

            subprocess.call([
                'userdb', 
                mb.name, 
                'set', 
                'uid=mail',
                'gid=mail',
                'home=%s' % root,
                'mail=%s' % root,
            ])

            udbpw = subprocess.Popen(['userdbpw', '-md5'], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
            o, e = udbpw.communicate('%s\n%s\n' % (mb.password, mb.password))
            md5pw = o

            udb = subprocess.Popen(['userdb', mb.name, 'set', 'systempw'], stdin=subprocess.PIPE)
            udb.communicate(md5pw)

        subprocess.call(['makeuserdb'])

        ServiceMultiplexor.get().get_one('courier-authdaemon').restart()
        ServiceMultiplexor.get().get_one('courier-imap').restart()
        ServiceMultiplexor.get().get_one('exim4').command('reload')
开发者ID:RandomStuffs22,项目名称:ajenti-v,代码行数:57,代码来源:api.py

示例10: restart

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
    def restart(self):
        s = ServiceMultiplexor.get().get_one(platform_select(
            debian='supervisor',
            default='supervisord',
        ))
        if not s.running:
            s.start()
        else:
            subprocess_call_background(['supervisorctl', 'reload'])

        # Await restart
        retries = 10
        while retries:
            retries -= 1
            if subprocess_call_background(['supervisorctl', 'status']) == 0:
                break
            gevent.sleep(1)
开发者ID:Carl-Gaudreault,项目名称:ajenti-v,代码行数:19,代码来源:processes.py

示例11: apply_configuration

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def apply_configuration(self):
     ServiceMultiplexor.get().get_one("vsftpd").restart()
开发者ID:Random-Primate,项目名称:ajenti-v,代码行数:4,代码来源:vsftpd.py

示例12: restart

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def restart(self):
     s = ServiceMultiplexor.get().get_one('nginx')
     if not s.running:
         s.start()
     else:
         s.command('reload')
开发者ID:danorton,项目名称:ajenti-v,代码行数:8,代码来源:nginx.py

示例13: apply_configuration

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def apply_configuration(self):
     s = ServiceMultiplexor.get().get_one('php5-fpm')
     if not s.running:
         s.start()
     else:
         s.command('reload')
开发者ID:Random-Primate,项目名称:ajenti-v,代码行数:8,代码来源:phpfpm.py

示例14: check

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def check(self):
     return ServiceMultiplexor.get().get_one('nginx').running
开发者ID:mwin007,项目名称:ajenti-v,代码行数:4,代码来源:nginx.py

示例15: restart

# 需要导入模块: from ajenti.plugins.services.api import ServiceMultiplexor [as 别名]
# 或者: from ajenti.plugins.services.api.ServiceMultiplexor import get [as 别名]
 def restart(self):
     ServiceMultiplexor.get().get_one(platform_select(
         debian='exim4',
         default='exim',
     )).command('restart')
开发者ID:BeryJu,项目名称:ajenti-v,代码行数:7,代码来源:api.py


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