mirror of
https://github.com/casjaysdevdocker/squidguard
synced 2026-05-15 14:47:47 -04:00
🗃️ rootfs: shield internal entrypoint PID files from /run/*.pid sweeps 🗃️
Some checks failed
release-tag / release-image (push) Has been cancelled
Some checks failed
release-tag / release-image (push) Has been cancelled
Update the embedded entrypoint copies in rootfs/ to match the upstream template change. Internal state files renamed to dotfiles so they're not matched by `/run/*.pid` cleanup globs: - /run/init.d/entrypoint.pid -> /run/.entrypoint.pid - /run/no_exit.pid -> /run/.no_exit.pid - /run/backup.pid -> /run/.backup.pid - /run/__start_init_scripts.pid -> /run/.start_init_scripts.pid Per-service PIDs in /run/init.d/ are unchanged. rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/functions/entrypoint.sh rootfs/usr/local/share/template-files/config/env/default.sample rootfs/usr/local/share/template-files/config/env/examples/zz-entrypoint.sh
This commit is contained in:
@@ -235,11 +235,11 @@ __no_exit() {
|
||||
local failed_services=""
|
||||
local failure_count=0
|
||||
|
||||
[ -f "/run/no_exit.pid" ] && return 0
|
||||
[ -f "/run/.no_exit.pid" ] && return 0
|
||||
|
||||
exec bash -c "
|
||||
trap 'echo \"Container shutdown requested\"; rm -f /run/no_exit.pid /run/*.pid; exit 0' TERM INT
|
||||
echo \$\$ > /run/no_exit.pid
|
||||
trap 'echo \"Container shutdown requested\"; rm -f /run/.no_exit.pid /run/*.pid; exit 0' TERM INT
|
||||
echo \$\$ > /run/.no_exit.pid
|
||||
|
||||
while true; do
|
||||
if [ -n \"$monitor_services\" ] && [ \"$monitor_services\" != \"tini\" ]; then
|
||||
@@ -995,13 +995,13 @@ __start_init_scripts() {
|
||||
local retstatus="0"
|
||||
local initStatus="0"
|
||||
local critical_failures="0"
|
||||
local pidFile="/run/__start_init_scripts.pid"
|
||||
local pidFile="/run/.start_init_scripts.pid"
|
||||
local init_dir="${1:-/usr/local/etc/docker/init.d}"
|
||||
local init_count="$(ls -A "$init_dir"/* 2>/dev/null | grep -v '\.sample' | wc -l)"
|
||||
local exit_on_failure="${EXIT_ON_SERVICE_FAILURE:-true}"
|
||||
|
||||
# Clean stale PID files from previous runs
|
||||
if [ ! -f "/run/__start_init_scripts.pid" ]; then
|
||||
if [ ! -f "/run/.start_init_scripts.pid" ]; then
|
||||
echo "🧹 Cleaning stale PID files from previous container run"
|
||||
rm -f /run/*.pid /run/init.d/*.pid 2>/dev/null || true
|
||||
fi
|
||||
@@ -1569,7 +1569,7 @@ __backup() {
|
||||
fi
|
||||
local exitCodeP=0
|
||||
local exitStatus=0
|
||||
local pidFile="/run/backup.pid"
|
||||
local pidFile="/run/.backup.pid"
|
||||
local logDir="/data/log/backups"
|
||||
maxDays="${BACKUP_MAX_DAYS:-$maxDays}"
|
||||
cronTime="${BACKUP_RUN_CRON:-$cronTime}"
|
||||
@@ -1649,7 +1649,7 @@ export LIGHTTPD_CONFIG_FILE="${LIGHTTPD_CONFIG_FILE:-$(__find_lighttpd_conf)}"
|
||||
export MARIADB_CONFIG_FILE="${MARIADB_CONFIG_FILE:-$(__find_mysql_conf)}"
|
||||
export POSTGRES_CONFIG_FILE="${POSTGRES_CONFIG_FILE:-$(__find_pgsql_conf)}"
|
||||
export MONGODB_CONFIG_FILE="${MONGODB_CONFIG_FILE:-$(__find_mongodb_conf)}"
|
||||
export ENTRYPOINT_PID_FILE="${ENTRYPOINT_PID_FILE:-/run/init.d/entrypoint.pid}"
|
||||
export ENTRYPOINT_PID_FILE="${ENTRYPOINT_PID_FILE:-/run/.entrypoint.pid}"
|
||||
export ENTRYPOINT_INIT_FILE="${ENTRYPOINT_INIT_FILE:-/config/.entrypoint.done}"
|
||||
export ENTRYPOINT_DATA_INIT_FILE="${ENTRYPOINT_DATA_INIT_FILE:-/data/.docker_has_run}"
|
||||
export ENTRYPOINT_CONFIG_INIT_FILE="${ENTRYPOINT_CONFIG_INIT_FILE:-/config/.docker_has_run}"
|
||||
|
||||
Reference in New Issue
Block a user