-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show configuration file in reports #1790
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -650,7 +650,9 @@ mainHandleCommandLineOption(const int optId, const char *optValue) | |||
printf("For legal restrictions on distribution see https://www.openssl.org/source/license.html\n\n"); | ||||
#endif | ||||
#endif | ||||
printf( "configure options: %s\n", SQUID_CONFIGURE_OPTIONS); | ||||
|
||||
printf("Running Configuration in: %s\n", ConfigFile); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAICT from sample output reports (thank you for providing those!), this line will appear in "squid -v" output. I do not think it should appear there (because it will often not match the reality of a running Squid instance), especially when "squid -v" command line does not include "-f". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line appearing in Consider an admin running a locally built Squid installed over a system package. Running Squid would default to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The above response does not seem to be related to (and, hence, cannot address) my concern.
I assume the "Consider an admin..." example above is implying that this specific admin will run To address my concern while still supporting the above use case, we can adjust |
||||
printf("Build configure options: %s\n", SQUID_CONFIGURE_OPTIONS); | ||||
|
||||
#if USE_WIN32_SERVICE | ||||
|
||||
|
@@ -1484,6 +1486,8 @@ RegisterModules() | |||
int | ||||
SquidMain(int argc, char **argv) | ||||
{ | ||||
ConfigFile = xstrdup(DEFAULT_CONFIG_FILE); | ||||
|
||||
Comment on lines
+1489
to
+1490
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I see no good reason for this code change and it feels like a step backwards: Why set a global variable to an incorrect (in some cases) value? Until command line arguments are parsed, we do not know the configuration file name. It may or may not be the default name.
Suggested change
The suggestion above restores official code but may require other PR adjustments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is what produces
instead of:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, I am aware. This fact does not address the concern detailed in this change request. Clearly, the same output1 can be produced without this problematic code change (e.g., by adjusting PR-added code that produces that output). Footnotes |
||||
// We must register all modules before the first RunRegisteredHere() call. | ||||
// We do it ASAP/here so that we do not need to move this code when we add | ||||
// earlier hooks to the RegisteredRunner API. | ||||
|
@@ -1570,9 +1574,6 @@ SquidMain(int argc, char **argv) | |||
{ | ||||
int parse_err; | ||||
|
||||
if (!ConfigFile) | ||||
ConfigFile = xstrdup(DEFAULT_CONFIG_FILE); | ||||
|
||||
assert(!configured_once); | ||||
|
||||
Mem::Init(); | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not violently against adding comments to the processed configuration file dump even though I am worried that this may open a Pandora box of arguing what comments are appropriate. There are a lot of things we could report here!
Please adjust this comment text to clarify that this is the top-level configuration filename rather than the only configuration file.
Reporting all configuration files used is better than reporting just the top-level one. I do not insist on this enhancement in this PR, but please keep it (i.e. future wording/context changes) in mind when adjusting this text in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions welcome, I am not set on specifics here beyond that it does have to be a
#comment
. IMO the fact of being top-level should be obvious to the admin reading it - usually by the fact it is/some/path/to/squid.conf
.The other files loaded would be nice, but are not yet recorded anywhere to be included in this output. I am leaving them until the
ConfigParser
refactoring is done.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but that is not the concern detailed in this change request. That concern is that the admin may think that the named file is "the only configuration file".
If this PR does not improve code to (at least) detect use/presence of other configuration files, then
I suggest
... or something like that. Future PRs may add a list of various secondary configuration files used.