Skip to content

Commit 321e2c0

Browse files
committed
move logs and tmp into UTBOT_ALL in release script
1 parent b2dbdba commit 321e2c0

File tree

3 files changed

+11
-14
lines changed

3 files changed

+11
-14
lines changed

docker/release_distribution_scripts/utbot_run_system.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ export UTBOT_RELEASE=true
3636
# Retrieving path to $UTBOT_ALL from absolute path to current script
3737
export UTBOT_ALL=$CURRENT_FOLDER
3838

39+
# Common variables
40+
export UTBOT_PROCESS_PATTERN=utbot
41+
export UTBOT_BINARIES_FOLDER=$UTBOT_ALL/server-install
42+
export UTBOT_PID_FILE=$UTBOT_BINARIES_FOLDER/$UTBOT_PROCESS_PATTERN.pid
43+
export UTBOT_LOGS_FOLDER=$UTBOT_ALL
44+
3945
# Setting environment variables according to $UTBOT_ALL
4046
export UTBOT_INSTALL_DIR=$UTBOT_ALL/install
4147
export CC=$UTBOT_ALL/debs-install/usr/bin/gcc-9
@@ -95,13 +101,10 @@ echo "/* GNU ld script
95101
OUTPUT_FORMAT(elf64-x86-64)
96102
GROUP ( /$X86_LIBS/libpthread.so.0 $UTBOT_ALL/debs-install/usr/$X86_LIBS/libpthread_nonshared.a )" > $UTBOT_ALL/debs-install/usr/$X86_LIBS/libpthread.so
97103

98-
# Creating logs directories so that watchdog and utbot can launch
99-
mkdir -p /home/$USER/logs/watchdog
100-
mkdir -p /home/$USER/logs/utbot
104+
mkdir -p $UTBOT_LOGS_FOLDER/logs
101105

102106
# Path to common functions
103-
WATCHDOG_SCRIPT_FOLDER=$UTBOT_ALL/utbot_scripts
104-
COMMON_FUNCTIONS_SCRIPT_PATH=$WATCHDOG_SCRIPT_FOLDER/common_functions.sh
107+
COMMON_FUNCTIONS_SCRIPT_PATH=$UTBOT_ALL/utbot_scripts/common_functions.sh
105108
source $COMMON_FUNCTIONS_SCRIPT_PATH
106109

107110
if [ "$1" = "server" ]
@@ -116,9 +119,8 @@ then
116119

117120
#Server-specific parameters
118121
UTBOT_EXECUTABLE_PATH=$UTBOT_BINARIES_FOLDER/$UTBOT_PROCESS_PATTERN
119-
UTBOT_STDOUT_LOG_FILE=$UTBOT_LOGS_FOLDER/$UTBOT_PROCESS_PATTERN-$(now).log
120-
UTBOT_TMP_FOLDER=$UTBOT_LOGS_FOLDER/tmp
121-
UTBOT_SERVER_OPTIONS="$UTBOT_MODE --port $UTBOT_PORT --log=$UTBOT_LOGS_FOLDER --tmp=$UTBOT_TMP_FOLDER"
122+
UTBOT_STDOUT_LOG_FILE=$UTBOT_LOGS_FOLDER/logs/$UTBOT_PROCESS_PATTERN-$(now).log
123+
UTBOT_SERVER_OPTIONS="$UTBOT_MODE --port $UTBOT_PORT --log=$UTBOT_LOGS_FOLDER --tmp=$UTBOT_ALL"
122124

123125
log "Starting a new server process; logs are written into [$UTBOT_LOGS_FOLDER] folder"
124126
start_process $UTBOT_PROCESS_PATTERN $UTBOT_EXECUTABLE_PATH "$UTBOT_SERVER_OPTIONS" $UTBOT_STDOUT_LOG_FILE $UTBOT_PID_FILE

docker/release_distribution_scripts/utbot_scripts/common_functions.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66

77
# The script provides bash functions that are commonly used in other scripts
88

9-
# Common variables
10-
export UTBOT_PROCESS_PATTERN=utbot
11-
export UTBOT_BINARIES_FOLDER=$UTBOT_ALL/server-install
12-
export UTBOT_PID_FILE=$UTBOT_BINARIES_FOLDER/$UTBOT_PROCESS_PATTERN.pid
13-
export UTBOT_LOGS_FOLDER=/home/$USER/logs/utbot
14-
159
# Common functions
1610

1711
# Returns current timestamp

server/src/utils/CLIUtils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ void CLIUtils::parse(int argc, char **argv, CLI::App &app) {
241241
} else {
242242
CLIUtils::setupLogger(serverCommandOptions.getLogPath(),
243243
serverCommandOptions.getVerbosity());
244+
CLIUtils::setOptPath(serverCommandOptions.getLogPath(), Paths::logPath);
244245
CLIUtils::setOptPath(serverCommandOptions.getTmpPath(), Paths::tmpPath);
245246
Server server;
246247
if (serverCommandOptions.getPort() != 0) {

0 commit comments

Comments
 (0)