I'm developing a file sync daemon on Ubuntu as a hobby project, and I'm thinking I might want to develop a graphical front-end at some point which will let me control it. How can a GUI control and communicate with a daemon program? What methods are available / recommended?
In this particular case, I'm using C++, but a general answer applicable to any language would also be fine.
1 Answer
You can:
- Communicate using D-Bus which is very popular this days.
- Just change a configuration file and signal your daemon to reload it (
SIGUSR1,SIGUSR2andSIGHUPhave exactly this purpose). - Write your own protocol with something like Thrift or Protocol Buffers.
- Use a low level IPC mechanism.
In your place I would go with D-Bus
2