Bacula-users

Re: [Bacula-users] bacula-dir run failure on Ubuntu 12.04.02

2013-08-02 16:50:48
Subject: Re: [Bacula-users] bacula-dir run failure on Ubuntu 12.04.02
From: uhog-v9e4 AT spamex DOT com
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 02 Aug 2013 16:46:26 -0400
Hi folks,

For what it's worth, I tried compiling Bacula 5.0.3 on Ubuntu 12.0.4 today. I 
currently have Bacula 5.0.3 running on Ubuntu 10.0.4 on another server. The 
compilation failed on 12.0.4 for the director though the SD and FD both 
compiled. I played around a bit but then decided just for kicks to reinstall 
this new machine back to 10.0.4 and try that. After that, I did an update, and 
then loaded the build-essential, libncurses5-dev, and libmysqlclient-dev 
packages. I then built 5.2.13 and it builds and runs with no problem. So 
whatever is going on must be related to something happening with Ubuntu 
packaging at 12.0.4 that causes Bacula to not link in everything it needs.

Since my primary goal is to get moved to different hardware, I'm just going to 
continue running on 10.0.4 on the new hardware with the 5.2.13 Bacula since 
10.0.4 is supported until midway through 2015. After I get everything migrated 
and stabilized, maybe I'll play with debugging this 12.0.4 problem again in a 
virtual machine or something in my spare time.

Thanks again for the ideas, I learned a bit more about digging around in the 
symbols on linux so it was worth that anyway. If I do get back to it and find a 
solid answer, I'll update the list.

Mike

