Bacula-users

Re: [Bacula-users] Problem adding a client [SOLVED]

2009-12-08 10:22:15
Subject: Re: [Bacula-users] Problem adding a client [SOLVED]
From: Craig White <craigwhite AT azapple DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 08 Dec 2009 08:18:38 -0700
On Sun, 2009-12-06 at 19:32 -0700, Craig White wrote:
> On Sun, 2009-12-06 at 17:41 -0700, Craig White wrote:
> > On Sat, 2009-12-05 at 13:24 -0500, John Drescher wrote:
> > > > I've been all through the documentation and I was sure I set up things
> > > > correctly.
> > > >
> > > > Server is CentOS-5 built 3.0.3
> > > > Client is Macintosh built 3.0.3
> > > >
> > > > Server can telnet to client port 9102
> > > > Client can telnet to server port 9103
> > > >
> > > > Server can back itself up and passes tests including autochanger.
> > > >
> > > > I know firewalls are not the issue and that the client fd is running and
> > > > if I stop the client-fd, I cannot telnet to the client on port 9102
> > > >
> > > > Because I read that the storage daemon must be resolvable by the client,
> > > > I am using an fqdn that is internally resolvable by both server and
> > > > client from intranet dns server (represented as FQDN)
> > > >
> > > > Director calls itself...
> > > > Director {
> > > >  Name = SRV1-dir
> > > >  DIRport = 9101
> > > >  QueryFile = "/etc/bacula/query.sql"
> > > >  WorkingDirectory = "/var/lib/bacula"
> > > >  PidDirectory = "/var/run"
> > > >  SubSysDirectory = "/var/lock/subsys"
> > > >  Maximum Concurrent Jobs = 1
> > > >  Password = "password"
> > > >  Messages = Standard
> > > > }
> > > >
> > > > Director says about client...
> > > > Client {
> > > >  Name = ja
> > > >  Address = 192.168.1.18
> > > >  FDPort = 9102
> > > >  Catalog = MyCatalog
> > > >  Password = "password"
> > > >  File Retention = 75d
> > > >  Job Retention = 75d
> > > >  AutoPrune = yes
> > > > }
> > > >
> > > > Director says about storage...
> > > > Storage {
> > > >  Name = FQDN-sd
> > > >  Address = 127.0.0.1
> > > >  SDPort = 9103
> > > >  Password = "password"
> > > >  Device = LTO-4
> > > >  Media Type = LTO-4
> > > > }
> > > >
> > > You should not have 127.0.0.1 in any bacula configuration file unless
> > > you are using ssh tunnels .
> > ----
> > my problem seems to be with ipv6
> > 
> > If I launch the Macintosh client in the default manner...
> > 
> > launchctl unload -w /Library/LaunchDaemons/org.bacula.bacula-fd.plist
> > 
> > I can connect to the client's fd but cannot communicate with it and I
> > can see both an ipv4 and ipv6 socket are created on 9102
> > # netstat -an|grep 9102
> > tcp4       0      0  *.9102    *.*       LISTEN
> > tcp6       0      0  *.9102    *.*       LISTEN
> > 
> > but if I kill that off, and then just launch it via...
> > 
> > # /usr/local/bacula-3.0.3/etc/bacula-ctl-fd start
> > 
> > I only get the ipv4 socket / listener
> > # netstat -an|grep 9102
> > tcp4       0      0  *.9102    *.*       LISTEN
> > 
> > and I can use it and back up and everything works so I just need to
> > adjust the startup script for now but this is not the default and it's
> > messy.
> ----
> I may need to take this to the bacula developers list but I'm not
> subscribed and maybe someone on the list understands the Macintosh
> configuration.
> 
> No matter what changes I make to the client's fd.conf file they seem to
> be ignored...
> 
> FileDaemon {                          # this is me
>   Name = Scanner-Power-Mac-G5-fd
>   FDAddresses = { ipv4 = { port = 9102;} }
> 
> It still starts the daemon with both ipv4 & ipv6 listeners.
> 
> If I start it manually with the same options
> in /Library/LaunchDaemons/org.bacula.bacula-fd.plist
> or
> /usr/local/bacula-3.0.3/etc/bacula-ctl-fd start
> or
> /usr/local/bacula-3.0.3/sbin/bacula-fd \
>  -c /Library/Preferences/bacula/bacula-fd.conf
> 
> it reads those options and complies happily
> 
> This is just not good
----
Just wanted to leave a track for people - especially Macintosh 'clients'
because this was a problem.

what I did was to change...

# cat platform/osx/files/org.bacula.bacula-fd.plist.in
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>org.bacula.bacula-fd</string>
        <key>ProgramArguments</key>
        <array>
                <string>@PREFIX@/sbin/bacula-fd</string>
                <string>-f</string>
                <string>-c</string>
                <string>@FD_CONF@</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>UserName</key>
        <string>root</string>
</dict>
</plist>

and this allows the Macintosh clients to work...

and even more interesting, I did some modifications so that I could just
install the client and it would automatically work, I modified the
client build package so that it used my 'Director' and my preconfigured
passwords rather than relying on the automatic passwords...

# cat platforms/osx/resources/postflight.in
#!/bin/sh

function genpw() {
  openssl rand -base64 33
}

# copy example config files and fix permissions
if [ ! -f $3@FD_CONF@ ]; then
  DIR_PW="password"
  FD_PW="password"
  SD_PW="password"
  MON_DIR_PW="password"
  MON_FD_PW="password"
  MON_SD_PW="password"
  HOSTNAME=$(hostname -s)
  mkdir -p "$(dirname $3@FD_CONF@)"
  sed \
    -e "s,@DIR_PW@,$DIR_PW,g" \
    -e "s,@FD_PW@,$FD_PW,g" \
    -e "s,@SD_PW@,$SD_PW,g" \
    -e "s,@MON_DIR_PW@,$MON_DIR_PW,g" \
    -e "s,@MON_FD_PW@,$MON_FD_PW,g" \
    -e "s,@MON_SD_PW@,$MON_SD_PW,g" \
    -e "s,@BASENAME@-dir,"SRV1-dir",g" \
    -e "s,@BASENAME@-fd,$HOSTNAME-fd,g" \
    -e "s,@BASENAME@-mon,$HOSTNAME-mon,g" \
    -e "s,@HOSTNAME@,$HOSTNAME,g" \
    "$3@PREFIX@/etc/bacula-fd.conf.example" > "$3@FD_CONF@"
fi
chmod 0600 "$3@FD_CONF@"

# install startup item
mkdir -p -m 0755 "$3/Library/LaunchDaemons"
chmod 0644 "$3@PREFIX@/Library/LaunchDaemons/org.bacula.bacula-fd.plist"
ln -fs "$3@PREFIX@/Library/LaunchDaemons/org.bacula.bacula-fd.plist"
"$3/Library/LaunchDaemons/org.bacula.bacula-fd.plist"
ln -fs "$3/Library/Preferences/bacula-fd.conf"
"$3@PREFIX@/etc/bacula-fd.conf"

# Load startup item
/bin/launchctl load
"$3/Library/LaunchDaemons/org.bacula.bacula-fd.plist"

Craig


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>