From 95ed6c16df7a1ef3dc7271219f974aa861bc7f11 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 27 Aug 2024 09:32:30 +0200 Subject: [PATCH] Use LD_PRELOAD for indexer cron job --- .../srv/seeddms/seeddms-6.0.28/utils/seeddms-indexer | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/seeddms/image.d/srv/seeddms/seeddms-6.0.28/utils/seeddms-indexer b/seeddms/image.d/srv/seeddms/seeddms-6.0.28/utils/seeddms-indexer index e6c8bc1..e871760 100755 --- a/seeddms/image.d/srv/seeddms/seeddms-6.0.28/utils/seeddms-indexer +++ b/seeddms/image.d/srv/seeddms/seeddms-6.0.28/utils/seeddms-indexer @@ -1,15 +1,16 @@ #!/bin/sh if [ -z "${SEEDDMS_HOME}" ]; then - parentdir=$(dirname "$0") - export SEEDDMS_HOME=$(dirname "$parentdir") + parentdir=$(dirname "$0") + export SEEDDMS_HOME=$(dirname "$parentdir") fi # Prevent indexer jobs to run simultaneously by using a file lock ( if ! flock -n 3; then - echo "Previous indexer job is still running" + echo "Previous indexer job is still running" >&2 exit 1 fi + export LD_PRELOAD=/usr/lib/preloadable_libiconv.so php -f "${SEEDDMS_HOME}/utils/indexer.php" -- "${@}" ) 3>/srv/seeddms/indexer.lock