]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
configure confusion; try to use $sysconfdir, etc now
authorwessels <>
Tue, 9 Apr 1996 05:25:17 +0000 (05:25 +0000)
committerwessels <>
Tue, 9 Apr 1996 05:25:17 +0000 (05:25 +0000)
configure
configure.in
src/Makefile.in
src/cache_cf.cc
src/ftp.cc
src/main.cc
src/store.cc

index b8d45c758f729c6249c07d3f052564ff3eab7096..7314f7b78b93b3f52705f29f6aff360b1bde1dee 100755 (executable)
--- a/configure
+++ b/configure
@@ -446,7 +446,7 @@ echo > confdefs.h
 
 # A filename unique to this package, relative to the directory that
 # configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=include/config.h
+ac_unique_file=src/main.c
 
 # Find the source files, if location was not specified.
 if test -z "$srcdir"; then
@@ -517,7 +517,7 @@ fi
 
 
 
-# From configure.in Revision: 1.12 
+# From configure.in Revision: 1.13 
 ac_aux_dir=
 for ac_dir in aux $srcdir/aux; do
   if test -f $ac_dir/install-sh; then
@@ -569,7 +569,7 @@ echo "$ac_t""$host" 1>&6
 if test -n "$prefix"; then
   myprefix="$prefix";
 else
-  myprefix='/usr/local/squid';
+  myprefix="$ac_default_prefix"
 fi
 
 INSTALL_TOPDIR="$myprefix";
@@ -577,10 +577,27 @@ INSTALL_LIBDIR="$myprefix/lib";
 INSTALL_BINDIR="$myprefix/bin";
 INSTALL_MANDIR="$myprefix/man";
 
+eval "sysconfdirval=$sysconfdir"
+eval "bindirval=$bindir"
+
 THIS_HOST="`hostname`"
 XTRA_CFLAGS=''
 CRYPT_LIB=''
 
+if test -z "$CACHE_HTTP_PORT"; then
+       CACHE_HTTP_PORT="3128"
+fi
+if test -z "$CACHE_ICP_PORT"; then
+       CACHE_ICP_PORT="3130"
+fi
+if test -z "$CACHE_FTP_PORT"; then
+       CACHE_FTP_PORT="3132"
+fi
+
+
+
+
+
 
 
 
@@ -694,7 +711,7 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 698 "configure"
+#line 715 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
@@ -708,7 +725,7 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 712 "configure"
+#line 729 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
@@ -1008,7 +1025,7 @@ if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1012 "configure"
+#line 1029 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -1048,7 +1065,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1052 "configure"
+#line 1069 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1083,7 +1100,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1087 "configure"
+#line 1104 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1120,7 +1137,7 @@ else
   ac_cv_c_cross=yes
 else
 cat > conftest.$ac_ext <<EOF
-#line 1124 "configure"
+#line 1141 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
@@ -1142,7 +1159,7 @@ if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1146 "configure"
+#line 1163 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1164,7 +1181,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1168 "configure"
+#line 1185 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1182,7 +1199,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1186 "configure"
+#line 1203 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1203,7 +1220,7 @@ if test "$cross_compiling" = yes; then
   :
 else
 cat > conftest.$ac_ext <<EOF
-#line 1207 "configure"
+#line 1224 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1261,7 +1278,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1265 "configure"
+#line 1282 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
@@ -1291,7 +1308,7 @@ done
 
 
 cat > conftest.$ac_ext <<EOF
-#line 1295 "configure"
+#line 1312 "configure"
 #include "confdefs.h"
 #include <malloc.h>
 EOF
@@ -1314,7 +1331,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
 cat > conftest.$ac_ext <<EOF
-#line 1318 "configure"
+#line 1335 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1348,7 +1365,7 @@ else
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
 cat > conftest.$ac_ext <<EOF
-#line 1352 "configure"
+#line 1369 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1382,7 +1399,7 @@ if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1386 "configure"
+#line 1403 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() { return 0; }
@@ -1414,7 +1431,7 @@ if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1418 "configure"
+#line 1435 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -1473,7 +1490,7 @@ if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1477 "configure"
+#line 1494 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -1502,7 +1519,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1506 "configure"
+#line 1523 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1556,7 +1573,7 @@ else
   ac_cv_c_stack_direction=0
 else
 cat > conftest.$ac_ext <<EOF
