# -*- coding: utf-8 -*-
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
"""
This module contains X Ray Agent main run function
"""
import sys
from xray.agent import Agent
from xray.internal.constants import agent_log
from xray.internal.exceptions import XRayError
from xray.internal.utils import configure_logging
def run() -> None:
"""
Main run function
"""
configure_logging(agent_log)
try:
agent = Agent(save_pid=True, background_routine=True)
agent()
except XRayError as e:
print(e)
sys.exit(1)
|