Is there a standard linux/unix pattern for communicating with long running process?
For example, I have few hundred process, written in c++, and running on various machines and I would like to send them a command like reload configuration, start, stop etc via shell scripts.
Since you also care about remote processes, and assuming you can modify the source code of all your programs, you could consider some way to communicate with them:
defining your own small textual protocol, and have each process listening on some socket or some named pipe. You probably would need some multiplexing syscall like poll
use existing libraries and tools like MPI, Corba, or perhaps D-Bus or ONC/RPC/XDR
change the configuration files of your application, and have signal conventions, e.g. catch
SIGHUPto reload the configuration, andSIGTERMto properly terminate it (but there is no way to send a signal remotely; you’ll need e.g. tosshsomekillcommand).