[Tutor] building an interactive deamon
Thanos Panousis
pthanos at gmail.com
Thu Mar 8 17:02:24 CET 2007
So here goes my first question to the list. I can't really describe in
precise words what I need, therefore it is difficult to google for an
answer.
I am building a system that is supposed to run as a daemon. This daemon will
of course depend on some configuration variables that are read during the
initialization of the program. It does something, sleeps for some seconds,
and so on. No, I dont want it to be a scheduled task.
How can I make a daemon that does not need to be restarted every time a
configuration is changed?
Say a web fronted is used to make changes to some variables of the system,
like how much time it should sleep, etc. Should I make the program intercept
some signal which triggers a re-read of the config files and fills (global)
variables with fresh values? Or is there another way to do it?
As a side question, is there a more elegant way of making something a deamon
other than the ole
while True:
do_stuff()
sleep(some_time)
?
Thanks a lot. This language is really spoilling me: being used to all of
Python's elegance, reading Java makes my eyes hurt...:)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070308/1e913744/attachment.html
More information about the Tutor
mailing list