From: Amos Jeffries Date: Mon, 18 Apr 2011 11:00:10 +0000 (-0600) Subject: Display ERROR in cache.log for invalid configured paths X-Git-Tag: SQUID_3_1_12_1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d294b6aeef67ce88afadc0ce28aa68f2c720345;p=thirdparty%2Fsquid.git Display ERROR in cache.log for invalid configured paths The validator that checks system paths for files and directories in the configuration file sends error messages to stderr. It should send them to cache.log for the admin to see easily. Also, this makes the error display as FATAL ERROR when using -k parse to indicate that it is fatal to the startup. Other management signals where it is not necessarily fatal will only display as an ERROR. --- diff --git a/src/cache_cf.cc b/src/cache_cf.cc index 310ed112dc..fcbc93c017 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -3588,10 +3588,13 @@ requirePathnameExists(const char *name, const char *path) } if (stat(path, &sb) < 0) { + debugs(0, DBG_CRITICAL, (opt_parse_cfg_only?"FATAL ":"") << "ERROR: " << name << " " << path << ": " << xstrerror()); + // keep going to find more issues if we are only checking the config file with "-k parse" + if (opt_parse_cfg_only) + return; + // this is fatal if it is found during startup or reconfigure if (opt_send_signal == -1 || opt_send_signal == SIGHUP) fatalf("%s %s: %s", name, path, xstrerror()); - else - fprintf(stderr, "WARNING: %s %s: %s\n", name, path, xstrerror()); } }