コード例 #1
0
ファイル: api.py プロジェクト: r15ch13/ajenti-v
    def restart(self):
        open(self.paniclog, 'w').close()

        ServiceMultiplexor.get().get_one(platform_select(
            debian='exim4',
            default='exim',
        )).command('restart')
コード例 #2
0
ファイル: api.py プロジェクト: Eugeny/ajenti-v
    def restart(self):
        open(self.paniclog, 'w').close()

        ServiceMultiplexor.get().get_one(platform_select(
            debian='exim4',
            default='exim',
        )).command('restart')
コード例 #3
0
ファイル: api.py プロジェクト: MaximKiselev/ajenti-v
 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()
コード例 #4
0
ファイル: api.py プロジェクト: r15ch13/ajenti-v
 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()
コード例 #5
0
ファイル: api.py プロジェクト: Eugeny/ajenti-v
 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()
コード例 #6
0
ファイル: main.py プロジェクト: mmplayer/ajenti
    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()
コード例 #7
0
    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.snmpd_config.save()

        self.refresh()
        self.context.notify('info', _('Saved'))
        ServiceMultiplexor.get().get_one(self.service_name).restart()
コード例 #8
0
ファイル: phpfpm.py プロジェクト: Carl-Gaudreault/ajenti-v
 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()
コード例 #9
0
ファイル: unicorn.py プロジェクト: Random-Primate/ajenti-v
    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'])
コード例 #10
0
ファイル: php73fpm.py プロジェクト: teotikalki/ajenti-v
 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.command('reload')
コード例 #11
0
ファイル: unicorn.py プロジェクト: qudexin1986/ajenti-v
    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"])
コード例 #12
0
ファイル: phpfpm.py プロジェクト: qudexin1986/ajenti-v
 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')
コード例 #13
0
ファイル: gunicorn.py プロジェクト: RandomStuffs22/ajenti-v
 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'])
コード例 #14
0
ファイル: nodejs.py プロジェクト: RandomStuffs22/ajenti-v
 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'])
コード例 #15
0
ファイル: phpfpm.py プロジェクト: RandomStuffs22/ajenti-v
 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')
コード例 #16
0
    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'])
コード例 #17
0
ファイル: api.py プロジェクト: RandomStuffs22/ajenti-v
    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')
コード例 #18
0
ファイル: api.py プロジェクト: RandomStuffs22/ajenti-v
    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')
コード例 #19
0
ファイル: processes.py プロジェクト: Carl-Gaudreault/ajenti-v
    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)
コード例 #20
0
    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)
コード例 #21
0
ファイル: api.py プロジェクト: Eugeny/ajenti-v
 def restart(self):
     ServiceMultiplexor.get().get_one(platform_select(
         debian='courier-authdaemon',
         centos='courier-authlib',
     )).restart()
コード例 #22
0
ファイル: api.py プロジェクト: MaximKiselev/ajenti-v
    def restart(self):
        open(self.paniclog, "w").close()

        ServiceMultiplexor.get().get_one(platform_select(debian="exim4", default="exim")).command("restart")
コード例 #23
0
ファイル: pureftpd.py プロジェクト: Dolphi2/ajenti-v
 def apply_configuration(self):
     ServiceMultiplexor.get().get_one('pure-ftpd').restart()
コード例 #24
0
ファイル: nodejs.py プロジェクト: Random-Primate/ajenti-v
 def apply_configuration(self):
     s = ServiceMultiplexor.get().get_one('supervisor')
     if not s.running:
         s.start()
     else:
         subprocess.call(['supervisorctl', 'reload'])
コード例 #25
0
ファイル: nginx.py プロジェクト: mwin007/ajenti-v
 def check(self):
     return ServiceMultiplexor.get().get_one('nginx').running
コード例 #26
0
 def check(self):
     return ServiceMultiplexor.get().get_one('nginx').running
コード例 #27
0
 def save(self):
     self.binder.update()
     self.config.save()
     self.refresh()
     self.context.notify('info', _('Saved'))
     ServiceMultiplexor.get().get_one(self.service_name).restart()
