How to change user library searching path


#1

Hi,
I am trying to setup web server on ubuntu core, and the authrization depend on PAM module, so my web server report library missing error during running.

How to change the library searching path?
For example, below log show that the library is missing, I can add it in my snap, but the problem is that my web server try to search the library from /lib64/security folder. Certainly, I can’t add my library in that path, how to fix this problem?

Sep 4 01:53:29 localhost web_server: PAM unable to dlopen(/lib64/security/pam_faildelay.so): /lib64/security/pam_faildelay.so: cannot open shared object file: No such file or directory
Sep 4 01:53:29 localhost web_server: PAM adding faulty module: /lib64/security/pam_faildelay.so
Sep 4 01:53:29 localhost web_server: PAM unable to dlopen(/lib64/security/pam_securetty.so): /lib64/security/pam_securetty.so: cannot open shared object file: No such file or directory
Sep 4 01:53:29 localhost web_server: PAM adding faulty module: /lib64/security/pam_securetty.so
Sep 4 01:53:29 localhost web_server: PAM unable to dlopen(/lib64/security/pam_nologin.so): /lib64/security/pam_nologin.so: cannot open shared object file: No such file or directory
Sep 4 01:53:29 localhost web_server: PAM adding faulty module: /lib64/security/pam_nologin.so
Sep 4 01:53:29 localhost web_server: PAM unable to dlopen(/lib64/security/pam_selinux.so): /lib64/security/pam_selinux.so: cannot open shared object file: No such file or directory
Sep 4 01:53:29 localhost web_server: PAM adding faulty module: /lib64/security/pam_selinux.so
Sep 4 01:53:29 localhost web_server: PAM unable to dlopen(/lib64/security/pam_env.so): /lib64/security/pam_env.so: cannot open shared object file: No such file or directory


#2

I already put these librarys in my snap and set environment

environment:
  LD_LIBRARY_PATH: $SNAP/usr/lib/security:$LD_LIBRARY_PATH

but the error log is the same, my web server still try to search library from system default path.


#3

closed it.

after checked, this question not relate with LD_LIBRARY_PATH, but relate with PAM function in ubuntu core.