mirror of
https://github.com/casjaysdevdocker/opengist
synced 2026-02-11 20:04:24 -05:00
🗃️ Update codebase 🗃️
All checks were successful
release-tag / release-image (push) Successful in 2m9s
All checks were successful
release-tag / release-image (push) Successful in 2m9s
rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/init.d/00-opengist.sh
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user