From cfffec94483eb45608a478a3e8ba1165ba35d865 Mon Sep 17 00:00:00 2001 From: Bartosz Zbytniewski <50180524+devzbysiu@users.noreply.github.com> Date: Mon, 30 Sep 2024 08:22:22 +0200 Subject: [PATCH] Add verbose flag to ldconfig (#635) --- contrib/scriptlets/deb/postinst | 7 ++++++- contrib/scriptlets/deb/postrm | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/contrib/scriptlets/deb/postinst b/contrib/scriptlets/deb/postinst index ba7acf162..719d93d44 100755 --- a/contrib/scriptlets/deb/postinst +++ b/contrib/scriptlets/deb/postinst @@ -26,7 +26,12 @@ helpMessage="If you need help using the app, use the command 'nordvpn --help'." # update configuration and shared library cache for linker to find .so files echo "/usr/lib/nordvpn" > /etc/ld.so.conf.d/nordvpn.conf -ldconfig +# NOTE: We found some really strange behavior with `ldconfig` cache refresh here. +# On .deb systems, using just `ldconfig` causes the nordvpnd daemon to fail on +# the first start with error that .so are missing. On restart, it's working again. +# Adding ANY flag to `ldconfig` (even the one we added on our own which does +# literally nothing) fixes the issue. +ldconfig -v > /dev/null 2>&1 mkdir -m 0750 -p "$LOG_DIR" chown root:$NORDVPN_GROUP "$LOG_DIR" diff --git a/contrib/scriptlets/deb/postrm b/contrib/scriptlets/deb/postrm index bf2f8effe..5f62ff66f 100755 --- a/contrib/scriptlets/deb/postrm +++ b/contrib/scriptlets/deb/postrm @@ -22,7 +22,13 @@ case "$1" in rm -rf /var/{lib,log}/nordvpn rm -rf /run/nordvpn rm -rf /etc/ld.so.conf.d/nordvpn.conf - ldconfig + + # NOTE: We found some really strange behavior with `ldconfig` cache refresh here. + # On .deb systems, using just `ldconfig` causes the nordvpnd daemon to fail on + # the first start with error that .so are missing. On restart, it's working again. + # Adding ANY flag to `ldconfig` (even the one we added on our own which does + # literally nothing) fixes the issue. + ldconfig -v > /dev/null 2>&1 ;; disappear|upgrade|failed-upgrade|abort-install|abort-upgrade) ;;