def main(): config = get_config() cmd = [ sys.executable, '-m', 'zprocess.zlog', '--port', str(config['zlog_port']), '--cls', 'RotatingFileHandler', '--maxBytes', str(config['logging_maxBytes']), '--backupCount', str(config['logging_backupCount']), '-l', LOG_PATH, ] if config['shared_secret_file'] is not None: cmd += ['--shared-secret-file', config['shared_secret_file']] elif config['allow_insecure']: cmd += ['--allow-insecure'] else: cmd += ['--no-allow-insecure'] if '--daemon' in sys.argv: start_daemon(cmd) else: try: subprocess.call(cmd) except KeyboardInterrupt: pass
def main(): config = get_config() cmd = [ sys.executable, '-m', 'zprocess.remote', '--port', str(config['zprocess_remote_port']), '-l', LOG_PATH, ] if config['shared_secret_file'] is not None: cmd += ['--shared-secret-file', config['shared_secret_file']] elif config['allow_insecure']: cmd += ['--allow-insecure'] else: cmd += ['--no-allow-insecure'] if '--daemon' in sys.argv: start_daemon(cmd) else: if '--no-tui' not in sys.argv: cmd += ['-tui'] try: subprocess.call(cmd) except KeyboardInterrupt: pass
def main(): config = get_config() if gethostbyname(config['zlock_host']) != gethostbyname('localhost'): msg = ( "Zlock not configured to run on this host according to labconfig: " + "zlock_host=%s" % config['zlock_host'] ) raise ValueError(msg) cmd = [ sys.executable, '-m', 'zprocess.zlock', '--port', config['zlock_port'], '-l', LOG_PATH, ] if config['shared_secret_file'] is not None: cmd += ['--shared-secret-file', config['shared_secret_file']] elif config['allow_insecure']: cmd += ['--allow-insecure'] else: cmd += ['--no-allow-insecure'] if '--daemon' in sys.argv: start_daemon(cmd) else: try: subprocess.call(cmd) except KeyboardInterrupt: pass
def main(): config = get_config() cmd = [ sys.executable, '-m', 'zprocess.remote', '--port', str(config['zprocess_remote_port']), '-tui' ] if config['shared_secret_file'] is not None: cmd += ['--shared-secret-file', config['shared_secret_file']] if config['allow_insecure']: cmd += ['--allow-insecure'] # Replace the current process with the call to zprocess.remote: execv(sys.executable, cmd)
def main(): config = get_config() if gethostbyname(config['zlock_host']) != gethostbyname('localhost'): msg = ( "Zlock not configured to run on this host according to labconfig: " + "zlock_host=%s" % config['zlock_host']) raise ValueError(msg) cmd = [ sys.executable, '-m', 'zprocess.zlock', '--port', config['zlock_port'], ] if config['shared_secret_file'] is not None: cmd += ['--shared-secret-file', config['shared_secret_file']] if config['allow_insecure']: cmd += ['--allow-insecure'] # Replace the current process with the call to zlock: execv(sys.executable, cmd)
def main(): config = get_config() cmd = [ sys.executable, '-m', 'zprocess.zlog', '--port', str(config['zlog_port']), '--cls', 'RotatingFileHandler', '--maxBytes', str(config['logging_maxBytes']), '--backupCount', str(config['logging_backupCount']), ] if config['shared_secret_file'] is not None: cmd += ['--shared-secret-file', config['shared_secret_file']] if config['allow_insecure']: cmd += ['--allow-insecure'] # Replace the current process with the call to zlog: execv(sys.executable, cmd)