You are not logged in.

#1 2004-12-02 16:09:51

BlueRaven
Member
Registered: 2004-10-28
Posts: 14

[NEW] Bacula

Hi, I thoroughly checked all the repositories mentioned in the sticky topic and could not find any reference to Bacula, so I'm posting my PKGBUILD here... hope it will be useful to you all. :-)

PKGBUILD:

pkgname=bacula
pkgver=1.36.1
pkgrel=1
pkgdesc="Bacula is a full-featured network backup management system"
url="http://www.bacula.org"
#license="GPL2"
depends=('bash' 'mtx' 'mysql' 'ncurses')
#makedepends=()
conflicts=('bacula-client')
#replaces=()
backup=('etc/bacula/bacula-dir.conf' 'etc/bacula/bacula-fd.conf'
        'etc/bacula/bacula-sd.conf' 'etc/bacula/bconsole.conf')
install=('bacula.install')
source=(http://download.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
        bacula bacula.conf.d)
md5sums=('d09ecce1bc9e3a421f7eaf5ad2de5850' 'c6aa370016e56935fbfb717a594c8bbe'
         '5749f024ad34cd6e1b3146ba5c32bbc2')

build() {
  cd $startdir/src/$pkgname-$pkgver
  ./configure --prefix=/usr --sysconfdir=/etc/bacula 
    --with-working-dir=/var/lib/bacula --with-subsys-dir=/var/lib/bacula 
    --with-scriptdir=/etc/bacula/scripts --with-tcp-wrappers --with-mysql
  make || return 1
  make DESTDIR=$startdir/pkg install

  # We want Arch-style init script! :-)
  #
  install -D -m755 ../bacula $startdir/pkg/etc/rc.d/bacula

  # Provide a centralized configuration file.
  #
  install -D -m644 ../bacula.conf.d $startdir/pkg/etc/conf.d/bacula
}

Install file (bacula.install):

# arg 1:  the new package version
post_install() {
  echo
  echo "WARNING: if you change port numbers in /etc/conf.d/bacula,"
  echo "remember to change them in configuration files, too!"
  echo "Else, your Bacula installation won't work at all."
  echo
  echo "Also, remember to run the scripts to create the database and grant"
  echo "Bacula the appropriate privileges on it (see Bacula User's Guide)."
  echo
  echo "If you configure Bacula to start automatically from /etc/rc.conf,"
  echo "please ensure that MySQL is started BEFORE it."
  echo
}

# arg 1:  the new package version
# arg 2:  the old package version
post_upgrade() {
  echo
  echo "Before (re)starting Bacula, please read the ReleaseNotes CAREFULLY:"
  echo "you may need to upgrade your database format (see Bacula User's Guide)."
  echo
}

# arg 1:  the old package version
post_remove() {
  [ -d /var/lib/bacula ] && rm -rf /var/lib/bacula
  echo
  echo "Do not forget to drop your Bacula database and revoke user privileges!"
  echo
}

op=$1
shift
$op $*

Init script (bacula):

#!/bin/bash

# Source application-specific settings
[ -f /etc/conf.d/bacula ] && . /etc/conf.d/bacula

. /etc/rc.conf
. /etc/rc.d/functions

FD_PIDFILE="/var/run/bacula-fd.$FD_PORT.pid"
SD_PIDFILE="/var/run/bacula-sd.$SD_PORT.pid"
DIR_PIDFILE="/var/run/bacula-dir.$DIR_PORT.pid"

[ -f $FD_PIDFILE ] && FD_PID=`head -n 1 $FD_PIDFILE`
[ -f $SD_PIDFILE ] && SD_PID=`head -n 1 $SD_PIDFILE`
[ -f $DIR_PIDFILE ] && DIR_PID=`head -n 1 $DIR_PIDFILE`

case "$1" in
  start)
    stat_busy "Starting Bacula"
    /usr/sbin/bacula-fd -c /etc/bacula/bacula-fd.conf
    /usr/sbin/bacula-sd -c /etc/bacula/bacula-sd.conf
    /usr/sbin/bacula-dir -c /etc/bacula/bacula-dir.conf
    sleep 1
    if [ ! -f $FD_PIDFILE ] || [ ! -f $SD_PIDFILE ] || [ ! -f $DIR_PIDFILE ]; then
      stat_fail
    else
      add_daemon bacula
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping Bacula"
    FAILURE=""
    [ -f $FD_PIDFILE ] && kill $FD_PID &> /dev/null
    if [ $? -gt 0 ]; then
      FAILURE="yes"
    fi
    [ -f $SD_PIDFILE ] && kill $SD_PID &> /dev/null
    if [ $? -gt 0 ]; then
      FAILURE="yes"
    fi
    [ -f $DIR_PIDFILE ] && kill $DIR_PID &> /dev/null
    if [ $? -gt 0 ]; then
      FAILURE="yes"
    fi
    if [ -n "$FAILURE" ]; then
      stat_fail
    else
      rm_daemon bacula
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 5
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"  
esac
exit 0

Configuration file (bacula.conf.d):

# Parameters to be passed to Bacula init script.
# WARNING: if you change ports here, please remember to change them
# also in your configuration files, or your Bacula installation won't work!
#
DIR_PORT=9101
FD_PORT=9102
SD_PORT=9103

Any feedback welcome!!! 8)

Offline

#2 2005-02-13 09:58:17

Comete
Member
From: France
Registered: 2003-08-03
Posts: 46

Re: [NEW] Bacula

hi,
thank you very much for this package ! Bacula is a killer application !
I hope it will be included in "extra" repository. I am actually testing your package, but i've modified it to support postgresql. No problem at the moment.

thanks again !

Comete

Offline

#3 2005-02-15 21:42:55

Comete
Member
From: France
Registered: 2003-08-03
Posts: 46

Re: [NEW] Bacula

hi,

just a thing : bconsole doesn't want to run unless i precise the config file for it like this:

bconsole -c /etc/bacula/bconsole.conf

Offline

#4 2005-02-23 10:41:44

BlueRaven
Member
Registered: 2004-10-28
Posts: 14

Re: [NEW] Bacula

I am invoking it using the full path and have no problems.
Don't know if this is normal behaviour or not...

Offline

Board footer

Powered by FluxBB