0

I am writing a bash program that has IPC between two proccesses (A and B) via named pipes. I am worried because if A crashes, B may be blocked indefinitely (and vice versa), because named pipes are blocking. Can I link A and B so, if A crashes, force B to crash too? Any other alternatives to solve this blocking problem would be appreciated.

Thank you in advance.

2 Answers2

0

You may need an additional process "C" that monitors the activity of process "A" and process "B"

0

If you are talking about a bash script? If so you could trap the signal sent to A to kill it and then send a signal to B so it exits.

The relevant bash features are: trap and kill. And the relevant signals would be SIGKILL, SIGINT, SIGHUP, etc. Invoking: trap -l will list all the possible signals.

Marc Butler
  • 1,346
  • 7
  • 13