Hi all,
new guy here, first post, with a question.
My background : some linux experience, moved over to OmniOS with Napp-it front end for a home NAS server, but getting more familiar with CLU.
Situation : I built APCUPSD to interface with my UPS. During the configure I specified the following flags:
./configure \
--prefix=/usr/local \
--sbindir=/usr/local/sbin \
--sysconfdir=/etc/apcupsd \
--mandir=/usr/local/share/man \
--with-log-dir=/var/log \
--disable-cgi \
--enable-usb
The make and install went fine, but on trying to load the daemon I get the following error.
#/etc/init.d/apcupsd start
Starting apcupsd power management ...ld.so.1: apcupsd: fatal: libusb.so.1: open failed: No such file or directory
/etc/init.d/apcupsd: line 24: 15893: Killed
Failed.
The file does exist, but I guess it isn't where it is supposed to be.
# find / -name libusb.so.1
find: �/proc/16084/fd/5': No such file or directory
find: �/proc/16084/path/5': No such file or directory
/usr/sfw/lib/libusb.so.1
I was able to solve this by exporting the path
# export LD_LIBRARY_PATH=/usr/sfw/lib/
Then the daemon worked.
However, whenever the machine reboots, the daemon will fail to load since I need to manually first re-export the path. I feel like manually remembering to do this every reboot is not the correct solution, and just a work-around.
First steps to solution
I'm trying to follow Sun's documentation on "4.3 Setting Library Search Paths and Order" [ I cannot post a direct link yet but google search should point to the doc if you are interested ]
However, I'm not really understanding the differences between dynamic and static linking.
QUESTION
My main question is "how do I solve the problem of LDD finding libusb.so.1 in /usr/sfw/lib/ when a reboot occurs so the APCUPSD daemon auto-starts".
A follow up for my own edification would be to explain dynamic vs static library linking. Do I need to re-compile APCUPSD with flags that point to libusb.so.1? Should I make a sym link pointing to libusb.so.1 in the directory that ldd normally searches?
Thanks in advance for all the help!