From 64ae5c752960f247aa7e1c781f05d2152d54e1e4 Mon Sep 17 00:00:00 2001 From: KoT_B_KocMoce <49576827+hodlonaut@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:31:22 +1100 Subject: [PATCH] Initialize LD_LIBRARY_PATH earlier Move initialization of LD_LIBRARY_PATH to before node/cli version checks to address the issue of 'error while loading shared libraries: libsecp256k1.so.0: cannot open shared object file: No such file or directory' appearing in service logs on startup/shutdown. --- scripts/cnode-helper-scripts/env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/cnode-helper-scripts/env b/scripts/cnode-helper-scripts/env index f7ff27994..59920ef0b 100644 --- a/scripts/cnode-helper-scripts/env +++ b/scripts/cnode-helper-scripts/env @@ -911,6 +911,8 @@ if [[ -z "${CNCLI}" ]]; then CNCLI=$(command -v cncli) || CNCLI="${HOME}/.local/bin/cncli" fi +[[ -f /usr/local/lib/libsodium.so ]] && export LD_LIBRARY_PATH=/usr/local/lib:"${LD_LIBRARY_PATH}" && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:"${PKG_CONFIG_PATH}" + node_version="$(${CNODEBIN} version | head -1 | cut -d' ' -f2)" cli_version="$(${CCLI} version | head -1 | cut -d' ' -f2)" if ! versionCheck "8.7.3" "${node_version}" || ! versionCheck "8.17.0.0" "${cli_version}"; then @@ -918,8 +920,6 @@ if ! versionCheck "8.7.3" "${node_version}" || ! versionCheck "8.17.0.0" "${cli_ return 1 fi -[[ -f /usr/local/lib/libsodium.so ]] && export LD_LIBRARY_PATH=/usr/local/lib:"${LD_LIBRARY_PATH}" && PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:"${PKG_CONFIG_PATH}" - if [[ -z "${SOCKET}" ]]; then if [[ "$(ps -ef | grep "$(basename ${CNODEBIN}).*.port ${CNODE_PORT}" | grep -v grep)" =~ --socket-path[[:space:]]([^[:space:]]+) ]]; then export CARDANO_NODE_SOCKET_PATH="${BASH_REMATCH[1]}"