Bug 28618

Summary: bat (Bacula Administration Tool) fails at start
Product: Mageia Reporter: pat dealt <pat.dealt>
Component: RPM PackagesAssignee: All Packagers <pkg-bugs>
Status: NEW --- QA Contact:
Severity: major    
Priority: High CC: j.biernacki+mga, mageia, ouaurelien
Version: 8   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
See Also: https://bugs.mageia.org/show_bug.cgi?id=28633
Whiteboard:
Source RPM: bacula-9.6.7-1.mga8.src.rpm CVE:
Status comment:

Description pat dealt 2021-03-20 14:50:09 CET
Description of problem:
-----------------------
Whenever bat is launched in a Konsole, 
the following error occurs :

>>>>>>>

/usr/sbin/bat: error: `/usr/sbin/.libs/bat' does not exist
This script is just a wrapper for bat.
See the libtool documentation for more information.

<<<<<<<

Version-Release number of selected component:
---------------------------------------------

bacula-bat-9.6.7-1.mga8.x86_64.rpm

Mageia 8

5.10.20-desktop-2.mga8
arch: 64-bit
Desktop : KDE

How to reproduce:
-----------------

simply launch the command : 
bat
then it crashes immediately

Every time I attempt to login.

Steps to Reproduce:
------------------
Run "bat" in a konsole 
or /usr/sbin/bat -c /etc/bacula/bat.conf
Comment 1 pat dealt 2021-03-20 15:18:06 CET
This bug was reported in Mageia-7 (bacula-9.4.1-1.mga7) as numbers 24096 and 25431 but never fixed.

It's also similar to 16717 that concerns bacula-tray-monitor (instead of bat) I provided five years ago on Mageia 5.

That last bug (16717) was fixed but in an unappropriate manner :

In both cases, the issue comes from that a building shell script is copied in /usr/sbin directory instead of a binary file produced by building process.

The shell header comment says :
# This wrapper script should never be moved out of the build directory.
# If it is, it will not operate correctly.

But it is, and the consequence is that :
the directory /usr/sbin/.libs is created and the shell script points out to a supposed binary (bat or tray) in that directory.

On Mageia 7 and 8  the bat binary doesn't exist -> failure
On Mageia 5 after 16717 fix in Mageia-5-7.0.5-14.6 the tray binary is finally run but it would be cleaner to avoid the wrapper script step and to copy binaries directly to /usr/sbin.
Comment 2 pat dealt 2021-03-20 15:45:06 CET
Changes performed on bacula.spec file from bacula-9.6.7-1.mga8.src.rpm :

Differences between
(<) updated bacula.spec.mod to solve issues recorded in bug 28618 and 16717
  and
(>) bacula.spec.org provided in bacula-9.6.7-1.mga8.src.rpm


diff bacula.spec.mod bacula.spec.org
352d351
< install -p -m 755 -D src/qt-console/.libs/bat %{buildroot}%{_sbindir}/bat
357c356
< %{__install} -p -m 755 -D src/qt-console/tray-monitor/.libs/bacula-tray-monitor %{buildroot}%{_sbindir}/bacula-tray-monitor
---
> %{__install} -p -m 755 -D src/qt-console/tray-monitor/.libs/bacula-tray-monitor %{buildroot}%{_sbindir}/.libs/bacula-tray-monitor
621d619
< %{_sbindir}/bat
630c628
< %{_sbindir}/bacula-tray-monitor

It works for me. Let me know for you.
Comment 3 Aurelien Oudelet 2021-03-21 17:54:47 CET
Hi, thanks for reporting this bug.
As there is no maintainer for this package I added the committers in CC.

(Please set the status to 'assigned' if you are working on it)

Assignee: bugsquad => pkg-bugs
Severity: critical => major
CC: (none) => mageia, ouaurelien

Aurelien Oudelet 2021-03-21 17:55:47 CET

Source RPM: bacula-bat-9.6.7-1.mga8.x86_64 => bacula-9.6.7-1.mga8.src.rpm

Comment 4 Lewis Smith 2021-03-23 21:04:04 CET
Raising the priority because this is 1/3 bacula bugs.
See also Bug 28630, Bug 28633.

Priority: Normal => High

Comment 5 pat dealt 2021-05-07 17:48:33 CEST
Same problem in last update bacula-9.6.7-1.1.mga8.x86_64

Mageia 8

5.10.33-desktop-1.mga8
arch: 64-bit
Desktop : KDE

Am I the only guy using bacula on Mageia? Recent bug is fixed in version 9.6.7-1.1 (#28789) why? : no chance to have bacula working without bugs 28618,28630,28633 fixed. Again tray crash was recorded for the first time 5 years ago.

Based on bacula-spec version 9.6.7-1.1 bugs 28618,28630,28633 fixes are there.

diff bacula-9.6.7-1.1.mod.spec bacula-9.6.7-1.1.org.spec
--------------------------------------------------------

353d352
< install -p -m 755 -D src/qt-console/.libs/bat %{buildroot}%{_sbindir}/bat
357,358c356,358
< %{__install} -p -m 755 -D src/qt-console/tray-monitor/.libs/bacula-tray-monitor %{buildroot}%{_sbindir}/bacula-tray-monitor
< %{__install} -p -m 644 -D src/qt-console/tray-monitor/tray-monitor.conf %{buildroot}%{_sysconfdir}/bacula/bacula-tray-monitor.conf
---
> %{__install} -p -m 755 -D src/qt-console/tray-monitor/bacula-tray-monitor %{buildroot}%{_sbindir}/bacula-tray-monitor
> %{__install} -p -m 755 -D src/qt-console/tray-monitor/.libs/bacula-tray-monitor %{buildroot}%{_sbindir}/.libs/bacula-tray-monitor
> %{__install} -p -m 644 -D src/qt-console/tray-monitor/tray-monitor.conf %{buildroot}%{_sysconfdir}/bacula/tray-monitor.conf
610c610
< %config(noreplace) %{sysconf_dir}/bconsole.conf %attr(640,root,%{username})
---
> %config(noreplace) %{sysconf_dir}/bconsole.conf %attr(640,root,root)
617c617
< %config(noreplace) %{sysconf_dir}/bat.conf %attr(640,root,%{username})
---
> %config(noreplace) %{sysconf_dir}/bat.conf %attr(640,root,root)
623d622
< %{_sbindir}/bat
627c626,627
< %attr(640,root,%{username})%config(noreplace) %{sysconf_dir}/bacula-tray-monitor.conf
---
> %attr(640,root,root)%config(noreplace) %{sysconf_dir}/tray-monitor.conf
> %attr(640,root,root)%config(noreplace) %{sysconf_dir}/bacula-tray-monitor.conf
631c631
< %{_sbindir}/bacula-tray-monitor
---
> %{_sbindir}/.libs/bacula-tray-monitor
Comment 6 Jybz 2022-03-13 20:32:27 CET
> Am I the only guy using bacula on Mageia?
I think yes :D

I tried the modifications, but I don't know how to test it.
Would you like to check it?

CC: (none) => j.biernacki+mga

Comment 7 Jybz 2022-03-13 20:35:54 CET
Pat dealt, can you have a look on this bug report:
https://bugs.mageia.org/show_bug.cgi?id=25553

What is your opinion about it?
Comment 8 pat dealt 2022-03-15 14:08:48 CET
My answer to comment 6.
----------------------
I already made the changes and tested it on my own environment/configuration :
- One Bacula-SD server on Mageia7
- Two Bacula-DIR on Mageia7 and Mageia-8.
- two Bacula-FD (client) on the above machines 
- Three Bacula-FD  (client) on Windows 10 machines.
- mysql/mariadb used as database system

and it works for me.

But if you provide me with x86_64 rpm binaries, I can test your update on my bacula dir / Mageia 8 machine ... as far it is  compatible with Bacula Storage Daemon used on Mageia-7 (ie bacula sd, dir and fd needs to be compatible on different machines) otherwise I would be obliged to update my whole bacula system that is a huge task I do not want to do.

Give me a link to all rpm updated packages 

My answer to comment 7.
----------------------
I need to investigate and will answer later.
Comment 9 Jybz 2022-03-16 16:23:43 CET
Hi, it will soon land into 8 core/updates_testing status available here : http://pkgsubmit.mageia.org/ .
I really don't want to make your whole system unstable, can't you try it on another temporary/fake system?
This will be the same software-version as the one available on mga8.
Comment 10 pat dealt 2022-03-18 17:33:54 CET
Hi,

I installed the following packages on one of my machines used as Director Daemon and File Daemon but not as Storage Daemon :

 - bacula-fd-9.6.7-2.mga8.x86_64        
 - bacula-console-9.6.7-2.mga8.x86_64   
 - bacula-dir-9.6.7-2.mga8.x86_64       
 - lib64bacula-sql7-9.6.7-2.mga8.x86_64   
 - bacula-common-9.6.7-2.mga8.x86_64       
 - bacula-tray-monitor-9.6.7-2.mga8.x86_64  
 - bacula-bat-9.6.7-2.mga8.x86_64           
 - lib64bacula7-9.6.7-2.mga8.x86_64         

The results are the following :

- /usr/sbin/.slib is no more created
- bat binary is now found in /usr/sbin instead of a bat shell and is running
- bacula-tray-monitor is now found in /usr/sbin instead of a shell and is 
  running

But there is a side effect due to owner/group changes for these two files :

- /usr/sbin/bacula-fd         750    bacula bacula
- /etc/bacula/bacula-fd.conf  640    bacula bacula

The owner/group of these two files should come back to previous release ones :

- /usr/sbin/bacula-fd         750    root bacula
- /etc/bacula/bacula-fd.conf  640    root root

Otherwise during backup process the files invisible to bacula user won't be considered. The FD daemon is the only one that needs to be owned by root in order to backup all files including system files usually owned by root.
Comment 11 Jybz 2022-04-08 11:47:48 CEST
Should all binaries in /usr/sbin be owned by root ?
Actually, most of them are owned by bacula.
Comment 12 pat dealt 2022-04-12 12:05:05 CEST
In last Mageia 7 
(ie 

bacula-fd-9.4.2-4.mga7
bacula-bat-9.4.2-4.mga7
bacula-common-9.4.2-4.mga7
bacula-sd-9.4.2-4.mga7
bacula-console-9.4.2-4.mga7
lib64bacula-sql7-9.4.2-4.mga7
bacula-dir-9.4.2-4.mga7
bacula-tray-monitor-9.4.2-4.mga7
lib64bacula7-9.4.2-4.mga7
)

The owners and groups for binaries were :

-rwxr-x--- 1 root bacula 662352 mars  30  2019 /usr/sbin/bacula-dir
-rwxr-x--- 1 root bacula 271680 mars  30  2019 /usr/sbin/bacula-fd
-rwxr-x--- 1 root bacula 157904 mars  30  2019 /usr/sbin/bacula-sd
-rwxr-x--- 1 root bacula 677080 mars  30  2019 /usr/sbin/bacula-tray-monitor
-rwxr-x--- 1 root bacula   6552 mars  30  2019 /usr/sbin/bat
-rwxr-x--- 1 root bacula  25416 mars  30  2019 /usr/sbin/bbconsjson
-rwxr-x--- 1 root bacula  47432 mars  30  2019 /usr/sbin/bconsole
-rwxr-x--- 1 root bacula  46816 mars  30  2019 /usr/sbin/bcopy
-rwxr-x--- 1 root bacula 115776 mars  30  2019 /usr/sbin/bdirjson
-rwxr-x--- 1 root bacula  55408 mars  30  2019 /usr/sbin/bextract
-rwxr-x--- 1 root bacula  39744 mars  30  2019 /usr/sbin/bfdjson
-rwxr-x--- 1 root bacula  55264 mars  30  2019 /usr/sbin/bls
-rwxr-x--- 1 root bacula  15472 mars  30  2019 /usr/sbin/bregex
-rwxr-x--- 1 root bacula  67864 mars  30  2019 /usr/sbin/bscan
-rwxr-x--- 1 root bacula  42736 mars  30  2019 /usr/sbin/bsdjson
-rwxr-x--- 1 root bacula  23976 mars  30  2019 /usr/sbin/bsmtp
-rwxr-x--- 1 root bacula 106216 mars  30  2019 /usr/sbin/btape
-rwxr-x--- 1 root bacula  15448 mars  30  2019 /usr/sbin/bwild
-rwxr-x--- 1 root bacula 132328 mars  30  2019 /usr/sbin/dbcheck
-rwxr-xr-x 1 root root   677080 mars  30  2019 /usr/sbin/.libs/bacula-tray-monitor

and it worked perfectly.

Now with Mageia 8

(ie 
bacula-bat-9.6.7-2.mga8
bacula-dir-9.6.7-2.mga8
bacula-tray-monitor-9.6.7-2.mga8
bacula-console-9.6.7-2.mga8
lib64bacula-sql7-9.6.7-2.mga8
bacula-common-9.6.7-2.mga8
bacula-fd-9.6.7-2.mga8
lib64bacula7-9.6.7-2.mga8

)

The owners and groups for binaries are :

-rwxr-x--- 1 bacula bacula  683216 mars  16 16:39 /usr/sbin/bacula-dir
-rwxr-x--- 1 root   bacula  276144 mars  16 16:39 /usr/sbin/bacula-fd
-rwxr-x--- 1 bacula bacula  660600 mars  16 16:39 /usr/sbin/bacula-tray-monitor
-rwxr-x--- 1 bacula bacula 1440432 mars  16 16:39 /usr/sbin/bat
-rwxr-x--- 1 bacula bacula   25432 mars  16 16:39 /usr/sbin/bbconsjson
-rwxr-x--- 1 bacula bacula   47456 mars  16 16:39 /usr/sbin/bconsole
-rwxr-x--- 1 bacula bacula  115816 mars  16 16:39 /usr/sbin/bdirjson
-rwxr-x--- 1 bacula bacula   39832 mars  16 16:39 /usr/sbin/bfdjson
-rwxr-x--- 1 bacula bacula   15512 mars  16 16:39 /usr/sbin/bregex
-rwxr-x--- 1 bacula bacula   24024 mars  16 16:39 /usr/sbin/bsmtp
-rwxr-x--- 1 bacula bacula    2366 mars  16 16:37 /usr/sbin/btraceback
-rwxr-x--- 1 bacula bacula   15480 mars  16 16:39 /usr/sbin/bwild
-rwxr-x--- 1 bacula bacula  132352 mars  16 16:39 /usr/sbin/dbcheck

and it works perfectly as well.

Please note I didn't check the Storage Daemon (and associated binaries) on Mageia 8 (mine is still working on  Mageia 7).
I would recommend to let root as owner and bacula as group for all binaries only as it was on Mageia 7.
Comment 13 pat dealt 2022-04-15 09:16:51 CEST
The most important is to get permission "x" to group "bacula" and run bacula binaries as a user member of bacula group.
Morgan Leijström 2022-09-24 12:18:47 CEST

See Also: (none) => https://bugs.mageia.org/show_bug.cgi?id=28633