-#line 1560 "configure"
+#line 1577 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -1601,7 +1618,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1605 "configure"
+#line 1622 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1641,7 +1658,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmalloc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1645 "configure"
+#line 1662 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1675,7 +1692,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1679 "configure"
+#line 1696 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1715,7 +1732,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1719 "configure"
+#line 1736 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1755,7 +1772,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lbsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1759 "configure"
+#line 1776 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1796,7 +1813,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-l44bsd  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1800 "configure"
+#line 1817 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1830,7 +1847,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1834 "configure"
+#line 1851 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1865,7 +1882,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcrypt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1869 "configure"
+#line 1886 "configure"
 #include "confdefs.h"
 
 int main() { return 0; }
@@ -1927,7 +1944,7 @@ if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1931 "configure"
+#line 1948 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2110,11 +2127,12 @@ ac_given_INSTALL="$INSTALL"
 trap 'rm -fr `echo "\
        ./makefile \
        ./lib/Makefile \
-       ./src/Makefile \
-       ./include/paths.h \
+       ./include/config.h \
        ./scripts/Makefile \
        ./scripts/RunCache \
        ./scripts/RunAccel \
+       ./src/Makefile \
+       ./src/cached.conf \
  include/autoconf.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
@@ -2156,7 +2174,11 @@ s%@INSTALL_BINDIR@%$INSTALL_BINDIR%g
 s%@INSTALL_MANDIR@%$INSTALL_MANDIR%g
 s%@XTRA_CFLAGS@%$XTRA_CFLAGS%g
 s%@THIS_HOST@%$THIS_HOST%g
-s%@SOCKET_PH_TYPE@%$SOCKET_PH_TYPE%g
+s%@CACHE_HTTP_PORT@%$CACHE_HTTP_PORT%g
+s%@CACHE_ICP_PORT@%$CACHE_ICP_PORT%g
+s%@CACHE_FTP_PORT@%$CACHE_FTP_PORT%g
+s%@sysconfdirval@%$sysconfdirval%g
+s%@bindirval@%$bindirval%g
 s%@CC@%$CC%g
 s%@CPP@%$CPP%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
@@ -2183,11 +2205,12 @@ cat >> $CONFIG_STATUS <<EOF
 CONFIG_FILES=\${CONFIG_FILES-"\
        ./makefile \
        ./lib/Makefile \
-       ./src/Makefile \
-       ./include/paths.h \
+       ./include/config.h \
        ./scripts/Makefile \
        ./scripts/RunCache \
        ./scripts/RunAccel \
+       ./src/Makefile \
+       ./src/cached.conf \
 "}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
index 37737f14846fb164017d025eb9a377c41313c6e1..9fb2fe37b3e536d4bce8b607e55abf4464a4508b 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.7)
 dnl
-dnl  $Id: configure.in,v 1.13 1996/03/28 02:32:49 wessels Exp $
+dnl  $Id: configure.in,v 1.14 1996/04/08 23:25:18 wessels Exp $
 dnl
 dnl
 dnl
