Beispiel #1
0
    def __init__(self):
        pidFile = REPO_CONFIG.get('SCHEDULER_DAEMON_PIDFILE')

        self.stdout = sys.stdout
        self.stderr = sys.stderr
        self.pidfile_path = pidFile
        self.pidfile_timeout = 5
    def __init__(self):
        pidFile = REPO_CONFIG.get('SCHEDULER_DAEMON_PIDFILE')

        self.stdout = sys.stdout
        self.stderr = sys.stderr
        self.pidfile_path = pidFile
        self.pidfile_timeout = 5
    def __init__(self, app):
        self.parse_args()
        self.app = app
        
        signalHandlerMap = {signal.SIGTERM: self.app.stop}

        uid = pwd.getpwnam(REPO_CONFIG.get('DAEMON_USER')).pw_uid
        gid = grp.getgrnam(REPO_CONFIG.get('DAEMON_GROUP')).gr_gid
        self.daemon_context = DaemonContext(signal_map=signalHandlerMap, working_directory='.', uid=uid, gid=gid, umask=022)
        self.daemon_context.stdin = None
        self.daemon_context.stdout = self.app.stdout
        self.daemon_context.stderr = self.app.stderr

        self.pidfile = None
        if app.pidfile_path is not None:
            self.pidfile = make_pidlockfile(
                app.pidfile_path, app.pidfile_timeout)
        self.daemon_context.pidfile = self.pidfile
Beispiel #4
0
    def __init__(self, app):
        self.parse_args()
        self.app = app

        signalHandlerMap = {signal.SIGTERM: self.app.stop}

        uid = pwd.getpwnam(REPO_CONFIG.get('DAEMON_USER')).pw_uid
        gid = grp.getgrnam(REPO_CONFIG.get('DAEMON_GROUP')).gr_gid
        self.daemon_context = DaemonContext(signal_map=signalHandlerMap,
                                            working_directory='.',
                                            uid=uid,
                                            gid=gid,
                                            umask=022)
        self.daemon_context.stdin = None
        self.daemon_context.stdout = self.app.stdout
        self.daemon_context.stderr = self.app.stderr

        self.pidfile = None
        if app.pidfile_path is not None:
            self.pidfile = make_pidlockfile(app.pidfile_path,
                                            app.pidfile_timeout)
        self.daemon_context.pidfile = self.pidfile
Beispiel #5
0
def get_repo_dir():
    return REPO_CONFIG.get("REPO_DIR")
 def getRepoCacheDir(self, reponame = ''):
     return REPO_CONFIG.get('REPO_CACHE_DIR') + '/yum-repo-server/' + reponame
Beispiel #7
0
def get_repo_dir():
    return REPO_CONFIG.get('REPO_DIR')