Ejemplo n.º 1
0
 def __init__(self):
     self.m = Manager()
     self.config = ServicesConfig("services")
     self.units = []
Ejemplo n.º 2
0
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