From 7d294b6aeef67ce88afadc0ce28aa68f2c720345 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Mon, 18 Apr 2011 05:00:10 -0600 Subject: [PATCH] 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. --- src/cache_cf.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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()); } } -- 2.47.2