Hi,
I have a very strange problem. when I try to ping something I get the following error:
ping: error while loading shared libraries: libcap.so.2: cannot open shared object file: Permission denied
$ sudo strace ping google.com
openat(AT_FDCWD, "/usr/lib64/x86_64/libcap.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)stat("/usr/lib64/x86_64", 0x7ffe79552480) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib64/libcap.so.2", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
stat("/usr/lib64", {st_mode=S_IFDIR|0755, st_size=96592, ...}) = 0
writev(2, {iov_base="ping", iov_len=4}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libcap.so.2", iov_len=11}, {iov_base=": ", iov_len=2}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base=": ", iov_len=2}, {iov_base="Permission denied", iov_len=17}, {iov_base="
", iov_len=1}], 10ping: error while loading shared libraries: libcap.so.2: cannot open shared object file: Permission denied
) = 107
exit_group(127) = ?
byte 0/0 (END)+++ exited with 127 +++
The library is exist and readable:
sudo ls -l /usr/lib64/libcap.so*
lrwxrwxrwx 1 root root 11 Jul 21 17:34 /usr/lib64/libcap.so -> libcap.so.2
lrwxrwxrwx 1 root root 14 Jul 21 17:34 /usr/lib64/libcap.so.2 -> libcap.so.2.63
-rwxr-xr-x 1 root root 151552 Jul 21 17:34 /usr/lib64/libcap.so.2.63
The most strange thing is if I copy the ping binary file from /usr/bin it works!
sudo bash
cp /usr/bin/ping /root
/root/ping google.com
PING google.com (74.125.131.138) 56(84) bytes of data.
And if I write some simple application which use libcap.so library it works just fine. This means I have a problem with ping and only when binary ping file is placed in /usr/bin or /sbin directory.
When I set runlevel 1 (systemctl set-default rescue.target) and reboot ping is working. Runlevel 3 and 5 multi-user and graphical.target. Ping is not working.
This is first time a run with such a wierd problem. What program can hold ping?
My firewall is down
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Thank you in advance,
Eugene