Yes it is set in both the user's .profile and also in
/etc/profile. In both files it is set using:
LD_LIBRARY_PATH=/usr/sfw/lib:/usr/postgres/9.6-pgdg/lib
export LD_LIBRARY_PATH
That said, if I execute the following
su password
su postgres
echo $LD_LIBRARY_PATH
then echo returns blank. Echo will return the correct
value only in the usr login. The question then is if postgres
is running as usr postgres how does it know the value of
LD_LIBRARY_PATH. Isn't there another place where it must be
set?
environment variables, including LD_LIBRARY_PATH gets dropped by
su, which is used to launch the postgres service.
but generally, using LD_LIBRARY_PATH is frowned on, instead, you
should link the applications with -R, or -Wl,-rpath and give it
the path of the libraries, so thats baked into the binary.
--
john r pierce, recycling bits in santa cruz