在我没有工作过的服务器上,ntpd 坏了:
# /etc/init.d/ntpd start
ntpd: error while loading shared libraries:
libz.so.1: cannot open shared object file: Permission denied
但权限看起来是正确的:
# locate libz.so.1 | xargs ls -l
lrwxrwxrwx root root /usr/lib64/libz.so.1 -> libz.so.1.2.3
-rwxr-xr-x root root /usr/lib64/libz.so.1.2.3
lrwxrwxrwx root root /usr/lib/libz.so.1 -> libz.so.1.2.3
-rwxr-xr-x root root /usr/lib/libz.so.1.2.3
-rw-r--r-- root root /usr/lib/vmware-tools/lib32/libz.so.1/libz.so.1
-rw-r--r-- root root /usr/lib/vmware-tools/lib64/libz.so.1/libz.so.1
-rw-r--r-- root root /usr/lib/vmware-tools/lib32/libz.so.1
-rw-r--r-- root root /usr/lib/vmware-tools/lib64/libz.so.1
LD_LIBRARY_PATH
为空且服务器是 64 位:
# uname -a
Linux my.server 2.6.18-128.el5 #1 SMP [...] x86_64 x86_64 x86_64 GNU/Linux
更新:
# ldd /usr/sbin/ntpd
libz.so.1 => /usr/lib64/libz.so.1
和
# ls -l /usr/lib64/libz.so.1
lrwxrwxrwx root root /usr/lib64/libz.so.1 -> libz.so.1.2.3
# ls -l /usr/lib64/libz.so.1.2.3
-rwxr-xr-x root root /usr/lib64/libz.so.1.2.3
答案1
我在我的一个应用程序中看到了类似的问题,这是由于 selinux 处于强制状态。更改:/etc/selinux/config 从 SELINUX=enforcing ## 或 permissive 更改为 SELINUX=disabled
这应该可以解决它。 http://sysadminupdates.com/blog/2015/05/11/so-cannot-open-shared-object-file-permission-denied/