在 Debian 上设置文件功能后如何设置本地共享库路径?

在 Debian 上设置文件功能后如何设置本地共享库路径?

我有一个自定义应用程序,它有自己的libstdc++.so.6它需要cap_net_admincap_net_raw才能正常工作。
在我设置文件功能之前,它启动时没有问题,但是当我设置时:

/sbin/setcap cap_net_admin,cap_net_raw+pie /path/to/customapp

它给出以下错误:

./customapp: /usr/lib/i386-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by ./customapp)

当我这样做时,readelf -d它表明它正在正确的位置寻找库:

0x0000000f (RPATH)                      Library rpath: [$ORIGIN/lib]

ldd ./customapp显示相同的:

libstdc++.so.6 => /path/to/./lib/libstdc++.so.6 (0xb75ed000)

我遵循了给出的建议这里并将新的共享库路径添加到ld.so(1)

echo "/path/to/lib" > /etc/ld.so.conf.d/customapp.conf && ldconfig


我在 Ubuntu 14.04 上尝试过,它运行良好,那么为什么它不能在 Debian 上运行呢?

操作系统:Debian GNU/Linux 7.6(喘息)
uname -a:Linux debsrv 3.2.0-4-686-pae #1 SMP Debian 3.2.60-1+deb7u3 i686 GNU/Linux

相关内容