-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
... to speed up malloc(3) and thereby also the config loading. refs #8110
- Loading branch information
Showing
1 changed file
with
27 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,39 @@ | ||
#!/bin/sh | ||
ICINGA2_BIN=@CMAKE_INSTALL_FULL_LIBDIR@/icinga2/sbin/icinga2 | ||
|
||
if test "x`uname -s`" = "xLinux" -a "x$1" = "xconsole"; then | ||
libedit_line=`ldd $ICINGA2_BIN 2>&1 | grep libedit` | ||
if test $? -eq 0; then | ||
libedit_path=`echo $libedit_line | cut -f3 -d' '` | ||
if test -n "$libedit_path"; then | ||
libdir=`dirname -- $libedit_path` | ||
found=0 | ||
for libreadline_path in `ls -1r -- $libdir/libreadline.so.* 2>/dev/null`; do | ||
found=1 | ||
break | ||
done | ||
if test $found -eq 0; then | ||
libdir2=/`echo $libdir | cut -f3- -d/` | ||
for libreadline_path in `ls -1r -- $libdir2/libreadline.so.* 2>/dev/null`; do | ||
if test "x`uname -s`" = "xLinux"; then | ||
if test "x$1" = "xconsole"; then | ||
libedit_line=`ldd $ICINGA2_BIN 2>&1 | grep libedit` | ||
if test $? -eq 0; then | ||
libedit_path=`echo $libedit_line | cut -f3 -d' '` | ||
if test -n "$libedit_path"; then | ||
libdir=`dirname -- $libedit_path` | ||
found=0 | ||
for libreadline_path in `ls -1r -- $libdir/libreadline.so.* 2>/dev/null`; do | ||
found=1 | ||
break | ||
done | ||
fi | ||
if test $found -gt 0; then | ||
export LD_PRELOAD="$libreadline_path:$LD_PRELOAD" | ||
if test $found -eq 0; then | ||
libdir2=/`echo $libdir | cut -f3- -d/` | ||
for libreadline_path in `ls -1r -- $libdir2/libreadline.so.* 2>/dev/null`; do | ||
found=1 | ||
break | ||
done | ||
fi | ||
if test $found -gt 0; then | ||
LD_PRELOAD="$libreadline_path:$LD_PRELOAD" | ||
fi | ||
fi | ||
fi | ||
fi | ||
|
||
for lib in /usr/lib{,64,/{{i386,x86_64}-linux-gnu,arm-linux-gnueabihf}}/libjemalloc.so.{1,2}; do | ||
if test -e "$lib"; then | ||
LD_PRELOAD="${lib}:$LD_PRELOAD" | ||
fi | ||
done | ||
|
||
export LD_PRELOAD | ||
fi | ||
|
||
exec $ICINGA2_BIN "$@" |