ntp cannot open shared object file: Permission denied

5,468

I have seen similar issue with one of my application and it was due to selinux in enforcing state. Change : /etc/selinux/config from SELINUX=enforcing ## or permissive to SELINUX=disabled

This should fix it. http://sysadminupdates.com/blog/2015/05/11/so-cannot-open-shared-object-file-permission-denied/

Share:
5,468

Related videos on Youtube

Philippe Blayo
Author by

Philippe Blayo

One of the best experience in my life has been to enjoy pair programming with developers that value clean code and simple design. It's called eXtreme Programming and I hope one day I'll have the opportunity to do it again.

Updated on September 18, 2022

Comments

  • Philippe Blayo
    Philippe Blayo over 1 year

    On a server I haven't worked on, ntpd is broken:

    # /etc/init.d/ntpd start
    ntpd: error while loading shared libraries:
      libz.so.1: cannot open shared object file: Permission denied
    

    but permissions look right:

    # 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 is empty and the server is 64 bit:

    # uname -a
    Linux my.server 2.6.18-128.el5 #1 SMP [...] x86_64 x86_64 x86_64 GNU/Linux
    

    Update:

    # ldd /usr/sbin/ntpd
    libz.so.1 => /usr/lib64/libz.so.1
    

    and

    # 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
    
    • derobert
      derobert over 11 years
      What does ldd /usr/sbin/ntpd give? Also, are you running SELinux or similar?
    • Philippe Blayo
      Philippe Blayo over 11 years
      @derobert: I don't think it's a SELinux, but how to be sure? ldd looks right, I've updated the question.
    • Gilles 'SO- stop being evil'
      Gilles 'SO- stop being evil' over 11 years
      Weird. What distribution is this exactly (some kind of RHEL5, but official or CentOS or other, and what version)? Please post the output of strace /usr/sbin/ntpd. If that doesn't fail, post the output of bash -x /etc/init.d/ntpd start.