[PUP-9754] Log resident configuration upon daemon launch Created: 2019/06/14 Updated: 2019/10/09 Resolved: 2019/09/05
|Fix Version/s:||PUP 5.5.17, PUP 6.4.4, PUP 6.9.0|
|Reporter:||Garrett Guillotte||Assignee:||Ciprian Badescu|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
Users can confirm Puppet agent's resident configuration state when running as a daemon.
|Sprint:||PR - 2019-07-23, NW - 2019-08-07, NW - 2019-08-21, NW - 2019-09-03, NW - 2019-09-18|
|Release Notes:||Bug Fix|
|Release Notes Summary:|| This change is intended to log on debug level the configuration
used on startup when running in daemon mode (by default daemon mode can be enabled on POSIX systems and is disabled on Windows)
Log will sent to the output configured with --logdest
Configuration will be reloaded and also logged on SIGHUP
|QA Risk Assessment:||Needs Assessment|
When attempting to diagnose issues with configuration drift within Puppet agent itself (such as changes to `puppet.conf` not picked up by the agent), there is no way to confirm that the resident configuration is the same as the current state of the configuration files.
For example, we can confirm configuration file settings with puppet config print and lookup PE keys with puppet lookup, but these only reflect what's currently written to the filesystem—if the daemon launched with different settings, there's no equivalent command to confirm its resident configuration.
Either at info or debug logging levels, dump the configuration used by the daemon on launch and also when the daemon reloads the configuration.
|Comment by Josh Cooper [ 2019/06/19 ]|
Logging every setting value could get spammy. We may want to limit this to only log settings whose values are different than the default and/or add a signal handler (maybe USR2?) to dump the configuration in response to the signal. Not sure about Windows.
This is another reason to run puppet from cron instead of running our homegrown daemonization code.
|Comment by Ciprian Badescu [ 2019/07/26 ]|
My understanding is that the config should be logged with debug only at puppet agent startup and not each catalog update in daemon mode. Garrett Guillotte, pls confirm.
On floaty centos-7-x86_64, this will add extra ~200 lines to already existing ~5000 in debug mode during puppet agent startup. Josh Cooper, does it sounds reasonable?
|Comment by Garrett Guillotte [ 2019/08/09 ]|
Ciprian Badescu Yes, log on startup is the intent.
|Comment by Josh Cooper [ 2019/08/28 ]|
|Comment by Jean Bond [ 2019/09/16 ]|
(by default daemon mode can be enabled on POSIX systems and is disabled on Windows)
Does the mean daemon mode is enabled by default on POSIX, or it is disabled by default on POSIX and the user can enable it?
|Comment by Josh Cooper [ 2019/09/16 ]|
Jean Bond The puppet agent process will daemonize by default on POSIX systems, though it can be prevented a few different ways, such as setting Puppet[:daemonize]=false, specifying puppet agent ---onetime, or more commonly puppet agent --test. The new behavior in this ticket only occurs when the agent daemonizes and the log level is set to debug.
Also Windows handles daemonizing differently, so this ticket doesn't apply to puppet on Windows.