Skip to content

Commit b526879

Browse files
Refactor setup.sh to fix message box display issue
1 parent 10433f8 commit b526879

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ install() {
856856
create_dir "$EXTRACT_DIR"
857857
# PROMETHEUS_INSTALL_SCRIPT
858858
message_box "$APP_NAME Installer $INSATLLER_VERSION" 0
859-
message_box "Welcome on board: $(echo "$USER_NAME" | sed 's/.*/\u&/')" 3
859+
message_box "Welcome on board: $(echo "$USER_NAME" | sed 's/.*/\u&/')" 0
860860
check_dependencies
861861

862862
message_box "Choose the installation method\nNote: Release is recommended for production use." 0

src/background_task/log_system_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from src.models import GeneralSettings, SystemInformation
88
from sqlalchemy.exc import SQLAlchemyError
99
from prometheus_client import Counter, Gauge
10-
import os
10+
import os, time
1111

1212
from src.logger import logger
1313
# Flag to track if logging is already scheduled

src/scripts/prometheus.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,26 @@ if docker ps -a --format '{{.Names}}' | grep -q "$CONTAINER_NAME"; then
4545
log "Container $CONTAINER_NAME already exists. Stopping and removing it."
4646
docker stop "$CONTAINER_NAME" &> /dev/null
4747
docker rm "$CONTAINER_NAME" &> /dev/null
48+
else
49+
log "No existing container found. Proceeding to start a new one."
4850
fi
4951

5052
# Run Prometheus container
5153
log "Starting Prometheus container: $CONTAINER_NAME"
52-
docker run -d \
54+
run_output=$(docker run -d \
5355
--name "$CONTAINER_NAME" \
5456
--network "$NETWORK_NAME" \
5557
-p "$PROMETHEUS_PORT:$PROMETHEUS_PORT" \
5658
--restart unless-stopped \
5759
-v "$PROMETHEUS_CONFIG_FILE:/etc/prometheus/prometheus.yml" \
58-
"$PROMETHEUS_IMAGE" &> /dev/null
60+
"$PROMETHEUS_IMAGE" 2>&1) # Capture both stdout and stderr
5961

6062
# Check if Prometheus started successfully
6163
if [ $? -eq 0 ]; then
6264
log "Prometheus container $CONTAINER_NAME started successfully on port $PROMETHEUS_PORT."
6365
log "Prometheus config file located at $PROMETHEUS_CONFIG_FILE"
6466
else
65-
echo "[ERROR] Failed to start Prometheus container."
67+
echo "[ERROR] Failed to start Prometheus container: $run_output"
68+
echo "[ERROR] Checking logs for container: $CONTAINER_NAME"
6669
exit 1
6770
fi

0 commit comments

Comments
 (0)