-AC_INIT(include/config.h)
+AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.13 $)dnl
+AC_REVISION($Revision: 1.14 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(aux)
 
@@ -20,7 +20,7 @@ dnl Build a copy of prefix
 if test -n "$prefix"; then
   myprefix="$prefix";
 else
-  myprefix='/usr/local/squid';
+  myprefix="$ac_default_prefix"
 fi
 
 INSTALL_TOPDIR="$myprefix";
@@ -28,10 +28,23 @@ INSTALL_LIBDIR="$myprefix/lib";
 INSTALL_BINDIR="$myprefix/bin";
 INSTALL_MANDIR="$myprefix/man";
 
+eval "sysconfdirval=$sysconfdir"
+eval "bindirval=$bindir"
+
 THIS_HOST="`hostname`"
 XTRA_CFLAGS=''
 CRYPT_LIB=''
 
+if test -z "$CACHE_HTTP_PORT"; then
+       CACHE_HTTP_PORT="3128"
+fi
+if test -z "$CACHE_ICP_PORT"; then
+       CACHE_ICP_PORT="3130"
+fi
+if test -z "$CACHE_FTP_PORT"; then
+       CACHE_FTP_PORT="3132"
+fi
+
 dnl Subsitutions
 AC_SUBST(INSTALL_TOPDIR)
 AC_SUBST(INSTALL_LIBDIR)
@@ -40,7 +53,11 @@ AC_SUBST(INSTALL_MANDIR)
 AC_SUBST(DEFS)
 AC_SUBST(XTRA_CFLAGS)
 AC_SUBST(THIS_HOST)
-AC_SUBST(SOCKET_PH_TYPE)
+AC_SUBST(CACHE_HTTP_PORT)
+AC_SUBST(CACHE_ICP_PORT)
+AC_SUBST(CACHE_FTP_PORT)
+AC_SUBST(sysconfdirval)
+AC_SUBST(bindirval)
 
 dnl Check for GNU cc
 AC_PROG_CC
@@ -215,9 +232,10 @@ rm -f core
 AC_OUTPUT(\
        ./makefile \
        ./lib/Makefile \
-       ./src/Makefile \
-       ./include/paths.h \
+       ./include/config.h \
        ./scripts/Makefile \
        ./scripts/RunCache \
        ./scripts/RunAccel \
+       ./src/Makefile \
+       ./src/cached.conf \
 )
index a27b3c6cac4d95d1e271dbcec199e0e775c55cac..7f70edfb6cb3613f1f467f8f09ef3fce7bf5a1ed 100644 (file)
@@ -1,21 +1,19 @@
 #
 #  Makefile for the Harvest Object Cache server
 #
-#  $Id: Makefile.in,v 1.11 1996/04/08 18:28:53 wessels Exp $
+#  $Id: Makefile.in,v 1.12 1996/04/08 23:25:19 wessels Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
 LOG_OPT                = # -DNO_LOGGGING
-PORT_OPT       = # -DCACHE_HTTP_PORT=3128 -DCACHE_ICP_PORT=3130
 HOST_OPT       = # -DCACHEMGR_HOSTNAME="getfullhostname()"
-DEFINES                = $(LOG_OPT) $(PORT_OPT) $(HOST_OPT)
+DEFINES                = $(LOG_OPT) $(HOST_OPT)
 
-prefix = @prefix@
-top_srcdir = @top_srcdir@
-INSTALL_BINDIR = $(prefix)/bin
-INSTALL_LIBDIR = $(prefix)/lib
-INSTALL_MANDIR         = $(prefix)/man
-INSTALL_CGIDIR  = $(prefix)/cgi-bin
+prefix         = @prefix@
+exec_prefix    = @exec_prefix@
+top_srcdir     = @top_srcdir@
+bindir         = @bindir@
+sysconfdir     = @sysconfdir@
 
 CC             = @CC@
 INSTALL                = @INSTALL@
@@ -41,8 +39,6 @@ SHELL         = /bin/sh
 #CC            = cc
 #XTRA_CFLAGS   = -D_HARVEST_HPUX_ -d_AIX -D_ALL_SOURCE
 #
-# In addition, add -DBUGGY_AIX_SOCKETS if you suspect your sockets
-# implementation is broken.
 
 ## LINUX users might need to use these values
 #
@@ -66,11 +62,22 @@ OBJS                = blocklist.o cache_cf.o cached_error.o comm.o \
                store.o storetoString.o tools.o ttl.o \
                url.o wais.o $(XTRA_OBJS)
 
+DEFAULTS        = \
+       -DDEFAULT_CONFIG_FILE=\"$(sysconfdir)/cached.conf\" \
+       -DDEFAULT_FTPGET=\"$(bindir)/ftpget\" \
+       -DDEFAULT_DNSSERVER=\"$(bindir)/dnsserver\" \
+       -DDEFAULT_CACHE_LOG=\"$(prefix)/logs/cache.log\" \
+       -DDEFAULT_ACCESS_LOG=\"$(prefix)/logs/access.log\" \
+       -DDEFAULT_HIERARCHY_LOG=\"$(prefix)/logs/hierarchy.log\"
+
 all:   $(PROGS) $(UTILS) $(CGIPROGS)
 
 cached:        $(OBJS)
        $(CC) -o $@ $(LDFLAGS) $(OBJS) $(CRYPT_LIB) $(LIBS)
 
+cache_cf.o: cache_cf.c
+       $(CC) -c cache_cf.c $(CFLAGS) $(DEFAULTS)
+
 client:        client.o
        $(CC) -o $@ $(LDFLAGS) $@.o $(CLIENT_LIBS)
 
@@ -83,31 +90,47 @@ cachemgr.cgi:       cachemgr.o
 ftpget: ftpget.o
        $(CC) -o $@ $(LDFLAGS) ftpget.o $(LIBS)
 
-install: all
+install-mkdirs:
        @if test ! -d $(prefix); then \
                echo "mkdir $(prefix)"; \
                mkdir $(prefix); \
        fi
-       @if test ! -d $(INSTALL_BINDIR); then \
-               echo "mkdir $(INSTALL_BINDIR)"; \
-               mkdir $(INSTALL_BINDIR); \
+       @if test ! -d $(exec_prefix); then \
+               echo "mkdir $(exec_prefix)"; \
+               mkdir $(exec_prefix); \
+       fi
+       @if test ! -d $(bindir); then \
+               echo "mkdir $(bindir)"; \
+               mkdir $(bindir); \
+       fi
+       @if test ! -d $(confdir); then \
+               echo "mkdir $(confdir)"; \
+               mkdir $(confdir); \
        fi
+       @if test ! -d $(exec_prefix)/logs; then \
+               echo "mkdir $(exec_prefix)/logs"; \
+               mkdir $(exec_prefix)/logs; \
+       fi
+
+install: all install-mkdirs
        @for f in $(PROGS); do \
-               echo $(INSTALL_BIN) $$f $(INSTALL_BINDIR); \
-               $(INSTALL_BIN) $$f $(INSTALL_BINDIR); \
+               echo $(INSTALL_BIN) $$f $(bindir); \
+               $(INSTALL_BIN) $$f $(bindir); \
        done
        @for f in $(UTILS); do \
-               echo $(INSTALL_BIN) $$f $(INSTALL_BINDIR); \
-               $(INSTALL_BIN) $$f $(INSTALL_BINDIR); \
+               echo $(INSTALL_BIN) $$f $(bindir); \
+               $(INSTALL_BIN) $$f $(bindir); \
        done
-       @if test ! -d $(INSTALL_CGIDIR); then \
-               echo "mkdir $(INSTALL_CGIDIR)"; \
-               mkdir $(INSTALL_CGIDIR); \
-       fi
        @for f in $(CGIPROGS); do \
-               echo $(INSTALL_BIN) $$f $(INSTALL_CGIDIR); \
-               $(INSTALL_BIN) $$f $(INSTALL_CGIDIR); \
+               echo $(INSTALL_BIN) $$f $(bindir); \
+               $(INSTALL_BIN) $$f $(bindir); \
        done
+       @if test -f $(confdir)/cached.conf ; then \
+               echo "$@ will not overwrite existing $(confdir)/cached.conf" ; \
+       else \
+               echo "$(INSTALL_FILE) cached.conf $(confdir)"; \
+               $(INSTALL_FILE) cached.conf $(confdir); \
+       fi
 
 clean: 
        -rm -rf *.o *pure_* core $(PROGS) $(UTILS) $(CGIPROGS)
index 347ea1f9478f95c0e56fc1c7cfdda62f9f2433ab..9c55c4cfd2c624cfb66ca419008c0a7a49e7c2b4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: cache_cf.cc,v 1.24 1996/04/08 18:39:21 wessels Exp $ */
+/* $Id: cache_cf.cc,v 1.25 1996/04/08 23:25:20 wessels Exp $ */
 
 /* DEBUG: Section 3             cache_cf: Configuration file parsing */
 
@@ -101,14 +101,14 @@ static struct {
 #define DefaultAsciiPortNum    CACHE_HTTP_PORT
 #define DefaultUdpPortNum      CACHE_ICP_PORT
 
-#define DefaultCacheLogFile    "cache.log"
-#define DefaultAccessLogFile   "cache.access.log"
-#define DefaultHierarchyLogFile "cache.hierarchy.log"
+#define DefaultCacheLogFile    DEFAULT_CACHE_LOG
+#define DefaultAccessLogFile   DEFAULT_ACCESS_LOG
+#define DefaultHierarchyLogFile DEFAULT_HIERARCHY_LOG
 #define DefaultLogRotateNumber  10
 #define DefaultAdminEmail      "webmaster"
-#define DefaultFtpgetProgram   "ftpget"
+#define DefaultFtpgetProgram   DEFAULT_FTPGET
 #define DefaultFtpgetOptions   ""
-#define DefaultDnsserverProgram "dnsserver"
+#define DefaultDnsserverProgram DEFAULT_DNSSERVER
 #define DefaultEffectiveUser   (char *)NULL    /* default NONE */
 #define DefaultEffectiveGroup  (char *)NULL    /* default NONE */
 #define DefaultAppendDomain    (char *)NULL    /* default NONE */
@@ -1487,7 +1487,6 @@ int parseConfigFile(file_name)
        printf("         For this run, however, cached will use %d minutes for clean_rate.\n", (int) (getCleanRate() / 60));
        fflush(stdout);         /* print message */
     }
-    storeSanityCheck();
 
     if (accel_ip_acl == NULL)
        accel_ip_acl = proxy_ip_acl;
index 732433f63295fb90d54570fb408ca5a5650ce825..3b7893ae48ea9b3b2c8524578301232a796179bc 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ftp.cc,v 1.23 1996/04/08 18:28:56 wessels Exp $ */
+/* $Id: ftp.cc,v 1.24 1996/04/08 23:25:21 wessels Exp $ */
 
 /*
  * DEBUG: Section 9           ftp: FTP
@@ -378,7 +378,7 @@ void ftpConnInProgress(fd, data)
 
     debug(9, 5, "ftpConnInProgress: FD %d\n", fd);
 
-    if (comm_connect(fd, "localhost", 3131) != COMM_OK)
+    if (comm_connect(fd, "localhost", CACHE_FTP_PORT) != COMM_OK)
        switch (errno) {
        case EINPROGRESS:
        case EALREADY:
@@ -435,7 +435,7 @@ int ftpStart(unusedfd, url, entry)
     /* Pipe/socket created ok */
 
     /* Now connect ... */
-    if ((status = comm_connect(data->ftp_fd, "localhost", 3131))) {
+    if ((status = comm_connect(data->ftp_fd, "localhost", CACHE_FTP_PORT))) {
        if (status != EINPROGRESS) {
            cached_error_entry(entry, ERR_CONNECT_FAIL, xstrerror());
            ftpCloseAndFree(data->ftp_fd, data);
@@ -502,8 +502,8 @@ int ftpInitialize()
     /* inherit stdin,stdout,stderr */
     for (fd = 3; fd < fdstat_biggest_fd(); fd++)
        (void) close(fd);
-    sprintf(pbuf, "%d", 3131);
-    execlp(ftpget, ftpget, "-D26,1", "-S", pbuf, NULL);
+    sprintf(pbuf, "%d", CACHE_FTP_PORT);
+    execlp(ftpget, ftpget, "-S", pbuf, NULL);
     debug(9, 0, "ftpInitialize: %s: %s\n", ftpget, xstrerror());
     _exit(1);
     return (1);                        /* eliminate compiler warning */
index 6d19b19ee23ff2a4501076d84491260be33f26a3..fca9e1fa6c426962dc627ea62681ec98b5543af5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: main.cc,v 1.22 1996/04/08 19:32:39 wessels Exp $ */
+/* $Id: main.cc,v 1.23 1996/04/08 23:25:21 wessels Exp $ */
 
 /* DEBUG: Section 1             main: startup and main loop */
 
@@ -207,8 +207,8 @@ static void mainInitialize()
     if (theUdpConnection >= 0 && (!httpd_accel_mode || getAccelWithProxy()))
        neighbors_open(theUdpConnection);
 
-    if (!first_time) {
-
+    if (first_time) {
+       first_time = 0;
        /* module initialization */
        disk_init();
        stat_init(&CacheInfo, getAccessLogFile());
@@ -228,7 +228,6 @@ int main(argc, argv)
      char **argv;
 {
     int errcount = 0;
-    char *s = NULL;
     int n;                     /* # of GC'd objects */
     time_t last_maintain = 0;
 
@@ -267,14 +266,9 @@ int main(argc, argv)
     fd_note(1, "STDOUT");
     fd_note(2, "STDERR");
 
-    if (config_file == NULL) {
-       if ((s = getenv("HARVEST_HOME")) != NULL) {
-           config_file = (char *) xcalloc(1, strlen(s) + 64);
-           sprintf(config_file, "%s/lib/cached.conf", s);
-       } else {
-           config_file = xstrdup("/usr/local/harvest/lib/cached.conf");
-       }
-    }
+    if (config_file == NULL)
+       config_file = xstrdup(DEFAULT_CONFIG_FILE);
+
     /* enable syslog by default */
     syslog_enable = 0;
 
index 1c7b413debf227d479b09f45c02d3534ab7f823d..da12c9d5abb74b854e0dbc063b21a2d5fd9cb5e7 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $Id: store.cc,v 1.32 1996/04/05 17:48:32 wessels Exp $ */
+/* $Id: store.cc,v 1.33 1996/04/08 23:25:22 wessels Exp $ */
 
 /*
  * DEBUG: Section 20          store
@@ -2360,12 +2360,14 @@ int storeInit()
 {
     int dir_created;
 
+    storeSanityCheck();
     file_map_create(MAX_SWAP_FILE);
     dir_created = storeVerifySwapDirs(zap_disk_store);
     storeCreateHashTable(urlcmp);
 
     sprintf(swaplog_file, "%s/log", swappath(0));
 
+
     if (!zap_disk_store) {
        ok_write_clean_log = 0;
        storeRebuildFromDisk();
@@ -2436,7 +2438,7 @@ void storeSanityCheck()
            if (errno != ENOENT)
                continue;
            debug(20, 0, "WARNING: Cannot write to '%s' for storage swap area.\n", name);
-           debug(20, 0, "Forcing a *full restart* (e.g., cached -z)...");
+           debug(20, 0, "Forcing a *full restart* (e.g., cached -z)...\n");
            zap_disk_store = 1;
            return;
        }