Bacula-users

Re: [Bacula-users] Bacula 7.0.4 director: Symbol not found _mysql_init on OSX 10.9 with MySQL 5.5.38

2014-06-26 08:41:27
Subject: Re: [Bacula-users] Bacula 7.0.4 director: Symbol not found _mysql_init on OSX 10.9 with MySQL 5.5.38
From: Robert Oschwald <robertoschwald AT googlemail DOT com>
To: Kern Sibbald <kern AT sibbald DOT com>
Date: Thu, 26 Jun 2014 14:35:55 +0200
Hi Kern,

it’s on the same machine as the binaries were compiled.

Found the reason for the problem. 
Problem seem to be the configure script.
MYSQL_INCLUDE and MYSQL_LIBS in src/cats/Makefile is set empty.
This causes the libbaccats-7.0.4.so library to be linked without the mysql 
library.
When adding the correct values:

MYSQL_INCLUDE = -I/opt/local/include/mysql55/mysql
MYSQL_LIBS = -R /opt/local/lib/mysql55/mysql -L/opt/local/lib/mysql55/mysql 
-lmysqlclient_r -lz

the libbaccats library gets linked correctly and bacula-dir works.
Will investigate why the configure script ignores MYSQL_LIBS, later.


Here is the otool output (OSX equivalent to ldd) of the defect director build:

# otool -L bacula-dir 
        
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 
(compatibility version 150.0.0, current version 855.16.0)
        /opt/local/lib/libbacfind-7.0.4.dylib (compatibility version 0.0.0, 
current version 0.0.0)
        /opt/local/lib/libbacsql-7.0.4.dylib (compatibility version 0.0.0, 
current version 0.0.0)
        /opt/local/lib/libbaccats-7.0.4.dylib (compatibility version 0.0.0, 
current version 0.0.0)
        /opt/local/lib/libbaccfg-7.0.4.dylib (compatibility version 0.0.0, 
current version 0.0.0)
        /opt/local/lib/libbac-7.0.4.dylib (compatibility version 0.0.0, current 
version 0.0.0)
        /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current 
version 1.2.8)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1197.1.1)
        /opt/local/lib/libwrap.7.dylib (compatibility version 7.0.0, current 
version 7.6.0)
        /opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current 
version 10.2.0)
        /opt/local/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current 
version 1.0.0)
        /opt/local/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, 
current version 1.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 
120.0.0)


and:

# ldd /opt/local/lib/libbaccats-7.0.4.dylib
        /opt/local/lib/libbaccats-mysql-7.0.4.dylib (compatibility version 
0.0.0, current version 0.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 
120.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1197.1.1)

(here the mysql library is missing).


Corrected Makefile built library holds:
# ldd /opt/local/lib/libbaccats-7.0.4.dylib 
/opt/local/lib/libbaccats-7.0.4.dylib:
        /opt/local/lib/libbaccats-mysql-7.0.4.dylib (compatibility version 
0.0.0, current version 0.0.0)
        /opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib (compatibility 
version 18.0.0, current version 18.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 
1.2.5)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 
120.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 1197.1.1)




Rob

Am 26.06.2014 um 11:45 schrieb Kern Sibbald <kern AT sibbald DOT com>:

> Hello,
> 
> I suspect that you had the MySQL development libraries loaded when you built 
> Bacula, but on the machine where you are trying to run Bacula, you do not 
> have the MySQL interface libraries loaded.  I am not sure what they are 
> called on Mac, but they provide the shared object client libraries that allow 
> Bacula to connect to the MySQL DB, which may be on the same system or 
> somewhere on the network.  These libraries are supplied by whoever supplies 
> MySQL.
> 
> On Linux systems, you can enter:
> 
>   ldd bacula-dir
> 
> and you will get a list of all the shared libraries that it needs, and one of 
> them is probably missing.
> On my system, (a slightly different Bacula version), it looks like:
> 
>     ...
>     libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa122ad9000)
>     libmysqlclient.so.18 => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 
> (0x00007fa122591000)
>     ...
> 
> On your system, I suspect that the equivalent of libmysqlclient.so.18 is 
> missing.
> 
> Best regards,
> Kern
> 
> On 06/26/2014 10:01 AM, Robert Oschwald wrote:
>> Currently working on the macports variants of Bacula 7.0.4.
>> FD, Bat and PostgreSQL8.4 server versions work flawlessly.
>> 
>> Building the MySQL variant with MySQL 5.5.38 compile ok, but when running 
>> the director, I get:
>> 
>> # bacula-dir -v -f
>> dyld: lazy symbol binding failed: Symbol not found: _mysql_init
>>   Referenced from: /opt/local/lib/libbaccats-7.0.4.dylib
>>   Expected in: flat namespace
>> 
>> dyld: Symbol not found: _mysql_init
>>   Referenced from: /opt/local/lib/libbaccats-7.0.4.dylib
>>   Expected in: flat namespace
>> 
>> Bacula interrupted by signal 5: Trace/Breakpoint trap
>> Kaboom! bacula-dir, bacula-dir got signal 5 - Trace/Breakpoint trap at 
>> 26-Jun-2014 00:36:44. Attempting traceback.
>> Kaboom! exepath=/opt/local/sbin
>> Calling: /opt/local/sbin/btraceback /opt/local/sbin/bacula-dir 58689 
>> /opt/local/var/bacula/working
>> 
>> All libs and bacula-dir are 64bit.
>> 
>> Any hints?
>> 
>> 
>> Rob
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Open source business process management suite built on Java and Eclipse
>> Turn processes into business applications with Bonita BPM Community Edition
>> Quickly connect people, data, and systems into organized workflows
>> Winner of BOSSIE, CODIE, OW2 and Gartner awards
>> 
>> http://p.sf.net/sfu/Bonitasoft
>> 
>> 
>> _______________________________________________
>> Bacula-users mailing list
>> 
>> Bacula-users AT lists.sourceforge DOT net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
> 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users