示例#1
0
def activate():
    config = ServicesConfig("services")
    if config.disabled:
        logger.warning("Plugin services: disabled by configuration.")
        return False
    logger.debug("Loading systemd units")
    try:
        ServiceManager().list()
    except NameError:
        logger.error(
            "Failed to list systemd units. Is python-systemd-dbus installed ?")
        return False
    try:
        from mmc.plugins.dashboard.manager import DashboardManager
        from mmc.plugins.services.panel import ServicesPanel, SystemPanel
        DM = DashboardManager()
        DM.register_panel(ServicesPanel("services"))
        DM.register_panel(SystemPanel("system"))
    except ImportError:
        pass

    return True
示例#2
0
def list():
    return ServiceManager().list()
示例#3
0
def status(service):
    return ServiceManager().status(service)
示例#4
0
def reload(service):
    return ServiceManager().reload(service)
示例#5
0
def restart(service):
    return ServiceManager().restart(service)
示例#6
0
def stop(service):
    return ServiceManager().stop(service)
示例#7
0
def start(service):
    return ServiceManager().start(service)
示例#8
0
def server_reboot():
    return ServiceManager().m.reboot()
示例#9
0
def server_power_off():
    return ServiceManager().m.power_off()
示例#10
0
def log(service="", filter=""):
    return ServiceManager().log(service, filter)
示例#11
0
def list_others_services(filter=None):
    return ServiceManager().list_others_services(filter)
示例#12
0
def has_inactive_plugins_services():
    return ServiceManager().has_inactive_plugins_services()
示例#13
0
def list_plugins_services():
    return ServiceManager().list_plugins_services()