I have a python program that is running as daemon on Linux
I need some how send this program a signal from another python program What should I do in both this programs ?
I have a python program that is running as daemon on Linux
I need some how send this program a signal from another python program What should I do in both this programs ?
Any other kind of signalling is possible, but these would probably be the most common.
Have you tried reading through the docs on interprocess communication in Python? Here is a link:
Use os.kill to send signals. The signals are defined in the signal module. You'll just need to get the pid of the daemon in some way.
One more thing - you can use the signal module to register signal handlers as well.
If you need something more sophisticated than simple signals, consider using an RPC library like PYRO. The advantage of this is that you can use it even if you have to move your processes to separate servers.
Or, if you mainly target Linux systems, then look at using DBUS instead. There is a python library and it is now even supported on Windows.