LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Dynamic Libraries - Asterisk - CentOS5 (https://www.linuxquestions.org/questions/linux-server-73/dynamic-libraries-asterisk-centos5-627497/)

lord-fu 03-12-2008 08:21 AM

Dynamic Libraries - Asterisk - CentOS5
 
Hello all and mtia.

I decided to test out a few new items within Asterisk 1.4.18 (Swift,Flite). So I set up a test box, pretty much a vanilla CentOS 5.1(a few various updates). Asterisk also is pretty much vanilla except tha addons package.

After installing Swift and Flite I needed to update /etc/ld.so.conf, I did

Code:

$ cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
include /usr/local/lib
include /opt/swift/lib

I ran ldconfig. I try and load the module within Asterisk and it says cannot find items.

Code:

CLI>]load app_swift.so
[Mar 12 09:16:45] WARNING[10297]: loader.c:363 load_dynamic_module: Error loading module 'app_swift.so': libswift.so.4: cannot open shared object file: No such file or directory
[Mar 12 09:16:45] WARNING[10297]: loader.c:649 load_resource: Module 'app_swift.so' could not be loaded.

Code:

ls -Al /usr/lib/asterisk/modules/app_swift.so
-rwxr-xr-x 1 root root 34721 Mar 11 22:08 /usr/lib/asterisk/modules/app_swift.so

Code:

ls -Al /usr/local/lib/
total 13436
lrwxrwxrwx 1 root root      20 Mar 11 14:17 libflite_cmulex.so -> libflite_cmulex.so.1
lrwxrwxrwx 1 root root      22 Mar 11 14:17 libflite_cmulex.so.1 -> libflite_cmulex.so.1.3
-rwxr-xr-x 1 root root  610941 Mar 11 14:15 libflite_cmulex.so.1.3
lrwxrwxrwx 1 root root      26 Mar 11 14:17 libflite_cmu_time_awb.so -> libflite_cmu_time_awb.so.1
lrwxrwxrwx 1 root root      28 Mar 11 14:17 libflite_cmu_time_awb.so.1 -> libflite_cmu_time_awb.so.1.3
-rwxr-xr-x 1 root root 6800530 Mar 11 14:15 libflite_cmu_time_awb.so.1.3
lrwxrwxrwx 1 root root      26 Mar 11 14:17 libflite_cmu_us_kal16.so -> libflite_cmu_us_kal16.so.1
lrwxrwxrwx 1 root root      28 Mar 11 14:17 libflite_cmu_us_kal16.so.1 -> libflite_cmu_us_kal16.so.1.3
-rwxr-xr-x 1 root root 3714816 Mar 11 14:15 libflite_cmu_us_kal16.so.1.3
lrwxrwxrwx 1 root root      24 Mar 11 14:17 libflite_cmu_us_kal.so -> libflite_cmu_us_kal.so.1
lrwxrwxrwx 1 root root      26 Mar 11 14:17 libflite_cmu_us_kal.so.1 -> libflite_cmu_us_kal.so.1.3
-rwxr-xr-x 1 root root 1987454 Mar 11 14:15 libflite_cmu_us_kal.so.1.3
lrwxrwxrwx 1 root root      13 Mar 11 14:17 libflite.so -> libflite.so.1
lrwxrwxrwx 1 root root      15 Mar 11 14:17 libflite.so.1 -> libflite.so.1.3
-rwxr-xr-x 1 root root  390081 Mar 11 14:15 libflite.so.1.3
lrwxrwxrwx 1 root root      23 Mar 11 14:17 libflite_usenglish.so -> libflite_usenglish.so.1
lrwxrwxrwx 1 root root      25 Mar 11 14:17 libflite_usenglish.so.1 -> libflite_usenglish.so.1.3
-rwxr-xr-x 1 root root  206932 Mar 11 14:15 libflite_usenglish.so.1.3

The Asterisk process is running as root.

Code:

ps aux | grep asterisk
root    10253  0.0  0.0  4496  536 pts/0    S    09:16  0:00 /bin/bash /usr/sbin/safe_asterisk
root    10259  0.2  0.4  24636  8164 pts/0    Sl  09:16  0:00 /usr/sbin/asterisk -f -vvvg -c

Not sure if below is cool or not as Asterisk may provide some of this itself.
Code:

ldd /usr/lib/asterisk/modules/app_swift.so
        linux-gate.so.1 =>  (0x001bc000)
        libswift.so.4 => not found
        libm.so.6 => /lib/libm.so.6 (0x005cd000)
        libceplang_en.so.4 => not found
        libceplex_us.so.4 => not found
        libc.so.6 => /lib/libc.so.6 (0x001bd000)
        /lib/ld-linux.so.2 (0x009db000)


