Kaynağa Gözat

fix(s6): 修复 postgres 服务启动时 GPUSTACK_POSTGRES_CONFIG 文件不存在的问题 + 为 data/check 添加执行权限

- postgres run/check/finish 和 migration 脚本中,在 source GPUSTACK_POSTGRES_CONFIG 前检查文件是否存在
- Dockerfile 中新增 chmod +x 对 s6-rc.d/*/data/check 文件的处理
- 当使用外部数据库时,prerun 不会创建 postgresql/.env 文件,postgres 服务会使用 default-variables.sh 中的默认值
kinglee 1 hafta önce
ebeveyn
işleme
40fee7f334

+ 2 - 1
pack/Dockerfile

@@ -403,7 +403,8 @@ COPY pack/rootfs/ /
 COPY docker-compose/grafana/grafana_dashboards/ /etc/dashboards/
 # Fix execute permissions for scripts (lost on Windows bind mount)
 RUN find /etc/s6-overlay -name '*.sh' -exec chmod +x {} + \
-    && find /etc/s6-overlay/scripts -type f ! -name '*.sh' -exec chmod +x {} +
+    && find /etc/s6-overlay/scripts -type f ! -name '*.sh' -exec chmod +x {} + \
+    && find /etc/s6-overlay/s6-rc.d -name 'check' -path '*/data/*' -exec chmod +x {} +
 ## END Install Higress standalone components
 
 ## Install Skopeo

+ 3 - 1
pack/rootfs/etc/s6-overlay/s6-rc.d/postgres/data/check

@@ -4,7 +4,9 @@
 SCRIPT_ROOT=/etc/s6-overlay/scripts
 source "$SCRIPT_ROOT/base.sh"
 # The config should be ready before starting
-source "$GPUSTACK_POSTGRES_CONFIG"
+if [ -f "$GPUSTACK_POSTGRES_CONFIG" ]; then
+    source "$GPUSTACK_POSTGRES_CONFIG"
+fi
 source "$SCRIPT_ROOT/default-variables.sh"
 
 echo "[INFO] Checking Postgres readiness."

+ 3 - 1
pack/rootfs/etc/s6-overlay/s6-rc.d/postgres/finish

@@ -6,7 +6,9 @@ EXIT_SIGNAL="$2"
 SCRIPT_ROOT=/etc/s6-overlay/scripts
 source "$SCRIPT_ROOT/base.sh"
 # The config should be ready before starting
-source "$GPUSTACK_POSTGRES_CONFIG"
+if [ -f "$GPUSTACK_POSTGRES_CONFIG" ]; then
+    source "$GPUSTACK_POSTGRES_CONFIG"
+fi
 source "$SCRIPT_ROOT/default-variables.sh"
 
 PGDATA="${POSTGRES_DATA_DIR}"

+ 3 - 1
pack/rootfs/etc/s6-overlay/s6-rc.d/postgres/run

@@ -8,7 +8,9 @@
 SCRIPT_ROOT=/etc/s6-overlay/scripts
 source "$SCRIPT_ROOT/base.sh"
 # The config should be ready before starting
-source "$GPUSTACK_POSTGRES_CONFIG"
+if [ -f "$GPUSTACK_POSTGRES_CONFIG" ]; then
+    source "$GPUSTACK_POSTGRES_CONFIG"
+fi
 source "$SCRIPT_ROOT/default-variables.sh"
 
 PGDATA="${POSTGRES_DATA_DIR}"

+ 3 - 1
pack/rootfs/etc/s6-overlay/scripts/gpustack-migration.sh

@@ -7,7 +7,9 @@
 SCRIPT_ROOT=/etc/s6-overlay/scripts
 source "$SCRIPT_ROOT/base.sh"
 # The config should be ready before starting
-source "$GPUSTACK_POSTGRES_CONFIG"
+if [ -f "$GPUSTACK_POSTGRES_CONFIG" ]; then
+    source "$GPUSTACK_POSTGRES_CONFIG"
+fi
 source "$SCRIPT_ROOT/default-variables.sh"