Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #88171

Re: What is elegant way to do configuration on server app

From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: What is elegant way to do configuration on server app
Date 2015-03-27 16:28 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <mf40g8$8kd$1@reader1.panix.com> (permalink)
References <CAEKwp_FsbbAOrBm1h-CE1PS358pJBadJqNDi1CN7upC_s3nqCw@mail.gmail.com> <mailman.189.1427360350.10327.python-list@python.org> <mf19qa$ii6$2@reader1.panix.com> <mailman.236.1427444902.10327.python-list@python.org>

Show all headers | View raw


On 2015-03-27, Jerry OELoo <oyljerry@gmail.com> wrote:

>>>   Make a part of your event loop (assuming your server runs an event
>>>   loop) that wakes up every N seconds (e.g. every 60 seconds) and
>>>   checkes the file's modification timestamp again; if it's newer, record
>>>   that value for future comparisons, then re-read the file for its
>>>   values.
>>
>> That sounds rather Windowsesque.  The more-or-less standard way to do
>> handle the situation on Unix is to reread the config file when you get
>> a SIGHUP.
>
> Why use SIGHUP,

It's just tradition.  Some other seldom-used signal could have been
chosen, but way back when somebody chose SIGHUP, and other people
followed suit.

> Does it has something to do with configure file modification?

Not intrinsically.  It's just a convention in the Unix world that
sending SIGHUP to a daemon will cause it to re-read its configuration
files.

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.

-- 
Grant Edwards               grant.b.edwards        Yow! An air of FRENCH FRIES
                                  at               permeates my nostrils!!
                              gmail.com            

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: What is elegant way to do configuration on server app Ben Finney <ben+python@benfinney.id.au> - 2015-03-26 19:59 +1100
  Re: What is elegant way to do configuration on server app Grant Edwards <invalid@invalid.invalid> - 2015-03-26 15:49 +0000
    Re: What is elegant way to do configuration on server app Jerry OELoo <oyljerry@gmail.com> - 2015-03-27 16:28 +0800
      Re: What is elegant way to do configuration on server app Grant Edwards <invalid@invalid.invalid> - 2015-03-27 16:28 +0000
        Re: What is elegant way to do configuration on server app Chris Angelico <rosuav@gmail.com> - 2015-03-28 03:36 +1100
          Re: What is elegant way to do configuration on server app Grant Edwards <invalid@invalid.invalid> - 2015-03-27 16:44 +0000
    Re: What is elegant way to do configuration on server app Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 10:47 +0200
      Re: What is elegant way to do configuration on server app Chris Angelico <rosuav@gmail.com> - 2015-03-28 00:12 +1100
        Re: What is elegant way to do configuration on server app Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 15:23 +0200
          Re: What is elegant way to do configuration on server app Chris Angelico <rosuav@gmail.com> - 2015-03-28 00:34 +1100
      Re: What is elegant way to do configuration on server app Grant Edwards <invalid@invalid.invalid> - 2015-03-27 16:30 +0000
        Re: What is elegant way to do configuration on server app Marko Rauhamaa <marko@pacujo.net> - 2015-03-27 18:44 +0200

csiph-web