]> git.sur5r.net Git - bacula/bacula/commitdiff
Implement autostart scripts for Debian
authorKern Sibbald <kern@sibbald.com>
Fri, 21 Mar 2008 17:45:46 +0000 (17:45 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 21 Mar 2008 17:45:46 +0000 (17:45 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6658 91ce42f0-d328-0410-95d8-f526ca767f89

13 files changed:
bacula/autoconf/bacula-macros/db.m4
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/platforms/Makefile.in
bacula/platforms/debian/Makefile.in [new file with mode: 0644]
bacula/platforms/debian/bacula-dir.in [new file with mode: 0644]
bacula/platforms/debian/bacula-director [deleted file]
bacula/platforms/debian/bacula-fd.in [new file with mode: 0644]
bacula/platforms/debian/bacula-sd.in [new file with mode: 0644]
bacula/projects
bacula/src/win32/libwin32/bacula.rc
bacula/technotes-2.3

index df2c980a85dd3d8f82777061995857f22275d21e..6b943649907dc394e1264f5b16a6fa8cdc76fb1b 100644 (file)
@@ -98,7 +98,7 @@ AC_ARG_WITH(dbi,
      SQL_LIB=$DBI_LIBDIR/libdbi.a
      DBI_DBD_DRIVERDIR="-D DBI_DRIVER_DIR=\\\"$DRIVERDIR\\\""
 
-     AC_DEFINE(HAVE_DBI)
+     AC_DEFINE(HAVE_DBI, 1, [Set if you have the DBI driver])
      AC_MSG_RESULT(yes)
      db_found=yes
      support_dbi=yes
index 1c072aac7cd03abcf2e4c2b0d34a3eb6a5f86e9f..5fa46139c409dacd8bc743ca9462c07049d7f212 100644 (file)
@@ -21,9 +21,6 @@
 /* Define to `int' if <sys/types.h> doesn't define.  */
 #undef ssize_t
 
-/* Define if you want to use DBI */
-#undef HAVE_DBI
-
 /* Define if you want to use PostgreSQL */
 #undef HAVE_POSTGRESQL
 
 /* Define to 1 if you have the <curses.h> header file. */
 #undef HAVE_CURSES_H
 
+/* Set if you have the DBI driver */
+#undef HAVE_DBI
+
 /* Define if the GNU dcgettext() function is already present or preinstalled.
    */
 #undef HAVE_DCGETTEXT
    */
 #undef HAVE_DECL_TZNAME
 
-/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
-   */
-#undef HAVE_DECL_TZNAME
-
 /* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
    don't. */
 #undef HAVE_DECL__SNPRINTF
index 75e849dc9ef37a0d6ff4049c94afcacacb6b64bf..030fe2bff9dad3c09c18bf7feaeb5a47d0b64a99 100644 (file)
@@ -1945,8 +1945,13 @@ darwin)
   ;;
 debian)
        DISTVER=`cat /etc/debian_version`
-       TAPEDRIVE="/dev/nrst0"
+       TAPEDRIVE="/dev/nst0"
        PSCMD="ps -e -o pid,command"
+       PFILES="${PFILES} \
+           platforms/debian/Makefile \
+           platforms/debian/bacula-fd \
+           platforms/debian/bacula-sd \
+           platforms/debian/bacula-dir"
   ;;
 freebsd)
        DISTVER=`uname -a |awk '{print $3}'`
index 9f583fd37c6073115d88b732f260a75022aca182..555921d121ee6dece7bd3073d3619eb5a6ea01fe 100755 (executable)
@@ -17968,7 +17968,8 @@ echo "$as_me: error: Invalid DBD driver directory $withval - unable to find DBD
      SQL_LIB=$DBI_LIBDIR/libdbi.a
      DBI_DBD_DRIVERDIR="-D DBI_DRIVER_DIR=\\\"$DRIVERDIR\\\""
 
-     cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
 #define HAVE_DBI 1
 _ACEOF
 
@@ -30110,8 +30111,13 @@ darwin)
   ;;
 debian)
        DISTVER=`cat /etc/debian_version`
