Пример #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()