On 8/1/2013 10:21 PM, uhog-v9e4 AT spamex DOT com wrote:
> 
> 
> 
> On 8/1/2013 10:12 AM, Martin Simmons wrote:
>>>>>>> On Wed, 31 Jul 2013 13:52:10 -0400, uhog-v9e4  said:
>>>
>>> On 7/31/2013 10:33 AM, Martin Simmons wrote:
>>>>
>>>>>>>>> On Tue, 30 Jul 2013 11:55:43 -0400, uhog-v9e4  said:
>>>>>
>>>>> Hi folks,
>>>>>
>>>>> I'm trying to build and run Bacula 5.2.13 on Ubuntu server 12.04.02. I 
>>>>> have downloaded source and bacula builds with no problem but the director 
>>>>> fails to start with the following error:
>>>>>
>>>>> node1:~# /opt/bacula/bin/bacula-dir -f
>>>>> /opt/bacula/bin/bacula-dir: symbol lookup error: 
>>>>> /opt/bacula/lib/libbaccats-5.2.13.so: undefined symbol: mysql_thread_safe
>>>>> node1:~# dpkg --list |grep libmysqlclient
>>>>> ii  libmysqlclient-dev                     5.5.32-0ubuntu0.12.04.1        
>>>>>          MySQL database development files
>>>>> ii  libmysqlclient18                       5.5.32-0ubuntu0.12.04.1        
>>>>>          MySQL database client library
>>>>> node1:~#
>>>>
>>>> What is the output of
>>>>
>>>> ldd /opt/bacula/lib/libbaccats-5.2.13.so
>>>>
>>>> It might be an Ubuntu packaging bug like this one:
>>>>
>>>> https://bugs.launchpad.net/ubuntu/+source/bacula/+bug/949508
>>>>
>>>> __Martin
>>>
>>> Hi Martin,
>>>
>>> Thanks. I believe this is the problem, but I'm not sure how to fix it.
>>
>> Is the machine fully updated?
>>
> Yes, the machine was installed via the Ubuntu server CD with LAMPs, then I 
> added build-essential, libmysqlclient-dev, and xubuntu-desktop just to get a 
> basic gui. Then apt-update and apt-get dist-upgrade to get it all current. 
> Then I downloaded the bacula 5.2.13 tar ball and did the configure and build.
> 
>>
>>> node1:~# ldd /opt/bacula/lib/libbaccats-5.2.13.so
>>>           linux-gate.so.1 =>  (0xb7772000)
>>>           libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 
>>> (0xb7675000)
>>>           libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb74cc000)
>>>           libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb749f000)
>>>           /lib/ld-linux.so.2 (0xb7773000)
>>>           libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7481000)
>>> node1:~#
>>>
>>> So there is no mysql library here. I found the mysql_thread_safe symbol 
>>> defined in /usr/lib/i386-linux-gnu/libmysqlclient_r.a on my system but the 
>>> libmysqlclient.so file is stripped.
>>>
>>> node1:~# find /usr -name libmysqlclient.so*|xargs ls -l
>>> lrwxrwxrwx 1 root root      20 Jul 24 01:32 
>>> /usr/lib/i386-linux-gnu/libmysqlclient.so -> libmysqlclient.so.18
>>> lrwxrwxrwx 1 root root      24 Jul 24 01:32 
>>> /usr/lib/i386-linux-gnu/libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
>>> -rw-r--r-- 1 root root 3237128 Jul 24 01:32 
>>> /usr/lib/i386-linux-gnu/libmysqlclient.so.18.0.0
>>> node1:~# nm /usr/lib/i386-linux-gnu/libmysqlclient.so.18.0.0
>>> nm: /usr/lib/i386-linux-gnu/libmysqlclient.so.18.0.0: no symbols
>>> node1:~# file /usr/lib/i386-linux-gnu/libmysqlclient.so.18.0.0
>>> /usr/lib/i386-linux-gnu/libmysqlclient.so.18.0.0: ELF 32-bit LSB shared 
>>> object, Intel 80386, version 1 (SYSV), dynamically linked, 
>>> BuildID[sha1]=0x23cf2ee7f1d6d66c6095cedf7fb067708cc9c5eb, stripped
>>
>> Stripped is normal -- try objdump -T to see the dynamic symbols.
>>
> 
> Looks good.
> 
> node1:~# objdump -T /usr/lib/i386-linux-gnu/libmysqlclient.so.18.0.0|grep 
> thread_safe 0001c990 g    DF .text  0000000a  Base        mysql_thread_safe
> node1:~#
> 
>>
>>>
>>> And I can see this in the bacula config.log
>>> ---
>>> configure:24471: checking for mysql_thread_safe in -lmysqlclient_r
>>> configure:24496: gcc -o conftest -g -O2 -Wall   -L/usr/lib conftest.c 
>>> -lmysqlclient_r  -ldl -ldl  -lz >&5
>>> configure:24496: $? = 0
>>> configure:24505: result: yes
>>> ---
>>>
>>> So I'm not sure what's going on here, but it looks like progress. Also, if 
>>> it makes any difference, this is the 32-bit flavor of Ubuntu running on 
>>> 32-bit hardware.
>>
>> Check the command line used to link libbaccats-5.2.13.so (run make with
>> NO_ECHO='' to see it).  Does it mention -lmysqlclient_r?
>>
> It appears it does not. Output captured using make NO_ECHO=''
> 
> Making libbaccats.la ...
> /home/mrc/bacula-build/bacula-5.2.13/libtool --silent --tag=CXX --mode=link 
> /usr/bin/g++ -D_BDB_PRIV_INTERFACE_   -o libbaccats.la cats_dummy.lo 
> -export-dynamic -rpath /opt/bacula/lib -release 5.2.13
> Compiling mysql.c
> /home/mrc/bacula-build/bacula-5.2.13/libtool --silent --tag=CXX 
> --mode=compile /usr/bin/g++ -D_BDB_PRIV_INTERFACE_  -c  -fno-strict-aliasing 
> -fno-exceptions -fno-rtti  -I. -I.. -I/usr/include/mysql  -g -O2 -Wall 
> -fno-strict-aliasing -fno-exceptions -fno-rtti  mysql.c
> Making libbaccats-mysql.la ...
> /home/mrc/bacula-build/bacula-5.2.13/libtool --silent --tag=CXX --mode=link 
> /usr/bin/g++ -D_BDB_PRIV_INTERFACE_   -o libbaccats-mysql.la mysql.lo 
> -export-dynamic -rpath /opt/bacula/lib -release 5.2.13 \
>                                                             -soname 
> libbaccats-5.2.13.so
> ==== Make of sqllibs is good ====
> 
> node1:~# grep mysqlclient /home/mrc/bacula-build/bacula-5.2.13/mrc.make.output
> node1:~#
> 
> Thanks again for all the help here.
> 
> Mike
> 
>> __Martin
>>


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users