What is elegant way to do configuration on server app

Chris Angelico rosuav at gmail.com
Fri Mar 27 12:36:03 EDT 2015


On Sat, Mar 28, 2015 at 3:28 AM, Grant Edwards <invalid at invalid.invalid> wrote:
> I presume that automagically reading them any time they changed was
> both too much hassle and possibly dangerous: if a file is being
> edited, it might get saved in intermediate (broken) states during the
> editing session.

Even more so if you have multiple files (look, for instance, at
PostgreSQL configs, where you might make simultaneous and connected
changes to several related files); if you change one and it's
activated before you change another, it might even have security
implications - although more likely, it'd cause an outage (when legit
connections get rejected because you haven't yet added the permission
lines).

The same problem occurs with PHP-based web sites, but there you don't
get the option of holding over for a SIGHUP, so you're just stuck with
uploading a new version of your site file-by-file, or *maybe*
attempting an atomic rename of a directory. If you're lucky.

ChrisA



More information about the Python-list mailing list