Bacula-users

Re: [Bacula-users] Two installation problems, btape & bacula-fd

2008-09-03 15:57:37
Subject: Re: [Bacula-users] Two installation problems, btape & bacula-fd
From: Arno Lehmann <al AT its-lehmann DOT de>
To: bacula-users AT lists.sourceforge DOT net
Date: Wed, 03 Sep 2008 21:57:15 +0200
Hi,

I'm sorry to get into this discussion late - it probably means I don't 
recall everything that has been written...

03.09.2008 17:53, Jonathan Sachs wrote:
>   A few days ago John Descher responded to my previous message by 
> confirming that Bacula cannot use an address that is not an IP address 
> or domain name, and so cannot have a host or client identified by a 
> dynamic IP address.

Well, I kind of disagree here. The first part of that statement is 
definitely correct: Addresses in BAcula are IP adresses or domain names.

But, with a "proper" setup, you can easily handle dynamic IP 
addresses. You just need to ensure that each client gets a unique host 
name. Internet-wide, services like dyndns offer that. In a LAN, you'd 
use a combination of dhcp, DNS server and dynamic DNS updates (the 
common setup I know is ISC's dhcpd, BIND, and a bit of configuration). 
The notebook I'm writing this message on, for example, is usually 
called phoenix.my.internal.domain.name.de, and it does not matter if 
it's connected via cable or WLAN or which IP address it gets.

Furthermore, if you can not control the dns names of your Bacula 
clients, there is a work-around available: the console command setip 
allows a client to notify the DIR of its current IP address.

(As you already solved that problem consider the above sentences a 
clarification for readers of the mailing list archives :-)

>  John: I appreciate your response, but you answered 
> my last question.  The first one was the show stopper, and I'm still 
> wrestling with that.
> 
> To recap, after I followed your advice about using IP addresses I was 
> able to run the example job described in "A Brief Tutorial" (Chapter 9 
> of the Bacula manual), but it failed with the error:
> 
>          (gedit:15893): WARNING **: Failed to create file 
> '/root/.gnome2/gedit/gedit-print-settings.J2LQGU': No such file or directory

This, as a result of a backup job, seems to be seriously wrong. First 
I wonder why it states that gedit has a problem here. The only reason 
I can imagine for this is that your backup job calls a run before job 
script that, in turn, uses gedit to print something - and that would 
be really sophisticated...

> I revisited this problem this morning to see if I could get any farther 
> on my own.  I looked for a reference to /root/.gnome2/gedit (or any 
> reference to the string 'gedit') in Bacula's conf files, but found 
> none.  For lack of a better approach, I created that directory myself, 
> with owner root, group bacula, both having "create and delete files" 
> permission.  Then I started bconsole and tried to run the sample job again.
> 
> The job immediately said "you have messages."  When I displayed them I 
> got a large number of error messages (enough to overflow the shell's 
> buffer).  All of them said:
> 
>          03-Sep 10:18 Sonata-Ubuntu-dir JobId 6: Error: message.c:590 
> fopen /var/lib/bacula/log failed: ERR=Permission denied
> 
> After the last error message, Bacula tried to start the sample job, and 
> said:
> 
>          03-Sep 10:19 Sonata-Ubuntu-dir JobId 7: No prior Full backup 
> Job record found.
>          03-Sep 10:19 Sonata-Ubuntu-dir JobId 7: No prior or suitable 
> Full backup found in catalog. Doing FULL backup.
>          *
>          03-Sep 10:19 Sonata-Ubuntu-dir JobId 7: Start Backup JobId 7, 
> Job=Client1.2008-09-03_10.19.03
>          03-Sep 10:19 Sonata-Ubuntu-dir JobId 7: Using Device "FileStorage"
> 
> After a delay of a minute or somewhat less, bconsole terminated.  When I 
> tried to restart it I found that the director had terminated too.
> 
> The messages about /var/lib/bacula/log particularly puzzle me.  I was 
> running bconsole and all of the daemons through sudo (with root 
> privileges), so I don't see how bacula could be denied permission to 
> access anything.

Well, those messages look like what you get if Bacula wasn't 
completely installed - namely, the directories it uses don't exist or 
have the wrong permissions. If, as you state, the DIR runs as root, a 
"permission denied" error points toward SElinux, AppArmor, or any 
other security / policy system.

> I got inconsistent results trying to reproduce this problem.  The next 
> time I tried it I didn't get the messages about /var/lib/bacula/log, and 
> bconsole and the directory didn't terminate, but I didn't get a backup, 
> either -- or any messages explaining why.

Rather typical if the logs can't be written.

You might try starting the DIR in the foreground and let it create 
debug output like 'bacula-dir -c /etc/bacule/bacula-dir.conf -d 50 
-f', for example.

Additionally, to see what makes the DIR crash, you can use strace to 
see what files it accesses and where those file operations fail.

Finally, if you're running with SELinux, AppAprmor, or similar, those 
should write log files, too.

> This all seems to murky to expect an immediate solution, but I hope you 
> can make another suggestion that will help me move forward.

I'd say start with the DIR in the foreground plus debug output. Next 
check for security toolkits and see what you can get with strace. If 
all of that does not help you, you might want to learn how to use gdb...

Arno

-- 
Arno Lehmann
IT-Service Lehmann
Sandstr. 6, 49080 Osnabrück
www.its-lehmann.de

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users