From: Kern Sibbald Date: Thu, 14 May 2009 11:06:41 +0000 (+0000) Subject: Allow specification of base daemon resource name. X-Git-Tag: Release-3.0.2~239 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c597b31127c8383e5bbab2aada79d49186cf688b;p=bacula%2Fbacula Allow specification of base daemon resource name. --with-basename= git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8826 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 5bd4835879..a1260c803e 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -1195,6 +1195,22 @@ AC_ARG_WITH(archivedir, AC_SUBST(archivedir) +dnl ------------------------------------------------------------------ +dnl Allow the user to specify the daemon resource name default hostname +dnl ------------------------------------------------------------------ +basename=`hostname` +AC_ARG_WITH(basename, + AC_HELP_STRING([--with-basename=RESNAME], [specify base resource name for daemons]), + [ + if test "x$withval" != "xno" ; then + basename=$withval + fi + ] +) + +AC_SUBST(basename) + + dnl ------------------------------------------ dnl Where to place scriptdir (script files) dnl ------------------------------------------ diff --git a/bacula/configure b/bacula/configure index 43f9bc50a2..ebdd49d0f1 100755 --- a/bacula/configure +++ b/bacula/configure @@ -985,6 +985,7 @@ OPENSSL_LIBS OPENSSL_INC working_dir archivedir +basename scriptdir bsrdir logdir @@ -1696,6 +1697,7 @@ Optional Packages: --with-openssl[=DIR] Include OpenSSL support. DIR is the OpenSSL base --with-working-dir=PATH specify path of Bacula working directory --with-archivedir=PATH specify path of SD archive directory + --with-basename=RESNAME specify base resource name for daemons --with-scriptdir=PATH specify path of Bacula scripts directory --with-bsrdir=PATH specify path of Bacula bsrs directory --with-logdir=PATH specify path of Bacula logs directory @@ -5992,13 +5994,13 @@ if test "${lt_cv_nm_interface+set}" = set; then else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:5995: $ac_compile\"" >&5) + (eval echo "\"\$as_me:5997: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:5998: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:6000: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:6001: output\"" >&5) + (eval echo "\"\$as_me:6003: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -7219,7 +7221,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7222 "configure"' > conftest.$ac_ext + echo '#line 7224 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -9434,11 +9436,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9437: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9439: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9441: \$? = $ac_status" >&5 + echo "$as_me:9443: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9773,11 +9775,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9776: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9778: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9780: \$? = $ac_status" >&5 + echo "$as_me:9782: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9878,11 +9880,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9881: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9883: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9885: \$? = $ac_status" >&5 + echo "$as_me:9887: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9933,11 +9935,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9936: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9938: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9940: \$? = $ac_status" >&5 + echo "$as_me:9942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -12689,7 +12691,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12692 "configure" +#line 12694 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12785,7 +12787,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12788 "configure" +#line 12790 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14797,11 +14799,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14800: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14802: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14804: \$? = $ac_status" >&5 + echo "$as_me:14806: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14896,11 +14898,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14899: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14901: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14903: \$? = $ac_status" >&5 + echo "$as_me:14905: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14948,11 +14950,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14951: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14953: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14955: \$? = $ac_status" >&5 + echo "$as_me:14957: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -27351,6 +27353,22 @@ fi +basename=`hostname` + +# Check whether --with-basename was given. +if test "${with_basename+set}" = set; then + withval=$with_basename; + if test "x$withval" != "xno" ; then + basename=$withval + fi + + +fi + + + + + scriptdir=`eval echo ${sysconfdir}` # Check whether --with-scriptdir was given. @@ -44222,6 +44240,7 @@ OPENSSL_LIBS!$OPENSSL_LIBS$ac_delim OPENSSL_INC!$OPENSSL_INC$ac_delim working_dir!$working_dir$ac_delim archivedir!$archivedir$ac_delim +basename!$basename$ac_delim scriptdir!$scriptdir$ac_delim bsrdir!$bsrdir$ac_delim logdir!$logdir$ac_delim @@ -44287,7 +44306,7 @@ DISTVER!$DISTVER$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -44306,7 +44325,7 @@ fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g @@ -44319,8 +44338,6 @@ N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g CEOF$ac_eof _ACEOF @@ -44568,7 +44585,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" >$tmp/out +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" | sed 's/|#_!!_#|//g' >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && diff --git a/bacula/src/console/bconsole.conf.in b/bacula/src/console/bconsole.conf.in index 010797b8c0..08016a171b 100644 --- a/bacula/src/console/bconsole.conf.in +++ b/bacula/src/console/bconsole.conf.in @@ -3,7 +3,7 @@ # Director { - Name = @hostname@-dir + Name = @basename@-dir DIRport = @dir_port@ address = @hostname@ Password = "@dir_password@" diff --git a/bacula/src/dird/bacula-dir.conf.in b/bacula/src/dird/bacula-dir.conf.in index c39275d5d0..b0d30e06cb 100644 --- a/bacula/src/dird/bacula-dir.conf.in +++ b/bacula/src/dird/bacula-dir.conf.in @@ -13,7 +13,7 @@ # Director { # define myself - Name = @hostname@-dir + Name = @basename@-dir DIRport = @dir_port@ # where we listen for UA connections QueryFile = "@scriptdir@/query.sql" WorkingDirectory = "@working_dir@" @@ -27,7 +27,7 @@ JobDefs { Name = "DefaultJob" Type = Backup Level = Incremental - Client = @hostname@-fd + Client = @basename@-fd FileSet = "Full Set" Schedule = "WeeklyCycle" Storage = File @@ -48,7 +48,7 @@ Job { #Job { # Name = "Client2" -# Client = @hostname@2-fd +# Client = @basename@2-fd # JobDefs = "DefaultJob" # Write Bootstrap = "@working_dir@/Client2.bsr" #} @@ -79,7 +79,7 @@ Job { Job { Name = "RestoreFiles" Type = Restore - Client=@hostname@-fd + Client=@basename@-fd FileSet="Full Set" Storage = File Pool = Default @@ -154,7 +154,7 @@ FileSet { # Client (File Services) to backup Client { - Name = @hostname@-fd + Name = @basename@-fd Address = @hostname@ FDPort = @fd_port@ Catalog = MyCatalog @@ -169,7 +169,7 @@ Client { # You should change Name, Address, and Password before using # #Client { -# Name = @hostname@2-fd +# Name = @basename@2-fd # Address = @hostname@2 # FDPort = @fd_port@ # Catalog = MyCatalog @@ -298,7 +298,7 @@ Pool { # Restricted console used by tray-monitor to get the status of the director # Console { - Name = @hostname@-mon + Name = @basename@-mon Password = "@mon_dir_password@" CommandACL = status, .status } diff --git a/bacula/src/filed/bacula-fd.conf.in b/bacula/src/filed/bacula-fd.conf.in index 1ca546d4bb..36f1061b5d 100644 --- a/bacula/src/filed/bacula-fd.conf.in +++ b/bacula/src/filed/bacula-fd.conf.in @@ -11,7 +11,7 @@ # List Directors who are permitted to contact this File daemon # Director { - Name = @hostname@-dir + Name = @basename@-dir Password = "@fd_password@" } @@ -20,7 +20,7 @@ Director { # status of the file daemon # Director { - Name = @hostname@-mon + Name = @basename@-mon Password = "@mon_fd_password@" Monitor = yes } @@ -29,7 +29,7 @@ Director { # "Global" File daemon configuration specifications # FileDaemon { # this is me - Name = @hostname@-fd + Name = @basename@-fd FDport = @fd_port@ # where we listen for the director WorkingDirectory = @working_dir@ Pid Directory = @piddir@ @@ -39,5 +39,5 @@ FileDaemon { # this is me # Send all messages except skipped files back to Director Messages { Name = Standard - director = @hostname@-dir = all, !skipped, !restored + director = @basename@-dir = all, !skipped, !restored } diff --git a/bacula/src/gnome2-console/bgnome-console.conf.in b/bacula/src/gnome2-console/bgnome-console.conf.in index 9c3731d433..0061638d66 100644 --- a/bacula/src/gnome2-console/bgnome-console.conf.in +++ b/bacula/src/gnome2-console/bgnome-console.conf.in @@ -3,7 +3,7 @@ # Director { - Name = @hostname@-dir + Name = @basename@-dir DIRport = @dir_port@ address = @hostname@ Password = "@dir_password@" diff --git a/bacula/src/qt-console/bat.conf.in b/bacula/src/qt-console/bat.conf.in index fcce04e3d4..a70e9617bc 100644 --- a/bacula/src/qt-console/bat.conf.in +++ b/bacula/src/qt-console/bat.conf.in @@ -3,7 +3,7 @@ # Director { - Name = @hostname@-dir + Name = @basename@-dir DIRport = @dir_port@ address = @hostname@ Password = "@dir_password@" diff --git a/bacula/src/stored/bacula-sd.conf.in b/bacula/src/stored/bacula-sd.conf.in index 4c0ad8b598..576f488ccb 100644 --- a/bacula/src/stored/bacula-sd.conf.in +++ b/bacula/src/stored/bacula-sd.conf.in @@ -11,7 +11,7 @@ # Storage { # definition of myself - Name = @hostname@-sd + Name = @basename@-sd SDPort = @sd_port@ # Director's port WorkingDirectory = "@working_dir@" Pid Directory = "@piddir@" @@ -22,7 +22,7 @@ Storage { # definition of myself # List Directors who are permitted to contact Storage daemon # Director { - Name = @hostname@-dir + Name = @basename@-dir Password = "@sd_password@" } @@ -31,7 +31,7 @@ Director { # status of the storage daemon # Director { - Name = @hostname@-mon + Name = @basename@-mon Password = "@mon_sd_password@" Monitor = yes } @@ -225,5 +225,5 @@ Device { # Messages { Name = Standard - director = @hostname@-dir = all + director = @basename@-dir = all } diff --git a/bacula/src/tray-monitor/tray-monitor.conf.in b/bacula/src/tray-monitor/tray-monitor.conf.in index 2e5870348d..71ece8d614 100644 --- a/bacula/src/tray-monitor/tray-monitor.conf.in +++ b/bacula/src/tray-monitor/tray-monitor.conf.in @@ -3,27 +3,27 @@ # Monitor { - Name = @hostname@-mon + Name = @basename@-mon Password = "@mon_dir_password@" # password for the Directors RefreshInterval = 5 seconds } Client { - Name = @hostname@-fd + Name = @basename@-fd Address = @hostname@ FDPort = @fd_port@ Password = "@mon_fd_password@" # password for FileDaemon } Storage { - Name = @hostname@-sd + Name = @basename@-sd Address = @hostname@ SDPort = @sd_port@ Password = "@mon_sd_password@" # password for StorageDaemon } Director { - Name = @hostname@-dir + Name = @basename@-dir DIRport = @dir_port@ address = @hostname@ -} \ No newline at end of file +} diff --git a/bacula/src/wx-console/bwx-console.conf.in b/bacula/src/wx-console/bwx-console.conf.in index 010797b8c0..08016a171b 100644 --- a/bacula/src/wx-console/bwx-console.conf.in +++ b/bacula/src/wx-console/bwx-console.conf.in @@ -3,7 +3,7 @@ # Director { - Name = @hostname@-dir + Name = @basename@-dir DIRport = @dir_port@ address = @hostname@ Password = "@dir_password@" diff --git a/bacula/technotes b/bacula/technotes index 831819481d..0c8b08f5cd 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,6 +3,8 @@ General: 14May09 +kes Allow specification of base daemon resource name. + --with-basename= kes Fix bat to automatically use installed bat.conf kes bat was not installed even if configured. Fix by working around apparent bug in qmake.