コード例 #28
0
ファイル: nginx.py プロジェクト: pombredanne/ajenti-v
 def apply_configuration(self):
     s = ServiceMultiplexor.get().get_one("nginx")
     if not s.running:
         s.start()
     else:
         s.command("reload")
コード例 #29
0
ファイル: api.py プロジェクト: pirate42/ajenti-v
 def restart(self):
     ServiceMultiplexor.get().get_one('courier-imap').restart()
     if ajenti.platform == 'debian':  # centos runs both
         ServiceMultiplexor.get().get_one('courier-imap-ssl').restart()
コード例 #30
0
def isopenntpd():
    return not ServiceMultiplexor.get().get_one('openntpd') is None
コード例 #31
0
ファイル: api.py プロジェクト: trilce/ajenti-v
 def restart(self):
     ServiceMultiplexor.get().get_one(
         platform_select(
             debian='courier-authdaemon',
             centos='courier-authlib',
         )).restart()
コード例 #32
0
ファイル: phpfpm.py プロジェクト: Random-Primate/ajenti-v
 def apply_configuration(self):
     s = ServiceMultiplexor.get().get_one('php5-fpm')
     if not s.running:
         s.start()
     else:
         s.command('reload')
コード例 #33
0
 def restart(self):
     s = ServiceMultiplexor.get().get_one(fpm_service_name)
     if not s.running:
         s.start()
     else:
         s.command('reload')
コード例 #34
0
ファイル: nginx.py プロジェクト: trilce/ajenti-v
 def restart(self):
     s = ServiceMultiplexor.get().get_one('nginx')
     s.restart()
コード例 #35
0
 def apply_configuration(self):
     ServiceMultiplexor.get().get_one('vsftpd').restart()
コード例 #36
0
ファイル: vsftpd.py プロジェクト: Random-Primate/ajenti-v
 def apply_configuration(self):
     ServiceMultiplexor.get().get_one("vsftpd").restart()
コード例 #37
0
ファイル: nginx.py プロジェクト: danorton/ajenti-v
 def restart(self):
     s = ServiceMultiplexor.get().get_one('nginx')
     if not s.running:
         s.start()
     else:
         s.command('reload')
コード例 #38
0
ファイル: php73fpm.py プロジェクト: teotikalki/ajenti-v
 def check(self):
     return ServiceMultiplexor.get().get_one(fpm_service_name).running
コード例 #39
0
ファイル: api.py プロジェクト: BeryJu/ajenti-v
 def restart(self):
     ServiceMultiplexor.get().get_one(platform_select(
         debian='exim4',
         default='exim',
     )).command('restart')
コード例 #40
0
ファイル: nginx.py プロジェクト: mwin007/ajenti-v
 def restart(self):
     s = ServiceMultiplexor.get().get_one('nginx')
     s.restart()
コード例 #41
0
ファイル: main.py プロジェクト: Viktorminator/ajenti
 def save(self):
     self.binder.update()
     self.config.save()
     self.refresh()
     self.context.notify('info', _('Saved'))
     ServiceMultiplexor.get().get_one(self.service_name).restart()
コード例 #42
0
 def restart(self):
     s = ServiceMultiplexor.get().get_one('nginx')
     if not s.running:
         s.start()
     else:
         s.command('reload')
コード例 #43
0
ファイル: main.py プロジェクト: Viktorminator/ajenti
def isopenntpd():
    return not ServiceMultiplexor.get().get_one('openntpd') is None
コード例 #44
0
ファイル: phpfpm.py プロジェクト: Carl-Gaudreault/ajenti-v
 def check(self):
     return ServiceMultiplexor.get().get_one(fpm_service_name).running
コード例 #45
0
ファイル: puma.py プロジェクト: Random-Primate/ajenti-v
 def apply_configuration(self):
     s = ServiceMultiplexor.get().get_one("supervisor")
     if not s.running:
         s.start()
     else:
         subprocess.call(["supervisorctl", "reload"])