Bug 57403 - Persist configuration changes made via status worker
Summary: Persist configuration changes made via status worker
Status: NEW
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: Common (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
: 42723 (view as bug list)
Depends on:
Reported: 2014-12-30 10:22 UTC by Rainer Jung
Modified: 2014-12-31 15:11 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Jung 2014-12-30 10:22:38 UTC
The status worker should have an optional feature to save any configuration changes made via its GUI to workers.properties.

Writing a configuraiton file is typically not an easy task, because you would loose comments and other structure of the original file, e.g. property inheritance via the "reference" attribute.

One implementation idea would be second "journal" file to which one would write a protocol of all new propertiy values coming our of status worker changes. Only changes with a "persist" checkbox set in the GUI would be written there.

During startup mod_jk would read the original workers.properties and then overlay the journal file to reacreate the last "persisted" configuration state.

A sysadmin could at any time either roll back by deleting the journal file or parts of it, or reintegrate the journal file contents into the original workers.properties.

The default name of the journal file could be the value of JkWorkersFile plus some suffix, like ".journal" or ".changes". For situations, where the file has to go to some other place, a JkWorkersJounrnalFile directive could be used to explicitely set the file (and dir).

The default in the status worker GUI would be not to persist, activating it via a checkbox in the forms, in which one can set new property values. A configuration item for the status worker could switch defaults (it would still show the same checkbox, but then it would be checked by default).

If saving the properties fails, the status workr would show an error message and also log an error.

If mod_jk finds a journal file, it would log its existence and processing on info log level during startup.

The journal file could also contain a comment line for each property line, which contains a timestamp of the change and maybe user name and other meta data (client IP? User comment added via GUI?).

I currently do not plan to work on this but patches are welcome.
Comment 1 Christopher Schultz 2014-12-30 14:39:20 UTC
Please make the persistability something that needs to be explicitly enabled for the module. We don't need an accidental security hole added for users who don't ever want to use the feature.
Comment 2 Rainer Jung 2014-12-31 15:11:37 UTC
*** Bug 42723 has been marked as a duplicate of this bug. ***