From b3f234d69ed72be24c13f91f4a24560cf93e276a Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 2 Feb 2026 11:14:08 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Update=20codebase=20?= =?UTF-8?q?=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/init.d/00-opengist.sh --- rootfs/usr/local/bin/entrypoint.sh | 14 ++++++++++++-- rootfs/usr/local/etc/docker/init.d/00-opengist.sh | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/rootfs/usr/local/bin/entrypoint.sh b/rootfs/usr/local/bin/entrypoint.sh index 11a541a..a4c8e99 100755 --- a/rootfs/usr/local/bin/entrypoint.sh +++ b/rootfs/usr/local/bin/entrypoint.sh @@ -363,8 +363,18 @@ fi # - - - - - - - - - - - - - - - - - - - - - - - - - # if no pid assume container restart - clean stale files on restart if [ -f "$ENTRYPOINT_PID_FILE" ]; then - START_SERVICES="no" - touch "$ENTRYPOINT_PID_FILE" + # Check if the PID in the file is still running + entrypoint_pid=$(cat "$ENTRYPOINT_PID_FILE" 2>/dev/null || echo "") + if [ -n "$entrypoint_pid" ] && kill -0 "$entrypoint_pid" 2>/dev/null; then + # Process is still running, don't restart services + START_SERVICES="no" + touch "$ENTRYPOINT_PID_FILE" + else + # PID file exists but process is dead - this is a restart + START_SERVICES="yes" + # Clean any stale PID files on restart + rm -f /run/__start_init_scripts.pid /run/init.d/*.pid /run/*.pid 2>/dev/null || true + fi else START_SERVICES=yes # Clean any stale PID files on first run diff --git a/rootfs/usr/local/etc/docker/init.d/00-opengist.sh b/rootfs/usr/local/etc/docker/init.d/00-opengist.sh index d2c8358..f1e6819 100755 --- a/rootfs/usr/local/etc/docker/init.d/00-opengist.sh +++ b/rootfs/usr/local/etc/docker/init.d/00-opengist.sh @@ -106,7 +106,7 @@ LOG_DIR="/data/logs/opengist" # set log directory WORK_DIR="" # - - - - - - - - - - - - - - - - - - - - - - - - - # port which service is listening on -SERVICE_PORT="" +SERVICE_PORT="80" # - - - - - - - - - - - - - - - - - - - - - - - - - # User to use to launch service - IE: postgres RUNAS_USER="root" # normally root @@ -257,7 +257,7 @@ __update_conf_files() { # replace variables # __replace "" "" "$CONF_DIR/opengist.conf" # replace variables recursively - # __find_replace "" "" "$CONF_DIR" + __initialize_replace_variables "$ETC_DIR" "$CONF_DIR" # - - - - - - - - - - - - - - - - - - - - - - - - - # define actions