I have written a daemon in CPP that listens to the serial port and alters a mysql database when necessary. This works fine, but now I need to communicate to the daemon after it has been started. There is an event that happens on average at most once a week that the daemon needs to know about. Hopefully I would be able to communicate to the daemon through php script running on apache on the same machine. I have been reading up about handling signals on linux (very dense), and I have a very rudimentary understanding. What I'm confused about is how to actually send a signal without knowing about the daemon's PID. That made me question if a signal is the right way to do this in the first place. The daemon doesn't need to know any information other than the event occured. Any ideas on how to communicate such an event to a deamon?


8 Years
Discussion Span
Last Post by Ancient Dragon

One way might be to enhance the daemon to listen on a socket in another thread and the other program can open the socket and send daemon some information.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.