bacula.patch 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. Index: scripts/bacula.in
  2. --- scripts/bacula.in.orig 2005-07-04 21:57:31.000000000 +0200
  3. +++ scripts/bacula.in 2005-08-20 13:22:03.830778000 +0200
  4. @@ -21,11 +21,11 @@
  5. # easier to "steal" this code for the development
  6. # environment where they are different.
  7. #
  8. -BACFDBIN=@sbindir@
  9. +BACFDBIN=@scriptdir@
  10. BACFDCFG=@sysconfdir@
  11. -BACSDBIN=@sbindir@
  12. +BACSDBIN=@scriptdir@
  13. BACSDCFG=@sysconfdir@
  14. -BACDIRBIN=@sbindir@
  15. +BACDIRBIN=@scriptdir@
  16. BACDIRCFG=@sysconfdir@
  17. PIDDIR=@piddir@
  18. SUBSYSDIR=@subsysdir@
  19. @@ -203,9 +203,15 @@
  20. export LD_ASSUME_KERNEL=2.4.19
  21. fi
  22. -case "$1" in
  23. +action=$1
  24. +debug=$2
  25. +[ -n "$3" ] && enable_dir=$3 || enable_dir=yes
  26. +[ -n "$4" ] && enable_sd=$4 || enable_sd=yes
  27. +[ -n "$5" ] && enable_fd=$5 || enable_fd=yes
  28. +
  29. +case "$action" in
  30. start)
  31. - [ -x ${BACSDBIN}/bacula-sd ] && {
  32. + [ "$enable_sd" = "yes" ] && [ -x ${BACSDBIN}/bacula-sd ] && {
  33. echo "Starting the Bacula Storage daemon"
  34. OPTIONS=''
  35. if [ "${SD_USER}" != '' ]; then
  36. @@ -216,10 +222,10 @@
  37. OPTIONS="${OPTIONS} -g ${SD_GROUP}"
  38. fi
  39. - ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf
  40. + ${BACSDBIN}/bacula-sd $debug ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf
  41. }
  42. - [ -x ${BACFDBIN}/bacula-fd ] && {
  43. + [ "$enable_fd" = "yes" ] && [ -x ${BACFDBIN}/bacula-fd ] && {
  44. echo "Starting the Bacula File daemon"
  45. OPTIONS=''
  46. if [ "${FD_USER}" != '' ]; then
  47. @@ -230,10 +236,10 @@
  48. OPTIONS="${OPTIONS} -g ${FD_GROUP}"
  49. fi
  50. - ${BACFDBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf
  51. + ${BACFDBIN}/bacula-fd $debug ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf
  52. }
  53. - [ -x ${BACDIRBIN}/bacula-dir ] && {
  54. + [ "$enable_dir" = "yes" ] && [ -x ${BACDIRBIN}/bacula-dir ] && {
  55. sleep 2
  56. echo "Starting the Bacula Director daemon"
  57. OPTIONS=''
  58. @@ -245,23 +251,23 @@
  59. OPTIONS="${OPTIONS} -g ${DIR_GROUP}"
  60. fi
  61. - ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf
  62. + ${BACDIRBIN}/bacula-dir $debug ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf
  63. }
  64. ;;
  65. stop)
  66. # Stop the FD first so that SD will fail jobs and update catalog
  67. - [ -x ${BACFDBIN}/bacula-fd ] && {
  68. + [ "$enable_fd" = "yes" ] && [ -x ${BACFDBIN}/bacula-fd ] && {
  69. echo "Stopping the Bacula File daemon"
  70. killproc ${BACFDBIN}/bacula-fd ${FD_PORT}
  71. }
  72. - [ -x ${BACSDBIN}/bacula-sd ] && {
  73. + [ "$enable_sd" = "yes" ] && [ -x ${BACSDBIN}/bacula-sd ] && {
  74. echo "Stopping the Bacula Storage daemon"
  75. killproc ${BACSDBIN}/bacula-sd ${SD_PORT}
  76. }
  77. - [ -x ${BACDIRBIN}/bacula-dir ] && {
  78. + [ "$enable_dir" = "yes" ] && [ -x ${BACDIRBIN}/bacula-dir ] && {
  79. echo "Stopping the Bacula Director daemon"
  80. killproc ${BACDIRBIN}/bacula-dir ${DIR_PORT}
  81. }
  82. @@ -269,15 +275,15 @@
  83. ;;
  84. restart)
  85. - $0 stop
  86. + $0 stop $debug $enable_dir $enable_sd $enable_fd
  87. sleep 5
  88. - $0 start
  89. + $0 start $debug $enable_dir $enable_sd $enable_fd
  90. ;;
  91. status)
  92. - [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT}
  93. - [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT}
  94. - [ -x ${BACDIRBIN}/bacula-dir ] && status ${BACDIRBIN}/bacula-dir ${DIR_PORT}
  95. + [ "$enable_sd" = "yes" ] && [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT}
  96. + [ "$enable_fd" = "yes" ] && [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT}
  97. + [ "$enable_dir" = "yes" ] && [ -x ${BACDIRBIN}/bacula-dir ] && status ${BACDIRBIN}/bacula-dir ${DIR_PORT}
  98. ;;
  99. *)
  100. Index: scripts/btraceback.in
  101. --- scripts/btraceback.in.orig 2005-05-08 11:18:21.000000000 +0200
  102. +++ scripts/btraceback.in 2005-08-20 20:06:37.084652000 +0200
  103. @@ -11,6 +11,9 @@
  104. PNAME=`basename $1`
  105. if test `uname -s` = SunOS ; then
  106. gcore -o @working_dir@/${PNAME} $2
  107. +fi
  108. +if test `uname -s` = SunOS &&
  109. + test -n `which dbx 2>/dev/null` ; then
  110. dbx $1 $2 <@scriptdir@/btraceback.dbx 2>&1 \
  111. | @sbindir@/bsmtp -h @smtp_host@ -f @dump_email@ -s "Bacula DBX traceback of ${PNAME}" @dump_email@
  112. else
  113. Index: src/dird/bacula-dir.conf.in
  114. --- src/dird/bacula-dir.conf.in.orig 2005-07-04 21:57:32.000000000 +0200
  115. +++ src/dird/bacula-dir.conf.in 2005-08-24 08:09:43.569070000 +0200
  116. @@ -29,7 +29,8 @@
  117. Level = Incremental
  118. Client = @hostname@-fd
  119. FileSet = "Full Set"
  120. - Schedule = "WeeklyCycle"
  121. + #Schedule = "WeeklyCycle"
  122. + Schedule = "NEVER"
  123. Storage = File
  124. Messages = Standard
  125. Pool = Default
  126. @@ -105,7 +106,7 @@
  127. # directory to give a reasonable FileSet to backup to
  128. # disk storage during initial testing.
  129. #
  130. - File = @BUILD_DIR@
  131. + File = @scriptdir@
  132. }
  133. #
  134. @@ -120,6 +121,11 @@
  135. }
  136. }
  137. +# This schedule can be used to disable automatic scheduling
  138. +Schedule {
  139. + Name = NEVER
  140. +}
  141. +
  142. #
  143. # When to do the backups, full backup on first sunday of the month,
  144. # differential (i.e. incremental since full) every other sunday,