@@ -26,7 +26,7 @@ pkgs.dockerTools.buildImage {
|
||||
};
|
||||
|
||||
runAsRoot = ''
|
||||
mkdir -p /var/lib/mysql /run/mysqld
|
||||
mkdir -p /run/mysqld
|
||||
'';
|
||||
|
||||
config = {
|
||||
|
@@ -13,7 +13,7 @@ if [ ! -f "$DATADIR/mysql_upgrade_info" ]; then
|
||||
mariadb-install-db --datadir="$DATADIR" --skip-test-db
|
||||
|
||||
mariadbd --user=root --datadir="$DATADIR" --skip-networking --skip-grant-tables &
|
||||
pid="$!"
|
||||
PID="$!"
|
||||
|
||||
while ! mariadb --protocol=socket -e "
|
||||
FLUSH PRIVILEGES;
|
||||
@@ -28,12 +28,12 @@ if [ ! -f "$DATADIR/mysql_upgrade_info" ]; then
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
kill -QUIT "$pid"
|
||||
wait "$pid" || true
|
||||
kill -QUIT "$PID"
|
||||
wait "$PID" || true
|
||||
fi
|
||||
|
||||
trap 'kill -QUIT "$pid"' INT
|
||||
trap 'kill -QUIT "$PID"' INT
|
||||
mariadbd --user=root --datadir="$DATADIR" "$@" &
|
||||
pid=$!
|
||||
wait "$pid"
|
||||
PID=$!
|
||||
wait "$PID"
|
||||
exit $?
|
||||
|
@@ -65,20 +65,20 @@ cron
|
||||
PHPRC="$(dirname "$(readlink -f "$(which php)")")/../lib/php.ini"
|
||||
export PHPRC
|
||||
|
||||
pidfile=$(mktemp)
|
||||
PIDFILE=$(mktemp)
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
setsid sh -c '
|
||||
echo "$$" > "$1"
|
||||
shift
|
||||
exec httpd "$@"
|
||||
' _ "$pidfile" "$@" &
|
||||
' _ "$PIDFILE" "$@" &
|
||||
|
||||
until [ -s "$pidfile" ]; do sleep 0.01; done
|
||||
until [ -s "$PIDFILE" ]; do sleep 0.01; done
|
||||
|
||||
pid=$(cat "$pidfile")
|
||||
rm "$pidfile"
|
||||
PID=$(cat "$PIDFILE")
|
||||
rm "$PIDFILE"
|
||||
|
||||
trap 'kill -INT "$pid"' INT
|
||||
wait "$pid"
|
||||
trap 'kill -INT "$PID"' INT
|
||||
wait "$PID"
|
||||
exit $?
|
||||
|
@@ -30,7 +30,7 @@ pkgs.dockerTools.buildImage {
|
||||
|
||||
runAsRoot = ''
|
||||
${pkgs.dockerTools.shadowSetup}
|
||||
mkdir -p /etc/postgresql /var/lib/postgresql /run/postgresql
|
||||
mkdir -p /etc/postgresql /run/postgresql
|
||||
cp ${postgresql}/share/postgresql/postgresql.conf.sample /etc/postgresql/postgresql.conf
|
||||
${pkgs.gnused}/bin/sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /etc/postgresql/postgresql.conf
|
||||
'';
|
||||
|
@@ -21,7 +21,6 @@ mkfifo "$LOG_PIPE"
|
||||
fi
|
||||
done < "$LOG_PIPE"
|
||||
) &
|
||||
LOG_PID=$!
|
||||
|
||||
if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
tmpfile=$(mktemp)
|
||||
@@ -42,5 +41,4 @@ if [ ! -s "$PGDATA/PG_VERSION" ]; then
|
||||
pg_ctl -m fast -w stop
|
||||
fi
|
||||
|
||||
trap 'kill $LOG_PID' EXIT
|
||||
exec postgres -c config_file="/etc/postgresql/postgresql.conf" "$@" > "$LOG_PIPE" 2>&1
|
||||
|
@@ -16,8 +16,5 @@ mkfifo "$LOG_PIPE"
|
||||
fi
|
||||
done < "$LOG_PIPE"
|
||||
) &
|
||||
LOG_PID=$!
|
||||
|
||||
trap 'kill $LOG_PID' EXIT
|
||||
|
||||
exec prometheus-fail2ban-exporter "$@" > "$LOG_PIPE" 2>&1
|
||||
|
@@ -16,8 +16,5 @@ mkfifo "$LOG_PIPE"
|
||||
fi
|
||||
done < "$LOG_PIPE"
|
||||
) &
|
||||
LOG_PID=$!
|
||||
|
||||
trap 'kill $LOG_PID' EXIT
|
||||
|
||||
exec prometheus-podman-exporter "$@" > "$LOG_PIPE" 2>&1
|
||||
|
Reference in New Issue
Block a user