Attached is a small patch against the RHEL/CentOS fschwarz
bacula-client-3.0.2-1.x86_64 init script.  My apologies that I'm not
set up for git right now, so I'm not sure if this has already been
fixed in a newer version.

This fixes a problem where, if you have more than one bacula-fd running,
then 'service bacula-fd status' and 'service bacula-fd stop' will 
improperly kill *all* bacula-fd instances instead of just the one started
by the script.

I ran into this when I had most filesystem backed up by the main bacula-fd
controlled by the init script, but also had additional bacula-fd processes
for Linux-HA clustered filesystems.

The patch is also available at
        ftp://ftp.gno.org/pub/tools/bacula-contrib

See the README for details.

Devin
-- 
Shirt, Shoes, Sober... --Pick Two
                                                        - Chuck Yerkes
*** bacula-fd.orig      2009-07-30 01:58:52.000000000 -0600
--- bacula-fd   2010-12-29 18:01:46.000000000 -0700
***************
*** 31,36 ****
--- 31,45 ----
  MALLOC_CHECK_=0
  export MALLOC_CHECK_
  
+ # Set FD_PIDFILE in /etc/sysconfig/bacula if you have more than one fd
+ # running, such as in a cluster environment.  Assuming a default port,
+ # you would set
+ #     FD_PIDFILE=/var/run/bacula-fd.9102.pid
+ # in that file.
+ if [ -n "$FD_PIDFILE" ]; then
+     FD_PIDFILE_OPTIONS="-p $FD_PIDFILE"
+ fi
+ 
  RETVAL=0
  case "$1" in
      start)
***************
*** 49,55 ****
         ;;
      stop)
         echo -n "Stopping Bacula File services: "
!        killproc /usr/sbin/bacula-fd
         RETVAL=$?
         echo
         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bacula-fd
--- 58,64 ----
         ;;
      stop)
         echo -n "Stopping Bacula File services: "
!        killproc $FD_PIDFILE_OPTIONS /usr/sbin/bacula-fd 
         RETVAL=$?
         echo
         [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bacula-fd
***************
*** 60,66 ****
         $0 start
         ;;
      status)
!        status /usr/sbin/bacula-fd
         ;;
      *)
         echo "Usage: $0 {start|stop|restart|status}"
--- 69,75 ----
         $0 start
         ;;
      status)
!        status $FD_PIDFILE_OPTIONS /usr/sbin/bacula-fd
         ;;
      *)
         echo "Usage: $0 {start|stop|restart|status}"
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to