From 11436f8914a805dbe3749f1b61beacc0b1c830df Mon Sep 17 00:00:00 2001 From: baiziyu Date: Sat, 14 May 2022 12:58:15 +0800 Subject: [PATCH] Add default log_dir argument Add a default log dir argument to system service. Change-Id: I78765221ff50e7ba23c6319f15579c39ca32f13c --- devstack/plugin.sh | 3 +-- devstack/settings | 1 + venus/cmd/api.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 966c329..c2fb04c 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -43,7 +43,7 @@ function configure_venus() { } function start_venus() { - run_process venus-api "$VENUS_BIN_DIR/venus-api" + run_process venus-api "$VENUS_BIN_DIR/venus-api --log-dir=$VENUS_LOG_DIR" } function install_elastic_search() { @@ -92,7 +92,6 @@ function install_fluentd() { fi # Create log dir - VENUS_LOG_DIR="/var/log/kolla" sudo install -d -o $STACK_USER -m 777 $VENUS_LOG_DIR # Copy fluentd conf diff --git a/devstack/settings b/devstack/settings index 3104163..6e280a9 100644 --- a/devstack/settings +++ b/devstack/settings @@ -9,6 +9,7 @@ enable_service venus-api VENUS_DIR=$DEST/venus VENUS_CONF_DIR=/etc/venus VENUS_CONF=$VENUS_CONF_DIR/venus.conf +VENUS_LOG_DIR=/var/log/venus # HOST and PORT VENUS_SERVICE_PROTOCOL=$SERVICE_PROTOCOL diff --git a/venus/cmd/api.py b/venus/cmd/api.py index 5806ef0..613dc67 100644 --- a/venus/cmd/api.py +++ b/venus/cmd/api.py @@ -35,8 +35,8 @@ def main(): CONF(sys.argv[1:], project='venus', version=version.version_string()) logdir = CONF.log_dir - is_exits = os.path.exists(logdir) - if not is_exits: + is_exists = os.path.exists(logdir) + if not is_exists: os.makedirs(logdir) logging.setup(CONF, "venus") utils.monkey_patch()