-       TAPEDRIVE="/dev/nrst0"
+       TAPEDRIVE="/dev/nst0"
        PSCMD="ps -e -o pid,command"
+       PFILES="${PFILES} \
+           platforms/debian/Makefile \
+           platforms/debian/bacula-fd \
+           platforms/debian/bacula-sd \
+           platforms/debian/bacula-dir"
   ;;
 freebsd)
        DISTVER=`uname -a |awk '{print $3}'`
index d0808e9768f4c845e24ff94a73ea9cfb6a32e3f5..c8b24eb0f9f4cff8af4f3ce221da6d4351d3aec9 100644 (file)
@@ -12,7 +12,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL = @INSTALL@
 
 SUBDIRS = freebsd redhat solaris unknown openbsd irix gentoo \
-         darwin aix bsdi mandrake slackware alpha
+         debian darwin aix bsdi mandrake slackware alpha
 
 MAKE = make
 
diff --git a/bacula/platforms/debian/Makefile.in b/bacula/platforms/debian/Makefile.in
new file mode 100644 (file)
index 0000000..aa77f36
--- /dev/null
@@ -0,0 +1,88 @@
+# 
+# This file is used as the template to create the
+# Makefile for the Debian/Ubuntu/Kubuntu specific installation.
+#
+#  21 March 2008 -- Kern Sibbald
+#
+#  for Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
+#
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ -m 754
+
+nothing:
+
+install: install-autostart
+
+install-autostart: install-autostart-fd install-autostart-sd install-autostart-dir
+
+install_logrotate:
+       @$(INSTALL_PROGRAM) ../../scripts/logrotate $(DESTDIR)/etc/logrotate.d/bacula
+       
+install-autostart-fd: uninstall-autostart-fd
+       @echo "Installing bacula-fd boot script ..."
+       @$(INSTALL_PROGRAM) bacula-fd $(DESTDIR)/etc/init.d/bacula-fd
+       @echo "Installing bacula-fd symlinks ..."
+       @if test x$(DESTDIR) = x ; then \
+          /usr/sbin/update-rc.d bacula-fd start 91 2 3 4 5 . stop 9 0 1 6 .; \
+       fi
+
+
+install-autostart-sd: uninstall-autostart-sd
+       @echo "Installing bacula-sd boot script ..."
+       @$(INSTALL_PROGRAM) bacula-sd $(DESTDIR)/etc/init.d/bacula-sd
+       @echo "Installing bacula-sd symlinks ..."
+       @if test "x$(DESTDIR)" = "x" ; then \
+          /usr/sbin/update-rc.d bacula-sd start 91 2 3 4 5 . stop 9 0 1 6 .; \
+       fi
+
+
+install-autostart-dir: uninstall-autostart-dir
+       @echo "Installing bacula-dir boot script ..."
+       @$(INSTALL_PROGRAM) bacula-dir $(DESTDIR)/etc/init.d/bacula-dir
+       @echo "Installing bacula-dir symlinks ..."
+       @if test "x$(DESTDIR)" = "x" ; then \
+          /usr/sbin/update-rc.d bacula-dir start 90 2 3 4 5 . stop 9 0 1 6 .; \
+       fi
+
+
+uninstall: uninstall-autostart
+
+uninstall-autostart: uninstall-autostart-fd uninstall-autostart-sd uninstall-autostart-dir
+
+uninstall-logrotate:
+       @rm -f $(DESTDIR)/etc/logrotate.d/bacula
+
+uninstall-autostart-fd:
+       @if test "x$(DESTDIR)" = "x" -a  -f /etc/init.d/bacula-fd; then \
+          /etc/init.d/bacula-fd stop; \
+          rm -f  $(DESTDIR)/etc/init.d/bacula-fd; \
+          /usr/sbin/update-rc.d bacula-fd remove; \
+       fi
+
+
+uninstall-autostart-sd:
+       @if test "x$(DESTDIR)" = "x" -a  -f /etc/init.d/bacula-sd; then \
+          /etc/init.d/bacula-sd stop; \
+          rm -f  $(DESTDIR)/etc/init.d/bacula-sd; \
+          /usr/sbin/update-rc.d bacula-sd remove; \
+       fi
+
+uninstall-autostart-dir:
+       @if test "x$(DESTDIR)" = "x" -a  -f /etc/init.d/bacula-dir; then \
+          /etc/init.d/bacula-dir stop; \
+          rm -f  $(DESTDIR)/etc/init.d/bacula-dir; \
+          /usr/sbin/update-rc.d bacula-dir remove; \
+       fi
+       @rm -f  $(DESTDIR)/etc/init.d/bacula-dir
+
+clean:
+       @rm -f 1 2 3
+
+distclean: clean
+       @rm -f Makefile
+       @rm -f bacula-sd bacula-fd bacula-dir
+
+devclean: clean
+       @rm -f Makefile
+       @rm -f bacula-sd bacula-fd bacula-dir
diff --git a/bacula/platforms/debian/bacula-dir.in b/bacula/platforms/debian/bacula-dir.in
new file mode 100644 (file)
index 0000000..19a342d
--- /dev/null
@@ -0,0 +1,58 @@
+#! /bin/sh
+#
+# bacula  This shell script takes care of starting and stopping
+#        the bacula Director daemon on Debian/Ubuntu/Kubuntu 
+#        systems. 
+#
+#   Kern E. Sibbald - 21 March 2008
+#
+#  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
+#
+
+NAME="bacula-dir"
+DESC="Bacula Director"
+DAEMON=@sbindir@/${NAME}
+BUSER=@dir_user@
+BGROUP=@dir_group@
+BOPTIONS="-c @sysconfdir@/${NAME}.conf"
+BPORT=@dir_port@
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+test -f $DAEMON || exit 0
+
+if [ -n "`getent services ${NAME}`" ]; then
+   BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
+fi
+
+PIDFILE=@piddir@/${NAME}.${BPORT}.pid
+
+if [ "x${BUSER}" != "x" ]; then
+   BOPTIONS="${BOPTIONS} -u ${BUSER}"
+fi
+if [ "x${BGROUP}" != "x" ]; then
+   BOPTIONS="${BOPTIONS} -g ${BGROUP}"
+fi
+
+case "$1" in
+   start)
+      echo -n "Starting ${DESC}: "
+      start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS}
+      echo "${NAME}"
+      ;;
+   stop)
+      echo -n "Stopping ${DESC}: "
+      start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS}
+      echo "${NAME}"
+      ;;
+   restart|force-reload)
+      $0 stop
+      sleep 5
+      $0 start
+      ;;
+   *)
+      echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
+      exit 1
+      ;;
+esac
+exit 0
diff --git a/bacula/platforms/debian/bacula-director b/bacula/platforms/debian/bacula-director
deleted file mode 100644 (file)
index 4d40a11..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#! /bin/sh
-# bacula-director     SysV init script for Bacula-FD.
-#
-#       Written by Miquel van Smoorenburg <miquels@cistron.nl>.
-#       Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
-#       Customized for Bacula by Jose Luis Tallon <jltallon@adv-solutions.net>
-#    Modified RJM 2-12-03 to fix errors with pidfile name
-#
-PATH=/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/usr/sbin/bacula-dir
-NAME="bacula-dir"
-PORT=9101
-DESC="Bacula Director"
-ARGS="-c /etc/bacula/bacula-dir.conf -u bacula -g bacula"
-
-test -f $DAEMON || exit 0
-
-set -e
-
-if [ -n "`getent services bacula-dir`" ]; then
-        PORT=`getent services bacula-dir | awk '{ gsub("/tcp","",$2); print $2; }'`
-fi
-PIDFILE=/var/run/bacula/$NAME.$PORT.pid
-
-case "$1" in
-  start)
-       if [ -f /etc/bacula/do_not_run ]; then
-               echo "Not starting $DESC: disabled via /etc/bacula/do_not_run"
-               exit 0
-       fi
-
-       echo -n "Starting $DESC: "
-       start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $ARGS
-       echo "$NAME."
-       ;;
-
-  stop)
-       echo -n "Stopping $DESC: "
-       start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE --exec $DAEMON
-       echo "$NAME."
-       ;;
-
-  restart|force-reload)
-       echo -n "Restarting $DESC: "
-       start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
-       sleep 1
-       start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $ARGS
-       echo "$NAME."
-       ;;
-  *)
-       N=/etc/init.d/$NAME
-       # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
-       echo "Usage: $N {start|stop|restart|force-reload}" >&2
-       exit 1
-       ;;
-esac
-
-exit 0
diff --git a/bacula/platforms/debian/bacula-fd.in b/bacula/platforms/debian/bacula-fd.in
new file mode 100644 (file)
index 0000000..a0bc014
--- /dev/null
@@ -0,0 +1,58 @@
+#! /bin/sh
+#
+# bacula  This shell script takes care of starting and stopping
+#        the bacula Director daemon on Debian/Ubuntu/Kubuntu 
+#        systems. 
+#
+#   Kern E. Sibbald - 21 March 2008
+#
+#  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
+#
+
+NAME="bacula-fd"
+DESC="Bacula File Daemon"
+DAEMON=@sbindir@/${NAME}
+BUSER=@fd_user@
+BGROUP=@fd_group@
+BOPTIONS="-c @sysconfdir@/${NAME}.conf"
+BPORT=@fd_port@
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+test -f $DAEMON || exit 0
+
+if [ -n "`getent services ${NAME}`" ]; then
+   BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
+fi
+
+PIDFILE=@piddir@/${NAME}.${BPORT}.pid
+
+if [ "x${BUSER}" != "x" ]; then
+   BOPTIONS="${BOPTIONS} -u ${BUSER}"
+fi
+if [ "x${BGROUP}" != "x" ]; then
+   BOPTIONS="${BOPTIONS} -g ${BGROUP}"
+fi
+
+case "$1" in
+   start)
+      echo -n "Starting ${DESC}: "
+      start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS}
+      echo "${NAME}"
+      ;;
+   stop)
+      echo -n "Stopping ${DESC}: "
+      start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS}
+      echo "${NAME}"
+      ;;
+   restart|force-reload)
+      $0 stop
+      sleep 5
+      $0 start
+      ;;
+   *)
+      echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
+      exit 1
+      ;;
+esac
+exit 0
diff --git a/bacula/platforms/debian/bacula-sd.in b/bacula/platforms/debian/bacula-sd.in
new file mode 100644 (file)
index 0000000..6b68ce1
--- /dev/null
@@ -0,0 +1,58 @@
+#! /bin/sh
+#
+# bacula  This shell script takes care of starting and stopping
+#        the bacula Director daemon on Debian/Ubuntu/Kubuntu 
+#        systems. 
+#
+#   Kern E. Sibbald - 21 March 2008
+#
+#  For Bacula release @VERSION@ (@DATE@) -- @DISTNAME@
+#
+
+NAME="bacula-sd"
+DESC="Bacula Storage Daemon"
+DAEMON=@sbindir@/${NAME}
+BUSER=@sd_user@
+BGROUP=@sd_group@
+BOPTIONS="-c @sysconfdir@/${NAME}.conf"
+BPORT=@sd_port@
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+test -f $DAEMON || exit 0
+
+if [ -n "`getent services ${NAME}`" ]; then
+   BPORT=`getent services ${NAME} | awk '{ gsub("/tcp","",$2); print $2; }'`
+fi
+
+PIDFILE=@piddir@/${NAME}.${BPORT}.pid
+
+if [ "x${BUSER}" != "x" ]; then
+   BOPTIONS="${BOPTIONS} -u ${BUSER}"
+fi
+if [ "x${BGROUP}" != "x" ]; then
+   BOPTIONS="${BOPTIONS} -g ${BGROUP}"
+fi
+
+case "$1" in
+   start)
+      echo -n "Starting ${DESC}: "
+      start-stop-daemon --start --quiet --pidfile ${PIDFILE} --exec ${DAEMON} -- ${BOPTIONS}
+      echo "${NAME}"
+      ;;
+   stop)
+      echo -n "Stopping ${DESC}: "
+      start-stop-daemon --oknodo --stop --quiet --exec ${DAEMON} -- ${BOPTIONS}
+      echo "${NAME}"
+      ;;
+   restart|force-reload)
+      $0 stop
+      sleep 5
+      $0 start
+      ;;
+   *)
+      echo "Usage: /etc/init.d/${NAME} {start|stop|restart|force-reload}" >&2
+      exit 1
+      ;;
+esac
+exit 0
index ac00b840aada5e0b4dcda8489485388154b1f308..c007947ba051a3acc9f5fa9a96b99e42c237e436 100644 (file)
@@ -1274,6 +1274,28 @@ Item 1: Backup and Restore of Windows Encrypted Files through raw encryption fun
 
               Run = pool=Monthly last Day of the Month at 23:50
 
