How to create a console thread for a daemon ?
Hi All,
I have a C++ application which runs as a daemon and reads some configuration parameters from a configuration file at the very beginning of its execution.
The configuration file may be updated occasionally. However, I do not want to stop and then restart the daemon to adapt to the updated configuration file whenever it is changed - I want this adaptation to occur on the fly.
Hence, I want to create a separate thread for this daemon which will wait for a specific command such as "refresh" from the command line. When such a command entered, it will notify the daemon that the configuration file has just changed. Upon the notification, the daemon will read the configuration file again and adapt itself to the changes.
Where should I start to implement such an architecture ?
Is there any way other than using interprocess communication to implement this scenario ?
Thanks.
|