Add default log_dir argument

Add a default log dir argument to system service.

Change-Id: I78765221ff50e7ba23c6319f15579c39ca32f13c
This commit is contained in:
baiziyu 2022-05-14 12:58:15 +08:00
parent 11b6bf9111
commit 11436f8914
3 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ function configure_venus() {
} }
function start_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() { function install_elastic_search() {
@ -92,7 +92,6 @@ function install_fluentd() {
fi fi
# Create log dir # Create log dir
VENUS_LOG_DIR="/var/log/kolla"
sudo install -d -o $STACK_USER -m 777 $VENUS_LOG_DIR sudo install -d -o $STACK_USER -m 777 $VENUS_LOG_DIR
# Copy fluentd conf # Copy fluentd conf

View File

@ -9,6 +9,7 @@ enable_service venus-api
VENUS_DIR=$DEST/venus VENUS_DIR=$DEST/venus
VENUS_CONF_DIR=/etc/venus VENUS_CONF_DIR=/etc/venus
VENUS_CONF=$VENUS_CONF_DIR/venus.conf VENUS_CONF=$VENUS_CONF_DIR/venus.conf
VENUS_LOG_DIR=/var/log/venus
# HOST and PORT # HOST and PORT
VENUS_SERVICE_PROTOCOL=$SERVICE_PROTOCOL VENUS_SERVICE_PROTOCOL=$SERVICE_PROTOCOL

View File

@ -35,8 +35,8 @@ def main():
CONF(sys.argv[1:], project='venus', CONF(sys.argv[1:], project='venus',
version=version.version_string()) version=version.version_string())
logdir = CONF.log_dir logdir = CONF.log_dir
is_exits = os.path.exists(logdir) is_exists = os.path.exists(logdir)
if not is_exits: if not is_exists:
os.makedirs(logdir) os.makedirs(logdir)
logging.setup(CONF, "venus") logging.setup(CONF, "venus")
utils.monkey_patch() utils.monkey_patch()