+   Date: 20 March 2008
+
+   Origin: Frank Sweetser <fs@wpi.edu>
+
+   What: Add a new SD directive, "minimum spool size" (or similar).  This
+         directive would specify a minimum level of free space available for
+         spooling.  If the unused spool space is less than this level, any new
+         spooling requests would be blocked as if the "maximum spool size"
+         threshold had bee reached.  Already spooling jobs would be unaffected
+         by this directive.
+
+   Why: I've been bitten by this scenario a couple of times:
+
+        Assume a maximum spool size of 100M. Two concurrent jobs, A and B, are
+        both running.  Due to timing quirks and previously running jobs, job A
+        has used 99.9M of space in the spool directory.  While A is busy
+        despooling to disk, B is happily using the remaining 0.1M of spool
+        space.  This ends up in a spool/despool sequence every 0.1M of data.
+        In addition to fragmenting the data on the volume far more than was
+        necessary, in larger data sets (ie, tens or hundreds of gigabytes) it
+        can easily produce multi-megabyte report emails!
+
 ========== Already implemented ================================
 
 Item  n:  make changing "spooldata=yes|no" possible for
index 83e0fdecb22190fcf8bbb7a8d3a23b417bbd6953..fca523cf051728bfa13b8331fc7e9771dda25912 100644 (file)
@@ -67,7 +67,7 @@ BEGIN
             VALUE "FileDescription", "Bacula File daemon for Win32\0"
             VALUE "FileVersion", VERSION "\0"
             VALUE "InternalName", "Bacula\0"
