]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make pid_filename default
authorwessels <>
Tue, 19 Nov 1996 14:21:12 +0000 (14:21 +0000)
committerwessels <>
Tue, 19 Nov 1996 14:21:12 +0000 (14:21 +0000)
stack trace #ifdefs

src/Makefile.in
src/cache_cf.cc
src/tools.cc

index b8b7c5f133ebbbcb185e8188ea07a33f4d594f48..318df620716678df687cc62ff125be038f86e8e8 100644 (file)
@@ -1,7 +1,7 @@
 #
 #  Makefile for the Squid Object Cache server
 #
-#  $Id: Makefile.in,v 1.55 1996/11/12 22:36:59 wessels Exp $
+#  $Id: Makefile.in,v 1.56 1996/11/19 07:21:12 wessels Exp $
 #
 #  Uncomment and customize the following to suit your needs:
 #
@@ -32,6 +32,7 @@ DEFAULT_DNSSERVER       = $(libexecdir)/dnsserver
 DEFAULT_CACHE_LOG       = $(localstatedir)/logs/cache.log
 DEFAULT_ACCESS_LOG      = $(localstatedir)/logs/access.log
 DEFAULT_STORE_LOG       = $(localstatedir)/logs/store.log
+DEFAULT_PID_FILE        = $(localstatedir)/logs/squid.pid
 DEFAULT_SWAP_DIR        = $(localstatedir)/cache
 DEFAULT_PINGER         = $(libexecdir)/pinger
 
@@ -115,6 +116,7 @@ DEFAULTS        = \
        -DDEFAULT_CACHE_LOG=\"$(DEFAULT_CACHE_LOG)\" \
        -DDEFAULT_ACCESS_LOG=\"$(DEFAULT_ACCESS_LOG)\" \
        -DDEFAULT_STORE_LOG=\"$(DEFAULT_STORE_LOG)\" \
+       -DDEFAULT_PID_FILE=\"$(DEFAULT_PID_FILE)\" \
        -DDEFAULT_SWAP_DIR=\"$(DEFAULT_SWAP_DIR)\" \
        -DDEFAULT_PINGER=\"$(DEFAULT_PINGER)\"
 
@@ -151,6 +153,7 @@ squid.conf: squid.conf.pre Makefile
        s%@DEFAULT_CACHE_LOG@%$(DEFAULT_CACHE_LOG)%g;\
        s%@DEFAULT_ACCESS_LOG@%$(DEFAULT_ACCESS_LOG)%g;\
        s%@DEFAULT_STORE_LOG@%$(DEFAULT_STORE_LOG)%g;\
+       s%@DEFAULT_PID_FILE@%$(DEFAULT_PID_FILE)%g;\
        s%@DEFAULT_SWAP_DIR@%$(DEFAULT_SWAP_DIR)%g" < squid.conf.pre >$@
 
 install-mkdirs:
index 324c4cdbde5fc7cd99159768042c3694f1d6025c..185a5ff820174c2e54b58e209b9f60eb8fd346ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cache_cf.cc,v 1.141 1996/11/18 18:22:01 wessels Exp $
+ * $Id: cache_cf.cc,v 1.142 1996/11/19 07:21:13 wessels Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -174,7 +174,7 @@ struct SquidConfig Config;
 #define DefaultNeighborTimeout  2      /* 2 seconds */
 #define DefaultStallDelay      1       /* 1 seconds */
 #define DefaultSingleParentBypass 0    /* default off */
-#define DefaultPidFilename      (char *)NULL   /* default NONE */
+#define DefaultPidFilename      DEFAULT_PID_FILE
 #define DefaultVisibleHostname  (char *)NULL   /* default NONE */
 #define DefaultFtpUser         "squid@"        /* Default without domain */
 #define DefaultAnnounceHost    "sd.cache.nlanr.net"
index 78c3a47c76d36b83cf344bce0d2f8298b075b7ae..9987f293f5d4f7108e267ccc450a929e32d7d3d8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tools.cc,v 1.83 1996/11/14 18:38:51 wessels Exp $
+ * $Id: tools.cc,v 1.84 1996/11/19 07:21:15 wessels Exp $
  *
  * DEBUG: section 21    Misc Functions
  * AUTHOR: Harvest Derived
@@ -240,6 +240,27 @@ death(int sig)
        fprintf(debug_log, "FATAL: Received Bus Error...dying.\n");
     else
        fprintf(debug_log, "FATAL: Received signal %d...dying.\n", sig);
+
+#ifdef PRINT_STACK_TRACE
+#ifdef _SQUID_HPUX_
+    {
+       extern void U_STACK_TRACE(void);  /* link with -lcl */
+       fflush(debug_log);
+       dup2(fileno(debug_log), 2);
+       U_STACK_TRACE();
+    }
+#endif /* _SQUID_HPUX_ */
+#ifdef _SQUID_SOLARIS_
+    {   /* get ftp://opcom.sun.ca/pub/tars/opcom_stack.tar.gz and */
+       extern void opcom_stack_trace(void);  /* link with -lopcom_stack */
+       fflush(debug_log);
+       dup2(fileno(debug_log), fileno(stdout));
+       opcom_stack_trace();
+       fflush(stdout);
+    }
+#endif /* _SQUID_SOLARIS_ */
+#endif /* PRINT_STACK_TRACE */
+
 #if SA_RESETHAND == 0
     signal(SIGSEGV, SIG_DFL);
     signal(SIGBUS, SIG_DFL);
@@ -303,7 +324,7 @@ void
 normal_shutdown(void)
 {
     debug(21, 1, "Shutting down...\n");
-    if (Config.pidFilename) {
+    if (Config.pidFilename && strcmp(Config.pidFilename, "none")) {
        enter_suid();
        safeunlink(Config.pidFilename, 0);
        leave_suid();
@@ -506,9 +527,9 @@ void
 writePidFile(void)
 {
     FILE *pid_fp = NULL;
-    char *f = NULL;
+    const char *f = NULL;
 
-    if ((f = Config.pidFilename) == NULL)
+    if ((f = Config.pidFilename) == NULL || !strcmp(Config.pidFilename, "none"))
        return;
     enter_suid();
     pid_fp = fopen(f, "w");
@@ -527,11 +548,11 @@ pid_t
 readPidFile(void)
 {
     FILE *pid_fp = NULL;
-    char *f = NULL;
+    const char *f = NULL;
     pid_t pid = -1;
     int i;
 
-    if ((f = Config.pidFilename) == NULL) {
+    if ((f = Config.pidFilename) == NULL || !strcmp(Config.pidFilename, "none")) {
        fprintf(stderr, "%s: ERROR: No pid file name defined\n", appname);
        exit(1);
     }