On Wed, Mar 08, 2006 at 09:43:28AM +0100, Stefan Schwietert wrote:

> Is there someone who has managed to start bacula-fd with launchd. I  
> tried it but launchd gets an error, tries to start it several times  
> and then gives up. If I start bacula-fd by hand everything is good.  
> So I think the problem is related to launchd and its mechanism to  
> manage ports and sockets.

You'll see that result if you use launchd to run the normal bacula
startup script, since the script runs bacula-fd as a daemon and
launchd interprets the daemonization as a sign that the program has
failed and has to be restarted.  

I've had success with the following launchd file.  It's written to use
the standard bacula file locations which run the command:

    /sbin/bacula-fd -v -f -c /etc/bacula/bacula-fd.conf

As you've already figured out, you can just drop this big blob of XML
into the  /Library/LaunchDaemons/ directory with a filename of
net.bacula-fd.plist, and launchd will do the rest.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC
  "-//Apple Computer//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
  <dict>
    <key>Label</key>
      <string>net.bacula-fd</string>
    <key>OnDemand</key>
      <false/>
    <key>ProgramArguments</key>
      <array>
        <string>/sbin/bacula-fd</string>
        <string>-f</string>
        <string>-v</string>
        <string>-c</string>
        <string>/etc/bacula/bacula-fd.conf</string>
      </array>
  </dict>
</plist>

-- John Kodis.

PS:  It sure would have been nice if instead of 20 lines of fairly
illegible XML we could just write something like:

    label   = net.bacula-fd
    program = /sbin/bacula-fd -f -v -c /etc/bacula/bacula-fd.conf

Oh well.  I guess that even the XML version is easier to read and
write than the typical shell startup script, so at least it's a step
in the right direction.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to