bacula安装和启动失败

1 bacula安装失败
Compiling sql_update.c
Making libbacsql.la ...
/home/liangfuming/bacula-5.2.6/libtool --silent --tag=CXX --mode=link /usr/bin/g++ -D_BDB_PRIV_INTERFACE_   -o libbacsql.la bvfs.lo cats.lo sql.lo sql_cmds.lo sql_create.lo sql_delete.lo sql_find.lo sql_get.lo sql_glue.lo sql_list.lo sql_update.lo -export-dynamic -rpath /usr/lib -release 5.2.6
Compiling cats_dummy.c
Making libbaccats.la ...
/home/liangfuming/bacula-5.2.6/libtool --silent --tag=CXX --mode=link /usr/bin/g++ -D_BDB_PRIV_INTERFACE_   -o libbaccats.la cats_dummy.lo -export-dynamic -rpath /usr/lib -release 5.2.6
Compiling mysql.c
Making libbaccats-mysql.la ...
/home/liangfuming/bacula-5.2.6/libtool --silent --tag=CXX --mode=link /usr/bin/g++ -D_BDB_PRIV_INTERFACE_   -o libbaccats-mysql.la mysql.lo -export-dynamic -rpath /usr/lib -release 5.2.6 \
                                                           -soname libbaccats-5.2.6.so -R /usr/lib/mysql -L/usr/lib/mysql -lmysqlclient_r -lz
/usr/lib/gcc/i586-suse-linux/4.3/../../../../i586-suse-linux/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[1]: *** [libbaccats-mysql.la] Error 1
make[1]: Leaving directory `/home/liangfuming/bacula-5.2.6/src/cats'


  ====== Error in /home/liangfuming/bacula-5.2.6/src/cats ======


==>Entering directory /home/liangfuming/bacula-5.2.6/src/dird
make[1]: Entering directory `/home/liangfuming/bacula-5.2.6/src/dird'
Compiling dird.c
Compiling admin.c
Compiling authenticate.c
Compiling autoprune.c


安装bacula make的时候总是出现上面这个错误,导致bacula启动的时候控制端起不来,今天到网上找问题,
看到帖子 http://blog.csdn.net/liumang_d/article/details/5864605 顿时茅舍顿开。
原来报错是因为找不到z的动态库,也就是libz.so
执行find / -name libz.so  发现libz.so.1 在/lib下面
说明z的动态库存在,只需建立软链接就行,将动态库指向/usr/lib/libz.so
ln -s /lib/libz.so.1 /usr/lib/libz.so

创建完链接后再重新安装bacula 打出一下消息,不再报错,问题解决
Compiling sql_update.c
Making libbacsql.la ...
/home/liangfuming/bacula-5.2.6/libtool --silent --tag=CXX --mode=link /usr/bin/g++ -D_BDB_PRIV_INTERFACE_   -o libbacsql.la bvfs.lo cats.lo sql.lo sql_cmds.lo sql_create.lo sql_delete.lo sql_find.lo sql_get.lo sql_glue.lo sql_list.lo sql_update.lo -export-dynamic -rpath /usr/lib -release 5.2.6
Compiling cats_dummy.c
Making libbaccats.la ...
/home/liangfuming/bacula-5.2.6/libtool --silent --tag=CXX --mode=link /usr/bin/g++ -D_BDB_PRIV_INTERFACE_   -o libbaccats.la cats_dummy.lo -export-dynamic -rpath /usr/lib -release 5.2.6
Compiling mysql.c
Making libbaccats-mysql.la ...
/home/liangfuming/bacula-5.2.6/libtool --silent --tag=CXX --mode=link /usr/bin/g++ -D_BDB_PRIV_INTERFACE_   -o libbaccats-mysql.la mysql.lo -export-dynamic -rpath /usr/lib -release 5.2.6 \
                                                           -soname libbaccats-5.2.6.so -R /usr/lib/mysql -L/usr/lib/mysql -lmysqlclient_r -lz
==== Make of sqllibs is good ====

make[1]: Leaving directory `/home/liangfuming/bacula-5.2.6/src/cats'
==>Entering directory /home/liangfuming/bacula-5.2.6/src/dird
make[1]: Entering directory `/home/liangfuming/bacula-5.2.6/src/dird'
Compiling dird.c
Compiling admin.c
Compiling authenticate.c
Compiling autoprune.c

2bacula主控端启动失败
启动bacula-dir总是报错
23-May 00:24 bacula-dir JobId 0: Fatal error: Please replace this dummy libbaccats library with a proper one.
23-May 00:24 bacula-dir JobId 0: Fatal error: Could not open Catalog "MyCatalog", database "bacula".
23-May 00:24 bacula-dir ERROR TERMINATION
Please correct configuration file: /etc/bacula/bacula-dir.conf

弄了很久,后来发现是libbaccats 这个动态库需要放在/usr/lib/bacula下面,而我自己的动态库全在/usr/lib下面 于是先到/usr/lib下面建一个bacula文件夹
然后执行命令
linux-liangfuming:/etc/bacula # ln -s /usr/lib/libbaccats-5.2.6.so /usr/lib/bacula/libbaccats-5.2.6.so
linux-liangfuming:/etc/bacula # ln -s /usr/lib/libbaccats-mysql.la /usr/lib/bacula/libbaccats-mysql.la
linux-liangfuming:/etc/bacula # ln -s /usr/lib/libbaccats-mysql-5.2.6.so /usr/lib/bacula/libbaccats-my
sql-5.2.6.so
linux-liangfuming:/etc/bacula # ln -s /usr/lib/libbaccats-mysql.so /usr/lib/bacula/libbaccats-mysql.so
linux-liangfuming:/etc/bacula # ln -s /usr/lib/libbaccats.so /usr/lib/bacula/libbaccats.so
linux-liangfuming:/etc/bacula # ln -s /usr/lib/libbaccats.la /usr/lib/bacula/libbaccats.la
然后在/etc/ld.so.conf 中添加路径/usr/lib/bacula
执行/sbin/ldconfig -v更新一下配置
然后重启bacula 发现成功啦!

你可能感兴趣的:(bacula)