So I guess my question is, how can I get Asterisk to properly find my libraries? Kinda stumped here.

mtia and will gladly provide more info if asked.

unSpawn 03-12-2008 08:33 AM

Did you restart Asterisk after running ldconfig? What does 'ldconfig -p | grep libswift' return? And 'ldd /usr/sbin/asterisk | grep libswift'? Does running ldd on app_swift.so with exported "LD_LIBRARY_PATH=/opt/swift/lib" work (if that's where I think libswift.so.4 resides)?

lord-fu 03-12-2008 06:44 PM

Thanks for the reply unSpawn.

Quote:

Did you restart Asterisk after running ldconfig?
Yes and a few full reboots.

Quote:

What does 'ldconfig -p | grep libswift' return? And 'ldd /usr/sbin/asterisk | grep libswift'?
Nothing.

Quote:

Does running ldd on app_swift.so with exported "LD_LIBRARY_PATH=/opt/swift/lib" work (if that's where I think libswift.so.4 resides)?
Yes.

Code:

[root@testrig ~]#  ldd /usr/lib/asterisk/modules/app_swift.so
        linux-gate.so.1 =>  (0x00c9a000)
        libswift.so.4 => /opt/swift/lib/libswift.so.4 (0x00729000)
        libm.so.6 => /lib/libm.so.6 (0x001b1000)
        libceplang_en.so.4 => /opt/swift/lib/libceplang_en.so.4 (0x00c20000)
        libceplex_us.so.4 => /opt/swift/lib/libceplex_us.so.4 (0x003f6000)
        libc.so.6 => /lib/libc.so.6 (0x00a6d000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00977000)
        libdl.so.2 => /lib/libdl.so.2 (0x00c11000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00110000)
        librt.so.1 => /lib/librt.so.1 (0x00f4a000)
        /lib/ld-linux.so.2 (0x009db000)

Still even after rebooting asterisk and in same session as export;

Code:

CLI> module load app_swift.so
[Mar 12 19:42:04] WARNING[3557]: loader.c:363 load_dynamic_module: Error loading module 'app_swift.so': libswift.so.4: cannot open shared object file: No such file or directory
[Mar 12 19:42:04] WARNING[3557]: loader.c:649 load_resource: Module 'app_swift.so' could not be loaded.

Anymore ideas, to me ldd command on asterisk above implies it does not need the app_swift library's or doesnt know it needs to..am I reading that correctly?

mtia

unSpawn 03-13-2008 03:55 PM

Quote:

Originally Posted by lord-fu (Post 3086797)
Still even after rebooting asterisk and in same session as export;

Code:

CLI> module load app_swift.so
[Mar 12 19:42:04] WARNING[3557]: loader.c:363 load_dynamic_module: Error loading module 'app_swift.so': libswift.so.4: cannot open shared object file: No such file or directory
[Mar 12 19:42:04] WARNING[3557]: loader.c:649 load_resource: Module 'app_swift.so' could not be loaded.

Anymore ideas, to me ldd command on asterisk above implies it does not need the app_swift library's or doesnt know it needs to..am I reading that correctly?

I'd say it's more a case of it not knowing where to look, but 'ldconfig -p' or the "export" should have pointed it the right way. It appears Asterisk isn't provided as RPM but as tarballs (at least the HOWTO I read), are you sure the modules are for the corresponding version of Asterisk? Where there any compile-time options that could have screwed up this? No AVC messages in /var/log/messages or /var/log/audit/audit.log by any chance? If you start Asterisk with maximum verbosity and try again, does it show more clues?

lord-fu 03-17-2008 07:28 AM

Hello unSpawn and thanks. Sorry for the late reply but I have had strep throat for the last few days :[

Yes it was a source build but I only did the standard compile mantra no extra arguments thrown to the compiler.
./configure && make && make install

The swift package says it is asterisk 1.4 compatable, if you feel so inclined the description is below in the link.
http://www.loopfree.net/app_swift/

I have tried a few other source compiles of different packages while trying to get TTS(Text to Speech) software used within asterisk. The packages compile fine but as you noticed getting asterisk to see them is a different story I guess. Which is odd as on other production machines (Fedora 6) I have not had this problem, although I have not tried these specific packages but items like RX and TXfax.

I have not seen anything in the logs(could be me, will look closer).

Yeh I have tried up to 7 verbosity level always the same thing.

Thanks again.


All times are GMT -5. The time now is 07:39 PM.