|
@@ -7,7 +7,7 @@ rm -f /var/run/dbus/pid
|
|
|
|
|
|
|
|
# 2. [新增] 启动 DBus 服务
|
|
# 2. [新增] 启动 DBus 服务
|
|
|
mkdir -p /var/run/dbus
|
|
mkdir -p /var/run/dbus
|
|
|
-dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address &
|
|
|
|
|
|
|
+dbus-daemon --system --fork
|
|
|
|
|
|
|
|
# 3. 启动 Xvfb
|
|
# 3. 启动 Xvfb
|
|
|
Xvfb :99 -ac -screen 0 1920x1080x24 -nolisten tcp &
|
|
Xvfb :99 -ac -screen 0 1920x1080x24 -nolisten tcp &
|
|
@@ -16,10 +16,11 @@ Xvfb :99 -ac -screen 0 1920x1080x24 -nolisten tcp &
|
|
|
echo "Waiting for Xvfb and DBus..."
|
|
echo "Waiting for Xvfb and DBus..."
|
|
|
sleep 3
|
|
sleep 3
|
|
|
|
|
|
|
|
-# 4. 执行传递给容器的命令
|
|
|
|
|
-# 如果没有传命令,默认执行 python3 main_sentinel.py (为了兼容你以前的习惯)
|
|
|
|
|
|
|
+# 5. 执行外部传进来的命令 (如 python3 main_sentinel.py)
|
|
|
if [ $# -eq 0 ]; then
|
|
if [ $# -eq 0 ]; then
|
|
|
- exec python3 main_sentinel.py
|
|
|
|
|
|
|
+ echo "No command provided, starting bash..."
|
|
|
|
|
+ exec bash
|
|
|
else
|
|
else
|
|
|
|
|
+ echo "Executing command: $@"
|
|
|
exec "$@"
|
|
exec "$@"
|
|
|
fi
|
|
fi
|