diff options
author | jim-p <jimp@pfsense.org> | 2012-06-23 13:25:03 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-06-23 13:25:03 -0400 |
commit | 4593069602bd09ae183f1052cc117e54066bfd0b (patch) | |
tree | 97dd184e4e5e6375a3834f5b244128e7e7e050b7 | |
parent | ea89b8dfd2f846121cc840db4ac1fff2ea408f84 (diff) | |
download | pfsense-4593069602bd09ae183f1052cc117e54066bfd0b.zip pfsense-4593069602bd09ae183f1052cc117e54066bfd0b.tar.gz |
Setup library paths to include /usr/pbi/*/lib as a last resort to make sure things can find libraries. We may eventually replace this with a better method as this can lead to conflicts, but for now it will allow packages to find their proper libraries.
-rw-r--r-- | etc/inc/pkg-utils.inc | 2 | ||||
-rw-r--r-- | etc/inc/util.inc | 9 | ||||
-rwxr-xr-x | etc/rc.start_packages | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index bb3e483..23e4fb5 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -550,7 +550,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = exec("/usr/local/sbin/pbi_add {$pkgstaging} -f -v --no-checksig {$fetchto} 2>&1", $pkgaddout); pkg_debug($pkgname . " " . print_r($pkgaddout, true) . "\npbi_add successfully completed.\n"); - + setup_library_paths(); exec("/usr/local/sbin/pbi_info " . preg_replace('/\.pbi$/','',$filename) . " | /usr/bin/awk '/Prefix/ {print $2}'",$pbidir); $pbidir = $pbidir[0]; $linkdirs = array('bin','sbin'); diff --git a/etc/inc/util.inc b/etc/inc/util.inc index 7737ad1..9d234a8 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -1815,4 +1815,13 @@ function array_exclude($needle, $haystack) { return $result; } +function setup_library_paths() { + $current_library_paths = explode(":", exec("/sbin/ldconfig -r | /usr/bin/grep 'search directories' | /usr/bin/awk '{print $3;}'")); + $pbi_library_paths = glob("/usr/pbi/*/lib"); + foreach ($pbi_library_paths as $pbilib) { + if (!in_array($pbilib, $current_library_paths)) + exec("/sbin/ldconfig -m {$pbilib}"); + } +} + ?> diff --git a/etc/rc.start_packages b/etc/rc.start_packages index 4b78718..80e7aaf 100755 --- a/etc/rc.start_packages +++ b/etc/rc.start_packages @@ -39,6 +39,7 @@ require_once("pfsense-utils.inc"); require_once("service-utils.inc"); log_error("Restarting/Starting all packages."); +setup_library_paths(); $rcfiles = glob("{$rcfileprefix}*.sh"); if (!$rcfiles) |