[-]
[+]
|
Added |
bacula.spec
|
|
[-]
[+]
|
Added |
001-check-python26.diff
^
|
@@ -0,0 +1,73 @@
+--- bacula-2.4.3/configure.ori 2008-12-21 22:03:04.000000000 +0100
++++ bacula-2.4.3/configure 2008-12-21 22:20:11.000000000 +0100
+@@ -15620,37 +15620,45 @@
+ PYTHON_LIBS=
+ if test "$withval" != "no"; then
+ if test "$withval" = "yes"; then
+- for python_root in /usr /usr/local /usr/sfw; do
+- for ver in python2.2 python2.3 python2.4 python2.5; do
+- if test -f $python_root/include/${ver}/Python.h; then
+- PYTHON_INCDIR=-I$python_root/include/${ver}
+- if test -d $python_root/lib64/${ver}/config; then
+- PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
+- else
+- PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
+- fi
+- break
+- fi
++ if [ -a /usr/bin/python-config ] ; then
++ PYTHON_INCDIR=`python-config --includes`
++ PYTHON_LIBS=`python-config --libs`
++ else
++ for python_root in /usr /usr/local /usr/sfw; do
++ for ver in python2.2 python2.3 python2.4 python2.5; do
++ if test -f $python_root/include/${ver}/Python.h; then
++ PYTHON_INCDIR=-I$python_root/include/${ver}
++ if test -d $python_root/lib64/${ver}/config; then
++ PYTHON_LIBS="-L$python_root/lib64/${ver}/config -l${ver}"
++ else
++ PYTHON_LIBS="-L$python_root/lib/${ver}/config -l${ver}"
++ fi
++ break
++ fi
++ done
+ done
+- done
+- if test x$PYTHON_INCDIR = x; then
+- if test -f $prefix/include/Python.h; then
+- PYTHON_INCDIR=-I$prefix/include
+- if test -d $prefix/lib64/config; then
+- PYTHON_LIBS="-L$prefix/lib64/config -lpython"
+- else
+- PYTHON_LIBS="-L$prefix/lib/config -lpython"
+- fi
+- else
+- { echo "$as_me:$LINENO: result: no" >&5
++ if test x$PYTHON_INCDIR = x; then
++ if test -f $prefix/include/Python.h; then
++ PYTHON_INCDIR=-I$prefix/include
++ if test -d $prefix/lib64/config; then
++ PYTHON_LIBS="-L$prefix/lib64/config -lpython"
++ else
++ PYTHON_LIBS="-L$prefix/lib/config -lpython"
++ fi
++ else
++ { echo "$as_me:$LINENO: result: no" >&5
+ echo "${ECHO_T}no" >&6; }
+- { { echo "$as_me:$LINENO: error: Unable to find Python.h in standard locations" >&5
++ { { echo "$as_me:$LINENO: error: Unable to find Python.h in standard locations" >&5
+ echo "$as_me: error: Unable to find Python.h in standard locations" >&2;}
+- { (exit 1); exit 1; }; }
++ { (exit 1); exit 1; }; }
++ fi
+ fi
+ fi
+ else
+- if test -f $withval/Python.h; then
++ if test -x $withval/bin/python-config ; then
++ PYTHON_INCDIR=`python-config --includes`
++ PYTHON_LIBS=`python-config --libs`
++ elif test -f $withval/Python.h; then
+ PYTHON_INCDIR=-I$withval
+ PYTHON_LIBS="-L$withval/config -lpython"
+ elif test -f $withval/include/Python.h; then
|
[-]
[+]
|
Added |
2.4.3-cancel-after-network-outage.patch
^
|
@@ -0,0 +1,135 @@
+
+ This patch fixes a problem when canceling job if client looses
+ connection while being backed up
+ Apply the patch to version 2.4.3 (and previous versions) with:
+
+ cd <bacula-source>
+ patch -p0 <2.4.3-cancel-after-network-outage.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+Index: src/dird/backup.c
+===================================================================
+--- src/dird/backup.c (révision 7772)
++++ src/dird/backup.c (copie de travail)
+@@ -240,14 +240,16 @@
+ }
+ return false;
+
+-/* Come here only after starting SD thread */
++/* Come here only after starting SD thread
++ * and we don't expect any EndJob message because the
++ * the client don't have recieve the "backup" command.
++ */
+ bail_out:
+ set_jcr_job_status(jcr, JS_ErrorTerminated);
+- Dmsg1(400, "wait for sd. use=%d\n", jcr->use_count());
+- /* Cancel SD */
+- cancel_storage_daemon_job(jcr);
+- wait_for_storage_daemon_termination(jcr);
+- Dmsg1(400, "after wait for sd. use=%d\n", jcr->use_count());
++ Dmsg1(400, "wait for sd and fd. use=%d\n", jcr->use_count());
++ /* Get status from SD and FD */
++ wait_for_job_termination(jcr, false /* don't expect EndJob message*/);
++ Dmsg1(400, "after wait for sd and fd. use=%d\n", jcr->use_count());
+ return false;
+ }
+
+@@ -258,7 +260,7 @@
+ * are done, we return the job status.
+ * Also used by restore.c
+ */
+-int wait_for_job_termination(JCR *jcr)
++int wait_for_job_termination(JCR *jcr, bool expect_EndJob)
+ {
+ int32_t n = 0;
+ BSOCK *fd = jcr->file_bsock;
+@@ -270,30 +272,51 @@
+ int Encrypt = 0;
+
+ set_jcr_job_status(jcr, JS_Running);
+- /* Wait for Client to terminate */
+- while ((n = bget_dirmsg(fd)) >= 0) {
+- if (!fd_ok &&
+- (sscanf(fd->msg, EndJob, &jcr->FDJobStatus, &JobFiles,
+- &ReadBytes, &JobBytes, &Errors, &VSS, &Encrypt) == 7 ||
+- sscanf(fd->msg, OldEndJob, &jcr->FDJobStatus, &JobFiles,
+- &ReadBytes, &JobBytes, &Errors) == 5)) {
+- fd_ok = true;
+- set_jcr_job_status(jcr, jcr->FDJobStatus);
+- Dmsg1(100, "FDStatus=%c\n", (char)jcr->JobStatus);
+- } else {
+- Jmsg(jcr, M_WARNING, 0, _("Unexpected Client Job message: %s\n"),
+- fd->msg);
++
++
++ if (fd) {
++ /* Wait for Client to terminate
++ * In some conditions, the client isn't able to send
++ * any messages and we should not wait for ages
++ */
++ int OK=true;
++ int ret;
++ while (OK && expect_EndJob) {
++
++ /* Even if the job is canceled, we let a chance to FD to
++ * send EndJob message
++ */
++ if (job_canceled(jcr)) {
++ OK=false;
++ }
++
++ /* wait for data few minutes */
++ ret = fd->wait_data_intr(3*60, 0);
++ if (ret == 1) { /* get data */
++ n = bget_dirmsg(fd);
++ if (n >= 0 &&
++ (sscanf(fd->msg, EndJob, &jcr->FDJobStatus, &JobFiles,
++ &ReadBytes, &JobBytes, &Errors, &VSS, &Encrypt) == 7 ||
++ sscanf(fd->msg, OldEndJob, &jcr->FDJobStatus, &JobFiles,
++ &ReadBytes, &JobBytes, &Errors) == 5)) {
++ fd_ok = true;
++ set_jcr_job_status(jcr, jcr->FDJobStatus);
++ OK=false; /* end of loop */
++ } else {
++ Jmsg(jcr, M_WARNING, 0, _("Unexpected Client Job message: %s\n"),
++ fd->msg);
++ }
++ } /* else get timeout or network error */
++
++ if (is_bnet_error(fd)) {
++ Jmsg(jcr, M_FATAL, 0, _("Network error with FD during %s: ERR=%s\n"),
++ job_type_to_str(jcr->JobType), fd->bstrerror());
++ OK=false;
++ }
+ }
+- if (job_canceled(jcr)) {
+- break;
+- }
+- }
+
+- if (is_bnet_error(fd)) {
+- Jmsg(jcr, M_FATAL, 0, _("Network error with FD during %s: ERR=%s\n"),
+- job_type_to_str(jcr->JobType), fd->bstrerror());
++ fd->signal(BNET_TERMINATE); /* tell Client we are terminating */
+ }
+- fd->signal(BNET_TERMINATE); /* tell Client we are terminating */
+
+ /* Force cancel in SD if failing */
+ if (job_canceled(jcr) || !fd_ok) {
+Index: src/dird/protos.h
+===================================================================
+--- src/dird/protos.h (révision 7772)
++++ src/dird/protos.h (copie de travail)
+@@ -52,7 +52,7 @@
+ extern bool find_recycled_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr);
+
+ /* backup.c */
+-extern int wait_for_job_termination(JCR *jcr);
++extern int wait_for_job_termination(JCR *jcr, bool expect_EndJob=true);
+ extern bool do_backup_init(JCR *jcr);
+ extern bool do_backup(JCR *jcr);
+ extern void backup_cleanup(JCR *jcr, int TermCode);
|
[-]
[+]
|
Added |
2.4.3-orphaned-jobs.patch
^
|
@@ -0,0 +1,24 @@
+
+ This patch fixes a case of orphaned jobs (and possible deadlock)
+ during pruning.
+ Apply it to Bacula 2.4.3 (possibly earlier versions) with:
+
+ cd <bacula-source>
+ patch -p0 <2.4.3-orphaned-jobs.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+Index: src/dird/ua_prune.c
+===================================================================
+--- src/dird/ua_prune.c (revision 7949)
++++ src/dird/ua_prune.c (working copy)
+@@ -468,6 +468,7 @@
+ break;
+ }
+ }
++ endeach_jcr(jcr);
+ if (skip) {
+ continue;
+ }
|
[-]
[+]
|
Added |
2.4.3-prune-deadlock.patch
^
|
@@ -0,0 +1,56 @@
+
+ This patch corrects a deadlock that can occure when using the catalog
+ as message backend and the director decides to prune volumes.
+
+ Apply it to Bacula 2.4.3 (possibly earlier versions)
+ with:
+
+ cd <bacula-source>
+ patch -p0 <2.4.3-prune-deadlock.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+Index: src/lib/jcr.c
+===================================================================
+--- src/lib/jcr.c (révision 8063)
++++ src/lib/jcr.c (copie de travail)
+@@ -438,7 +438,6 @@
+
+ #endif
+
+- dequeue_messages(jcr);
+ lock_jcr_chain();
+ jcr->dec_use_count(); /* decrement use count */
+ if (jcr->use_count() < 0) {
+@@ -455,6 +454,7 @@
+ remove_jcr(jcr); /* remove Jcr from chain */
+ unlock_jcr_chain();
+
++ dequeue_messages(jcr);
+ job_end_pop(jcr); /* pop and call hooked routines */
+
+ Dmsg1(3400, "End job=%d\n", jcr->JobId);
+Index: src/dird/ua_prune.c
+===================================================================
+--- src/dird/ua_prune.c (révision 8100)
++++ src/dird/ua_prune.c (copie de travail)
+@@ -435,8 +435,6 @@
+ return 0; /* cannot prune Archived volumes */
+ }
+
+- db_lock(ua->db);
+-
+ /*
+ * Now add to the list of JobIds for Jobs written to this Volume
+ */
+@@ -477,6 +475,5 @@
+ }
+
+ bail_out:
+- db_unlock(ua->db);
+ return count;
+ }
+
|
[-]
[+]
|
Added |
2.4.3-update-slots.patch
^
|
@@ -0,0 +1,79 @@
+
+ This patch corrects a problem when removing a volume from
+ an autochanger and the slot is still empty when running
+ update slots command. #1175
+
+ Apply it to version 2.4.3 with:
+
+ cd <bacula-source>
+ patch -p0 <2.4.3-update-slots.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+Index: src/cats/sql_update.c
+===================================================================
+--- src/cats/sql_update.c (revision 7854)
++++ src/cats/sql_update.c (working copy)
+@@ -445,14 +445,28 @@
+ db_make_inchanger_unique(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr)
+ {
+ char ed1[50], ed2[50];
+- if (mr->InChanger != 0 && mr->Slot != 0 && mr->StorageId != 0 &&
+- mr->MediaId != 0) {
+- Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE "
+- "Slot=%d AND StorageId=%s AND MediaId!=%s",
+- mr->Slot,
+- edit_int64(mr->StorageId, ed1), edit_int64(mr->MediaId, ed2));
+- Dmsg1(400, "%s\n", mdb->cmd);
+- UPDATE_DB(jcr, mdb, mdb->cmd);
++ if (mr->InChanger != 0 && mr->Slot != 0 && mr->StorageId != 0) {
++
++ if (mr->MediaId != 0) {
++ Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE "
++ "Slot=%d AND StorageId=%s AND MediaId!=%s",
++ mr->Slot,
++ edit_int64(mr->StorageId, ed1), edit_int64(mr->MediaId, ed2));
++
++ } else if (mr->VolumeName[0]) { /* We have a volume name */
++ Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE "
++ "Slot=%d AND StorageId=%s AND VolumeName!='%s'",
++ mr->Slot,
++ edit_int64(mr->StorageId, ed1), mr->VolumeName);
++
++ } else { /* used by ua_label to reset all volume with this slot */
++ Mmsg(mdb->cmd, "UPDATE Media SET InChanger=0 WHERE "
++ "Slot=%d AND StorageId=%s",
++ mr->Slot,
++ edit_int64(mr->StorageId, ed1), mr->VolumeName);
++ }
++ Dmsg1(100, "%s\n", mdb->cmd);
++ UPDATE_DB(jcr, mdb, mdb->cmd);
+ }
+ }
+
+Index: src/cats/sql_create.c
+===================================================================
+--- src/cats/sql_create.c (revision 7854)
++++ src/cats/sql_create.c (working copy)
+@@ -459,14 +459,13 @@
+ "WHERE MediaId=%d", dt, mr->MediaId);
+ stat = UPDATE_DB(jcr, mdb, mdb->cmd);
+ }
++ /*
++ * Make sure that if InChanger is non-zero any other identical slot
++ * has InChanger zero.
++ */
++ db_make_inchanger_unique(jcr, mdb, mr);
+ }
+
+- /*
+- * Make sure that if InChanger is non-zero any other identical slot
+- * has InChanger zero.
+- */
+- db_make_inchanger_unique(jcr, mdb, mr);
+-
+ db_unlock(mdb);
+ return stat;
+ }
|
[-]
[+]
|
Added |
2.4.3-win32-runscript-unicode-path.patch
^
|
@@ -0,0 +1,289 @@
+
+ This patch fix #1110 about a problem when executing a program with
+ Unicode path.
+
+ It can be applied to 2.4.3 (and previous versions) with:
+
+ cd <bacula-source>
+ patch -p0 <2.4.3-win32-runscript-unicode-path.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+Index: src/win32/compat/compat.cpp
+===================================================================
+--- src/win32/compat/compat.cpp (révision 7772)
++++ src/win32/compat/compat.cpp (copie de travail)
+@@ -1807,6 +1807,97 @@
+ }
+
+ /**
++ * Create the process with UTF8 API
++ */
++static BOOL
++CreateChildProcessW(const char *comspec, const char *cmdLine,
++ PROCESS_INFORMATION *hProcInfo,
++ HANDLE in, HANDLE out, HANDLE err)
++{
++ STARTUPINFOW siStartInfo;
++ BOOL bFuncRetn = FALSE;
++
++ // Set up members of the STARTUPINFO structure.
++ ZeroMemory( &siStartInfo, sizeof(siStartInfo) );
++ siStartInfo.cb = sizeof(siStartInfo);
++ // setup new process to use supplied handles for stdin,stdout,stderr
++
++ siStartInfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
++ siStartInfo.wShowWindow = SW_SHOWMINNOACTIVE;
++
++ siStartInfo.hStdInput = in;
++ siStartInfo.hStdOutput = out;
++ siStartInfo.hStdError = err;
++
++ // Convert argument to WCHAR
++ POOLMEM *cmdLine_wchar = get_pool_memory(PM_FNAME);
++ POOLMEM *comspec_wchar = get_pool_memory(PM_FNAME);
++
++ UTF8_2_wchar(&cmdLine_wchar, cmdLine);
++ UTF8_2_wchar(&comspec_wchar, comspec);
++
++ // Create the child process.
++ Dmsg2(150, "Calling CreateProcess(%s, %s, ...)\n", comspec_wchar, cmdLine_wchar);
++
++ // try to execute program
++ bFuncRetn = p_CreateProcessW((WCHAR*)comspec_wchar,
++ (WCHAR*)cmdLine_wchar,// command line
++ NULL, // process security attributes
++ NULL, // primary thread security attributes
++ TRUE, // handles are inherited
++ 0, // creation flags
++ NULL, // use parent's environment
++ NULL, // use parent's current directory
++ &siStartInfo, // STARTUPINFO pointer
++ hProcInfo); // receives PROCESS_INFORMATION
++
++ free_pool_memory(cmdLine_wchar);
++ free_pool_memory(comspec_wchar);
++
++ return bFuncRetn;
++}
++
++
++/**
++ * Create the process with ANSI API
++ */
++static BOOL
++CreateChildProcessA(const char *comspec, char *cmdLine,
++ PROCESS_INFORMATION *hProcInfo,
++ HANDLE in, HANDLE out, HANDLE err)
++{
++ STARTUPINFOA siStartInfo;
++ BOOL bFuncRetn = FALSE;
++
++ // Set up members of the STARTUPINFO structure.
++ ZeroMemory( &siStartInfo, sizeof(siStartInfo) );
++ siStartInfo.cb = sizeof(siStartInfo);
++ // setup new process to use supplied handles for stdin,stdout,stderr
++ siStartInfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
++ siStartInfo.wShowWindow = SW_SHOWMINNOACTIVE;
++
++ siStartInfo.hStdInput = in;
++ siStartInfo.hStdOutput = out;
++ siStartInfo.hStdError = err;
++
++ // Create the child process.
++ Dmsg2(150, "Calling CreateProcess(%s, %s, ...)\n", comspec, cmdLine);
++
++ // try to execute program
++ bFuncRetn = p_CreateProcessA(comspec,
++ cmdLine, // command line
++ NULL, // process security attributes
++ NULL, // primary thread security attributes
++ TRUE, // handles are inherited
++ 0, // creation flags
++ NULL, // use parent's environment
++ NULL, // use parent's current directory
++ &siStartInfo,// STARTUPINFO pointer
++ hProcInfo);// receives PROCESS_INFORMATION
++ return bFuncRetn;
++}
++
++/**
+ * OK, so it would seem CreateProcess only handles true executables:
+ * .com or .exe files. So grab $COMSPEC value and pass command line to it.
+ */
+@@ -1815,44 +1906,30 @@
+ {
+ static const char *comspec = NULL;
+ PROCESS_INFORMATION piProcInfo;
+- STARTUPINFOA siStartInfo;
+ BOOL bFuncRetn = FALSE;
+
+- if (comspec == NULL) {
++ if (!p_CreateProcessA || !p_CreateProcessW)
++ return INVALID_HANDLE_VALUE;
++
++ if (comspec == NULL)
+ comspec = getenv("COMSPEC");
+- }
+ if (comspec == NULL) // should never happen
+ return INVALID_HANDLE_VALUE;
+
+ // Set up members of the PROCESS_INFORMATION structure.
+ ZeroMemory( &piProcInfo, sizeof(PROCESS_INFORMATION) );
+
+- // Set up members of the STARTUPINFO structure.
+-
+- ZeroMemory( &siStartInfo, sizeof(STARTUPINFO) );
+- siStartInfo.cb = sizeof(STARTUPINFO);
+- // setup new process to use supplied handles for stdin,stdout,stderr
+ // if supplied handles are not used the send a copy of our STD_HANDLE
+ // as appropriate
+- siStartInfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
+- siStartInfo.wShowWindow = SW_SHOWMINNOACTIVE;
++ if (in == INVALID_HANDLE_VALUE)
++ in = GetStdHandle(STD_INPUT_HANDLE);
+
+- if (in != INVALID_HANDLE_VALUE)
+- siStartInfo.hStdInput = in;
+- else
+- siStartInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
++ if (out == INVALID_HANDLE_VALUE)
++ out = GetStdHandle(STD_OUTPUT_HANDLE);
+
+- if (out != INVALID_HANDLE_VALUE)
+- siStartInfo.hStdOutput = out;
+- else
+- siStartInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+- if (err != INVALID_HANDLE_VALUE)
+- siStartInfo.hStdError = err;
+- else
+- siStartInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
++ if (err == INVALID_HANDLE_VALUE)
++ err = GetStdHandle(STD_ERROR_HANDLE);
+
+- // Create the child process.
+-
+ char *exeFile;
+ const char *argStart;
+
+@@ -1860,43 +1937,32 @@
+ return INVALID_HANDLE_VALUE;
+ }
+
+- int cmdLen = strlen(comspec) + 4 + strlen(exeFile) + strlen(argStart) + 1;
++ POOL_MEM cmdLine(PM_FNAME);
++ Mmsg(cmdLine, "%s /c %s%s", comspec, exeFile, argStart);
+
+- char *cmdLine = (char *)alloca(cmdLen);
+-
+- snprintf(cmdLine, cmdLen, "%s /c %s%s", comspec, exeFile, argStart);
+-
+ free(exeFile);
+
+- Dmsg2(150, "Calling CreateProcess(%s, %s, ...)\n", comspec, cmdLine);
++ if (p_CreateProcessW && p_MultiByteToWideChar) {
++ bFuncRetn = CreateChildProcessW(comspec, cmdLine.c_str(), &piProcInfo,
++ in, out, err);
++ } else {
++ bFuncRetn = CreateChildProcessA(comspec, cmdLine.c_str(), &piProcInfo,
++ in, out, err);
++ }
+
+- // try to execute program
+- bFuncRetn = CreateProcessA(comspec,
+- cmdLine, // command line
+- NULL, // process security attributes
+- NULL, // primary thread security attributes
|
|
Added |
bacula-2.4.3.tar.gz
^
|
[-]
[+]
|
Added |
bacula-dir.fw
^
|
@@ -0,0 +1,4 @@
+## Description: Bacula Director
+
+# space separated list of allowed TCP ports
+TCP="9101"
|
[-]
[+]
|
Added |
bacula-dir.init
^
|
@@ -0,0 +1,88 @@
+#! /bin/sh
+
+# Copyright (c) 2005 SUSE Linux AG, Nuernberg, Germany.
+# All rights reserved.
+
+### BEGIN INIT INFO
+# Provides: bacula-dir
+# Required-Start: $local_fs $remote_fs $network mysql
+# Required-Stop: $local_fs $remote_fs $network mysql
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: bacula director
+# Description: Bacula network backup system director daemon
+### END INIT INFO
+
+# Shell functions sourced from /etc/rc.status:
+# rc_check check and set local and overall rc status
+# rc_status check and set local and overall rc status
+# rc_status -v ditto but be verbose in local rc status
+# rc_status -v -r ditto and clear the local rc status
+# rc_failed set local and overall rc status to failed
+# rc_failed <num> set local and overall rc status to <num><num>
+# rc_reset clear local rc status (overall remains)
+# rc_exit exit appropriate to overall rc status
+
+. /etc/rc.status
+
+BACULA_FD_BIN=/usr/sbin/bacula-dir
+test -x $BACULA_FD_BIN || { echo "$BACULA_FD_BIN not installed";
+ if [ "$1" = "stop" ]; then exit 0;
+ else exit 5; fi; }
+
+
+case "$1" in
+ start)
+ echo -n "Starting the Bacula Director daemon"
+ startproc -q $BACULA_FD_BIN -c /etc/bacula/bacula-dir.conf
+
+ rc_status -v
+ ;;
+
+
+ stop)
+ echo -n "Shutting down the Bacula Director daemon"
+
+ killproc -TERM $BACULA_FD_BIN
+
+ rc_status -v
+ ;;
+ try-restart|condrestart)
+ if test "$1" = "condrestart"; then
+ echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+ fi
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset
+ fi
+ rc_status
+ ;;
+ restart)
+ $0 stop
+ $0 start
+
+ rc_status
+ ;;
+ force-reload)
+
+ $0 try-restart
+ rc_status
+ ;;
+ reload)
+ rc_failed 3
+ rc_status -v
+ ;;
+ status)
+ echo -n "Checking for service the Bacula Director daemon"
+ checkproc $BACULA_FD_BIN
+ rc_status -v
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
+ exit 1
+ ;;
+esac
+rc_exit
+
|
[-]
[+]
|
Added |
bacula-fd.fw
^
|
@@ -0,0 +1,4 @@
+## Description: Bacula File Daemon
+
+# space separated list of allowed TCP ports
+TCP="9102"
|
[-]
[+]
|
Added |
bacula-fd.init
^
|
@@ -0,0 +1,89 @@
+#! /bin/sh
+
+# Copyright (c) 2005 SUSE Linux AG, Nuernberg, Germany.
+# All rights reserved.
+
+
+### BEGIN INIT INFO
+# Provides: bacula-fd
+# Required-Start: $local_fs $remote_fs $network
+# Required-Stop: $local_fs $remote_fs $network
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: bacula file daemon
+# Description: Bacula network backup system file daemon
+### END INIT INFO
+
+# Shell functions sourced from /etc/rc.status:
+# rc_check check and set local and overall rc status
+# rc_status check and set local and overall rc status
+# rc_status -v ditto but be verbose in local rc status
+# rc_status -v -r ditto and clear the local rc status
+# rc_failed set local and overall rc status to failed
+# rc_failed <num> set local and overall rc status to <num><num>
+# rc_reset clear local rc status (overall remains)
+# rc_exit exit appropriate to overall rc status
+
+. /etc/rc.status
+
+BACULA_FD_BIN=/usr/sbin/bacula-fd
+test -x $BACULA_FD_BIN || { echo "$BACULA_FD_BIN not installed";
+ if [ "$1" = "stop" ]; then exit 0;
+ else exit 5; fi; }
+
+
+case "$1" in
+ start)
+ echo -n "Starting the Bacula File daemon"
+ startproc -q $BACULA_FD_BIN -c /etc/bacula/bacula-fd.conf
+
+ rc_status -v
+ ;;
+
+
+ stop)
+ echo -n "Shutting down the Bacula File daemon"
+
+ killproc -TERM $BACULA_FD_BIN
+
+ rc_status -v
+ ;;
+ try-restart|condrestart)
+ if test "$1" = "condrestart"; then
+ echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+ fi
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset
+ fi
+ rc_status
+ ;;
+ restart)
+ $0 stop
+ $0 start
+
+ rc_status
+ ;;
+ force-reload)
+
+ $0 try-restart
+ rc_status
+ ;;
+ reload)
+ rc_failed 3
+ rc_status -v
+ ;;
+ status)
+ echo -n "Checking for service the Bacula File daemon"
+ checkproc $BACULA_FD_BIN
+ rc_status -v
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
+ exit 1
+ ;;
+esac
+rc_exit
+
|
[-]
[+]
|
Added |
bacula-sd.fw
^
|
@@ -0,0 +1,4 @@
+## Description: Bacula Storage Daemon
+
+# space separated list of allowed TCP ports
+TCP="9103"
|
[-]
[+]
|
Added |
bacula-sd.init
^
|
@@ -0,0 +1,88 @@
+#! /bin/sh
+
+# Copyright (c) 2005 SUSE Linux AG, Nuernberg, Germany.
+# All rights reserved.
+
+### BEGIN INIT INFO
+# Provides: bacula-sd
+# Required-Start: $local_fs $remote_fs $network
+# Required-Stop: $local_fs $remote_fs $network
+# Default-Start: 3 5
+# Default-Stop: 0 1 2 6
+# Short-Description: bacula storage daemon
+# Description: Bacula network backup system storage daemon
+### END INIT INFO
+
+# Shell functions sourced from /etc/rc.status:
+# rc_check check and set local and overall rc status
+# rc_status check and set local and overall rc status
+# rc_status -v ditto but be verbose in local rc status
+# rc_status -v -r ditto and clear the local rc status
+# rc_failed set local and overall rc status to failed
+# rc_failed <num> set local and overall rc status to <num><num>
+# rc_reset clear local rc status (overall remains)
+# rc_exit exit appropriate to overall rc status
+
+. /etc/rc.status
+
+BACULA_SD_BIN=/usr/sbin/bacula-sd
+test -x $BACULA_SD_BIN || { echo "$BACULA_SD_BIN not installed";
+ if [ "$1" = "stop" ]; then exit 0;
+ else exit 5; fi; }
+
+
+case "$1" in
+ start)
+ echo -n "Starting the Bacula Storage daemon"
+ startproc -q $BACULA_SD_BIN -c /etc/bacula/bacula-sd.conf
+
+ rc_status -v
+ ;;
+
+
+ stop)
+ echo -n "Shutting down the Bacula Storage daemon"
+
+ killproc -TERM $BACULA_SD_BIN
+
+ rc_status -v
+ ;;
+ try-restart|condrestart)
+ if test "$1" = "condrestart"; then
+ echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
+ fi
+ $0 status
+ if test $? = 0; then
+ $0 restart
+ else
+ rc_reset
+ fi
+ rc_status
+ ;;
+ restart)
+ $0 stop
+ $0 start
+
+ rc_status
+ ;;
+ force-reload)
+
+ $0 try-restart
+ rc_status
+ ;;
+ reload)
+ rc_failed 3
+ rc_status -v
+ ;;
+ status)
+ echo -n "Checking for service the Bacula Storage daemon"
+ checkproc $BACULA_SD_BIN
+ rc_status -v
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
+ exit 1
+ ;;
+esac
+rc_exit
+
|