how to force a python service to reconfigure itself after updating?

Farraige farraige at interia.pl
Thu Apr 8 15:10:43 EDT 2004


Hi!

I hope you will help me. I have the following problem....
I have implemented a Windows NT service using win32serviceutil. The service
runs a 'working loop' in another thread and waits for the stop event to be
set. A working loop thread checks the space used by logfiles against the
given upper limit and deletes the files, if the upper limit is reached.
After each space analysis it sleeps for about 30 minutes. The service
handles start/stop/restart/.../update parameters from the command line.
Update command updates by default all the changes made in the service python
code without need to restart the service... What about the situation if my
service reads some configuration datas from its config file? If I change
some data in the configuration files, those changes "will not be seen" after
using update parameter due to none change was made in the service code. Do
you have an idea how to overload the standard behaviour of using update
command line parameter to force the service to reconfigure itself without
restarting? I don't now how to implement communication between the main
function that handles all command (thanks to
win32serviceutil.HandleCommandLine) line parameters and the working thread
that is started by the service in its SvcRun method?

Thanks in advance for any hints!

Best wishes,

Niki





More information about the Python-list mailing list