def __init__(self): self.m = Manager() self.config = ServicesConfig("services") self.units = []
from fnmatch import fnmatch from sys import exit from time import time from systemd_dbus.exceptions import SystemdError from systemd_dbus.manager import Manager from systemd_dbus.service import Service from systemd_dbus.timer import Timer logging.basicConfig( format='%(levelname)-8s [%(filename)s:%(lineno)d] %(message)s') logger = logging.getLogger(__name__) now = time() systemd_manager = Manager() class Codes(object): OK = 0 WARNING = 1 CRITICAL = 2 UNKNOWN = 3 class SystemdUnit: """ Systemd unit This class implements wraper around systemd_dbus.unit.Unit with supporting of every unit type