Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/start/envlinux.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Execute ./bin/installdependencies.sh to install any missing Dotnet Core 6.0 depe
You can easily correct the problem by executing `./bin/installdependencies.sh`.
The `installdependencies.sh` script should install all required dependencies on all supported Linux versions
> Note: The `installdependencies.sh` script will try to use the default package management mechanism on your Linux flavor (ex. `yum`/`apt-get`/`apt`).
> For Fedora-based systems, the script automatically handles lttng-ust version compatibility by creating symlinks when needed (e.g., Fedora 41 ships with liblttng-ust.so.1 but the runner needs liblttng-ust.so.0).

### Full dependencies list

Expand All @@ -33,7 +34,7 @@ Debian based OS (Debian, Ubuntu, Linux Mint)

Fedora based OS (Fedora, Red Hat Enterprise Linux, CentOS, Oracle Linux 7)

- lttng-ust
- lttng-ust (the installdependencies.sh script will automatically handle version compatibility for newer Fedora versions)
- openssl-libs
- krb5-libs
- zlib
Expand Down
53 changes: 52 additions & 1 deletion src/Misc/layoutbin/installdependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,63 @@ then
command -v dnf
if [ $? -eq 0 ]
then
dnf install -y lttng-ust openssl-libs krb5-libs zlib libicu
# Install basic dependencies first
dnf install -y openssl-libs krb5-libs zlib libicu
if [ $? -ne 0 ]
then
echo "'dnf' failed with exit code '$?'"
print_errormessage
exit 1
fi

# Handle lttng-ust with fallback logic for version compatibility
dnf_with_lttng_fallbacks() {
# Try to install the current lttng-ust package
dnf install -y lttng-ust
if [ $? -eq 0 ]
then
# Check if it provides the required liblttng-ust.so.0
if ldconfig -p | grep -q "liblttng-ust.so.0"
then
echo "Found liblttng-ust.so.0"
return 0
else
echo "Warning: lttng-ust installed but liblttng-ust.so.0 not found"
echo "Attempting to create compatibility symlink..."

# Find the actual liblttng-ust library
lttng_lib=$(ldconfig -p | grep "liblttng-ust.so" | head -1 | awk '{print $NF}')
if [ -n "$lttng_lib" ] && [ -f "$lttng_lib" ]
then
# Create symlink in the same directory
lib_dir=$(dirname "$lttng_lib")
if [ -w "$lib_dir" ]
then
ln -sf "$(basename "$lttng_lib")" "$lib_dir/liblttng-ust.so.0"
echo "Created compatibility symlink: $lib_dir/liblttng-ust.so.0 -> $(basename "$lttng_lib")"
ldconfig
return 0
else
echo "Cannot create symlink in $lib_dir (permission denied)"
return 1
fi
else
echo "Could not find lttng-ust library file"
return 1
fi
fi
else
echo "Failed to install lttng-ust package"
return 1
fi
}

dnf_with_lttng_fallbacks
if [ $? -ne 0 ]
then
echo "Failed to install lttng-ust with compatibility"
print_errormessage
exit 1
fi
else
echo "Can not find 'dnf'"
Expand Down
Loading