Example #1
0
    def __init__(self):
        super().__init__()
        # requirements checking
        self.checkUserGroup()
        self.ensureOneInstance()
        os.umask(0o006)

        # initialize variables
        signal.signal(signal.SIGTERM, self.unload)
        signal.signal(signal.SIGINT, self.unload)
        self.settings = SettingsAccessorBase(constants.XWARED_CONFIG_FILE,
                                             XWARED_DEFAULTS_SETTINGS)
        self.toRunETM = self.settings.getbool("xwared", "startetm")

        # ipc listener
        self.listener = XwaredCommunicationListener(self)
        self.listener.start()

        # using pyinotify to monitor etm.cfg changes
        self.setupCfgWatcher()
Example #2
0
    def __init__(self, log_novomit):
        super().__init__()
        self._log_novomit = log_novomit
        self.etmPid = 0
        self.fdLock = None
        self.toRunETM = None
        self.etmStartedAt = None
        self.etmLongevities = None

        # Cfg watchers
        self.etmCfg = dict()
        self.watchManager = None
        self.cfgWatcher = None

        # requirements checking
        self.ensureNonRoot()
        profileBootstrap(constants.PROFILE_DIR)
        setupLogging()

        self.ensureOneInstance()

        tryRemove(constants.XWARED_SOCKET)

        # initialize variables
        signal.signal(signal.SIGTERM, self.unload)
        signal.signal(signal.SIGINT, self.unload)
        self.settings = SettingsAccessorBase(constants.XWARED_CONFIG_FILE,
                                             XWARED_DEFAULTS_SETTINGS)
        self.toRunETM = self.settings.getbool("xwared", "startetm")
        self.etmLogs = collections.deque(maxlen=250)
        self._resetEtmLongevities()

        # ipc listener
        self.listener = ServerThread(self)
        self.listener.start()

        # using pyinotify to monitor etm.cfg changes
        self.setupCfgWatcher()
Example #3
0
    def __init__(self):
        super().__init__()
        # requirements checking
        self.ensureNonRoot()
        self.ensureOneInstance()

        profileBootstrap(constants.PROFILE_DIR)
        tryRemove(constants.XWARED_SOCKET[0])

        # initialize variables
        signal.signal(signal.SIGTERM, self.unload)
        signal.signal(signal.SIGINT, self.unload)
        self.settings = SettingsAccessorBase(constants.XWARED_CONFIG_FILE,
                                             XWARED_DEFAULTS_SETTINGS)
        self.toRunETM = self.settings.getbool("xwared", "startetm")
        self._resetEtmLongevities()

        # ipc listener
        self.listener = XwaredCommunicationListener(self)
        self.listener.start()

        # using pyinotify to monitor etm.cfg changes
        self.setupCfgWatcher()