On May 13, 2008, at 12:14 PM, Antony Chazapis wrote:
On May 13, 2008, at 11:34 AM, Marek Lindner wrote:
I did some testing with a script which just prints the commands and I noticed that the script can't execute those commands because it dies too quickly via SIGINT or SIGTERM. Therefore the latest revision (1065) ignores these signals. Apart from that we have a little sync problem. Batman kills its child after sending all the commands via the pipe. At that moment the child may still be busy with processing these commands. We have to find an elegant way to communicate that the child finished its last job. The latest revision waits another 3 seconds which is far from being perfect ...
I've checked out the latest revision and have seen the problem you mention. I think that waiting and then killing the process is not needed. If you just close the pipe, the other end should notice that there is an EOF at stdin and die. I created a new batquagga version (0.2) that does exactly that and even when removing the "sleep" and "kill" commands from restore_defaults(), it works fine.
Moreover, batquagga-0.2 has no signal handlers for SIGKILL and SIGINT. They are not needed anymore. Also, the "retain routes" option was removed (no sense at this point, and no way to properly distinguish between delete routes that happen at shutdown vs. delete routes that would normally occur).
PS: Your addtional script arguments patch is an interesting idea. We are checking on that because it might have some side effects.
The arguments patch or some other form of passing arguments is essential for using the policy-routing-script to redistribute routes from other protocols...
Antony