You are not logged in.

#1 2004-12-02 18:22:23

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

[NEW] bacula-client

This is a companion package for the Bacula one I posted a few hours ago... it provides the client part only, so you aren't forced to install the whole thing on the to be backed up machines.
Hope you'll enjoy it! ;-)

PKGBUILD:

pkgname=bacula-client
pkgver=1.36.1
pkgrel=1
pkgdesc="Bacula is a full-featured network backup management system (client part only)"
url="http://www.bacula.org"
#license="GPL2"
depends=('bash' 'ncurses')
#makedepends=()
conflicts=('bacula')
#replaces=()
backup=('etc/bacula/bacula-fd.conf')
install=('bacula-client.install')
source=(http://download.sourceforge.net/`basename $pkgname -client`/`basename $pkgname -client`-$pkgver.tar.gz
        bacula-fd bacula-fd.conf.d)
md5sums=('d09ecce1bc9e3a421f7eaf5ad2de5850' '642246f92d6060c1d8bc61b0b898f713'
         '2fba60a7e1047258c719ce6c3da701ed')

build() {
  cd $startdir/src/`basename $pkgname -client`-$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 --enable-client-only
  make || return 1
  make DESTDIR=$startdir/pkg install

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

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

  # Remove not needed stuff, I want client part ONLY!!!
  #
  rm -rf $startdir/pkg/etc/bacula/scripts
  rm -f $startdir/pkg/etc/bacula/bconsole.conf
  rm -f $startdir/pkg/usr/sbin/{bconsole,btraceback}
}

Install file (bacula-client.install)

# arg 1:  the new package version
post_install() {
  echo
  echo "WARNING: if you change port numbers in /etc/conf.d/bacula-fd,"
  echo "remember to change them in the configuration file, too!"
  echo "Else, your Bacula installation won't work at all."
  echo
}

# arg 1:  the old package version
post_remove() {
  [ -d /var/lib/bacula ] && rm -rf /var/lib/bacula
}

op=$1
shift
$op $*

Init script (bacula-fd):

#!/bin/bash

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

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

FD_PIDFILE="/var/run/bacula-fd.$FD_PORT.pid"

[ -f $FD_PIDFILE ] && FD_PID=`head -n 1 $FD_PIDFILE`

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

Configuration file (bacula-fd.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!
#
FD_PORT=9102

Any feedback welcome!!! 8)

Offline

Board footer

Powered by FluxBB