Example #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
Example #2
0
def list():
    return ServiceManager().list()
Example #3
0
def status(service):
    return ServiceManager().status(service)
Example #4
0
def reload(service):
    return ServiceManager().reload(service)
Example #5
0
def restart(service):
    return ServiceManager().restart(service)
Example #6
0
def stop(service):
    return ServiceManager().stop(service)
Example #7
0
def start(service):
    return ServiceManager().start(service)
Example #8
0
def server_reboot():
    return ServiceManager().m.reboot()
Example #9
0
def server_power_off():
    return ServiceManager().m.power_off()
Example #10
0
def log(service="", filter=""):
    return ServiceManager().log(service, filter)
Example #11
0
def list_others_services(filter=None):
    return ServiceManager().list_others_services(filter)
Example #12
0
def has_inactive_plugins_services():
    return ServiceManager().has_inactive_plugins_services()
Example #13
0
def list_plugins_services():
    return ServiceManager().list_plugins_services()