I have background application A.
I want to create application B to configure application A on the fly.
So, how can I detect if A is running and send some messages to A?
Questions on Unix & Linux Stack Exchange are expected to relate to Unix or Linux within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.
If you just want to change the program's configuration, the typical method of doing that is to update its conf file, then send it a SIGHUP signal, which it is programmed to respond to by reloading its conf file ( see
If you need more complex communication with the program, you will want to use either a fifo or unix domain socket. A fifo ( see
Background application are called "daemon" in Unix & Linux world.
They are standardized in many ways, one way is how to get their pid. They usually create a pid file in
With their pid, you can know nearly everything about them with the help of /proc. You can know if it's still active, memory used, memory mapping, files open, etc, etc.
And as sr_ said, you can then use IPC methods in order to communicate with it.