feat(playout): change playout working directory
- use working dir for storing files BREAKING CHANGE: the playout working directory changed from '/var/tmp/airtime/pypo/' to '/var/lib/libretime/playout' when running with systemd and the current directory by default.
This commit is contained in:
parent
32bea651f6
commit
12f96f5043
7 changed files with 20 additions and 26 deletions
|
@ -24,6 +24,7 @@ from libretime_shared.logging import level_from_name, setup_logger
|
|||
from loguru import logger
|
||||
|
||||
from . import pure
|
||||
from .config import CACHE_DIR, RECORD_DIR
|
||||
from .listenerstat import ListenerStat
|
||||
from .pypofetch import PypoFetch
|
||||
from .pypofile import PypoFile
|
||||
|
@ -35,13 +36,6 @@ from .timeout import ls_timeout
|
|||
|
||||
LIQUIDSOAP_MIN_VERSION = "1.1.1"
|
||||
|
||||
PYPO_HOME = "/var/tmp/airtime/pypo/"
|
||||
|
||||
|
||||
def configure_environment():
|
||||
os.environ["HOME"] = PYPO_HOME
|
||||
os.environ["TERM"] = "xterm"
|
||||
|
||||
|
||||
class Global:
|
||||
def __init__(self, api_client):
|
||||
|
@ -117,13 +111,17 @@ def cli(log_level: str, log_filepath: Optional[Path]):
|
|||
"""
|
||||
setup_logger(level_from_name(log_level), log_filepath)
|
||||
|
||||
configure_environment()
|
||||
|
||||
# loading config file
|
||||
try:
|
||||
config = ConfigObj("/etc/airtime/airtime.conf")
|
||||
except Exception as e:
|
||||
logger.error("Error loading config file: %s", e)
|
||||
|
||||
try:
|
||||
for dir_path in [CACHE_DIR, RECORD_DIR]:
|
||||
dir_path.mkdir(exist_ok=True)
|
||||
except OSError as exception:
|
||||
logger.error(exception)
|
||||
sys.exit(1)
|
||||
|
||||
logger.info("###########################################")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue