]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fixup --prefix also changes config file default paths.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 15 Feb 2008 14:13:09 +0000 (14:13 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 15 Feb 2008 14:13:09 +0000 (14:13 +0000)
git-svn-id: file:///svn/unbound/trunk@958 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
doc/Changelog
util/config_file.c

index e4b7ff8a0a8203e29d6e254c0febc13b16a64546..382299d6e00c7e0b1672d23cce886989b6e4076e 100644 (file)
@@ -1,5 +1,8 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Directory to chroot to */
+#undef CHROOT_DIR
+
 /* Pathname to the Unbound configuration file */
 #undef CONFIGFILE
 
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* Pathname to unbound process id file */
+#undef PIDFILE
+
 /* Define to necessary symbol if this constant uses a non-standard name on
    your system. */
 #undef PTHREAD_CREATE_JOINABLE
 /* Define as the return type of signal handlers (`int' or `void'). */
 #undef RETSIGTYPE
 
+/* Directory to chdir to */
+#undef RUN_DIR
+
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
index 1a273e8b9cbab2c134c53fe8841d7acc1d601ded..f2e5500ab532a1891b46692b1da586a8b6537d94 100755 (executable)
--- a/configure
+++ b/configure
@@ -3292,6 +3292,25 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+# Determine run, chroot directory and pidfile locations
+ub_cfg=`eval echo $ub_conf_file`
+ub_dir=`dirname $ub_cfg`
+
+cat >>confdefs.h <<_ACEOF
+#define RUN_DIR "$ub_dir"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define CHROOT_DIR "$ub_dir"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PIDFILE "$ub_dir/unbound.pid"
+_ACEOF
+
+
 
 
 # if the given code compiles without the flag, execute argument 4
@@ -5731,7 +5750,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5734 "configure"' > conftest.$ac_ext
+  echo '#line 5753 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7033,11 +7052,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:7036: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7055: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7040: \$? = $ac_status" >&5
+   echo "$as_me:7059: \$? = $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.
@@ -7301,11 +7320,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:7304: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7323: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7308: \$? = $ac_status" >&5
+   echo "$as_me:7327: \$? = $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.
@@ -7405,11 +7424,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:7408: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7427: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7412: \$? = $ac_status" >&5
+   echo "$as_me:7431: \$? = $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
@@ -8870,7 +8889,7 @@ linux*)
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 8873 "configure"' > conftest.$ac_ext
+    echo '#line 8892 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -9734,7 +9753,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9737 "configure"
+#line 9756 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9834,7 +9853,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9837 "configure"
+#line 9856 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12170,11 +12189,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:12173: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12192: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:12177: \$? = $ac_status" >&5
+   echo "$as_me:12196: \$? = $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.
@@ -12274,11 +12293,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:12277: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12296: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12281: \$? = $ac_status" >&5
+   echo "$as_me:12300: \$? = $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
@@ -12810,7 +12829,7 @@ linux*)
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 12813 "configure"' > conftest.$ac_ext
+    echo '#line 12832 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -13865,11 +13884,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:13868: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13887: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13872: \$? = $ac_status" >&5
+   echo "$as_me:13891: \$? = $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.
@@ -13969,11 +13988,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:13972: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13991: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13976: \$? = $ac_status" >&5
+   echo "$as_me:13995: \$? = $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
@@ -15414,7 +15433,7 @@ linux*)
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 15417 "configure"' > conftest.$ac_ext
+    echo '#line 15436 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -16188,11 +16207,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:16191: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16210: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16195: \$? = $ac_status" >&5
+   echo "$as_me:16214: \$? = $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.
@@ -16456,11 +16475,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:16459: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16478: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16463: \$? = $ac_status" >&5
+   echo "$as_me:16482: \$? = $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.
@@ -16560,11 +16579,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:16563: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16582: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16567: \$? = $ac_status" >&5
+   echo "$as_me:16586: \$? = $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
@@ -18025,7 +18044,7 @@ linux*)
   libsuff=
   case "$host_cpu" in
   x86_64*|s390x*|powerpc64*)
-    echo '#line 18028 "configure"' > conftest.$ac_ext
+    echo '#line 18047 "configure"' > conftest.$ac_ext
     if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
index 242e6ea66742b86b01d70dc2cfc043749952b44c..1c375b3aa6c1bb34d15ca61174457eb61d169edc 100644 (file)
@@ -36,6 +36,13 @@ AC_SUBST(ub_conf_file)
 # for $nsd_conf_file and once for the ${prefix} within it.
 AC_DEFINE_UNQUOTED(CONFIGFILE, ["`eval echo $ub_conf_file`"], [Pathname to the Unbound configuration file])
 
+# Determine run, chroot directory and pidfile locations
+ub_cfg=`eval echo $ub_conf_file`
+ub_dir=`dirname $ub_cfg`
+AC_DEFINE_UNQUOTED(RUN_DIR, ["$ub_dir"], [Directory to chdir to])
+AC_DEFINE_UNQUOTED(CHROOT_DIR, ["$ub_dir"], [Directory to chroot to])
+AC_DEFINE_UNQUOTED(PIDFILE, ["$ub_dir/unbound.pid"], [Pathname to unbound process id file])
+
 dnl routine to help check for compiler flags.
 AC_DEFUN([CHECK_COMPILER_FLAG],
 [
index 5bf00a14cea15af1a479529b8d1fccbee77f4c92..f588c955ac2e9e81100a91c09de4c4964095b850 100644 (file)
@@ -1,5 +1,7 @@
 15 February 2008: Wouter
        - added FreeBSD rc.d script to contrib.
+       - --prefix option for configure also changes directory: pidfile:
+         and chroot: defaults in config file.
 
 14 February 2008: Wouter
        - start without a config file (will complain, but start with
index 7262ce4992af88c8305cb3bb8b0afbb12bb63a00..fad6742c623ab9b47cba5f811c73f7aebcdfc4d8 100644 (file)
@@ -96,11 +96,10 @@ config_create()
        cfg->infra_cache_numhosts = 10000;
        cfg->infra_cache_lame_size = 10240; /* easily 40 or more entries */
        if(!(cfg->username = strdup("unbound"))) goto error_exit;
-       if(!(cfg->chrootdir = strdup("/etc/unbound"))) goto error_exit;
-       if(!(cfg->directory = strdup("/etc/unbound"))) goto error_exit;
+       if(!(cfg->chrootdir = strdup(CHROOT_DIR))) goto error_exit;
+       if(!(cfg->directory = strdup(RUN_DIR))) goto error_exit;
        if(!(cfg->logfile = strdup(""))) goto error_exit;
-       if(!(cfg->pidfile = strdup("/etc/unbound/unbound.pid"))) 
-               goto error_exit;
+       if(!(cfg->pidfile = strdup(PIDFILE))) goto error_exit;
        if(!(cfg->target_fetch_policy = strdup("3 2 1 0 0"))) goto error_exit;
        cfg->donotqueryaddrs = NULL;
        cfg->donotquery_localhost = 1;