-            VALUE "LegalCopyright", "Copyright Free Software Foundation Europe e.V., 1999-2007\0"
+            VALUE "LegalCopyright", "Copyright Free Software Foundation Europe e.V., 1999-2008\0"
             VALUE "LegalTrademarks", "Licensed under GNU GPL 2.0\0"
             VALUE "OriginalFilename", "bacula-fd.exe\0"
             VALUE "PrivateBuild", "\0"
@@ -118,7 +118,7 @@ BEGIN
     LTEXT           "      by Kern Sibbald",-1,134,38,78,10
     LTEXT           "For more information, see:",-1,115,60,100,10
     LTEXT           "         www.bacula.org",-1,115,70,100,10
-    LTEXT           "Copyright (C) 1999-2007, Free Software Foundation Europe e.V.",-1,7,120,175,10
+    LTEXT           "Copyright (C) 1999-2008, Free Software Foundation Europe e.V.",-1,7,120,175,10
     LTEXT           "Licensed under GNU GPL 2.0.",-1,7,130,175,10
     RTEXT           "Build Date:",-1,108,24,42,8
     RTEXT           "Bacula Version:",-1,100,9,50,8
index 23e9be30c7bec0e1c4f408a319a3230e3e70dce4..d16744522f9dffb7fa14f49dc74e7837ece160aa 100644 (file)
@@ -23,6 +23,7 @@ Add long term statistic job table
 
 General:
 21Mar08
+kes  Implement autostart scripts for Debian.
 ebl  Implement upgrade catalog scripts.
 20Mar08
 ebl  Apply jobstat patch for long term statistics. Have to implement