❦ 20 juillet 2014 10:05 +0300, Stanislav Datskevich <sdatskevich@gmail.com> :
Hi Vincent, Alex, I'm not a C programmer, so, could you please explain why fork() is the problem? I see this feature work this way: 1. Place "run external command" statement into "if" statement inside the filter or function, so it will be ran only on the specific updates/withdraws. 2. When update/withdraw message is arrived, BIRD runs external command, passes message details to it as environment variables and forks it. After fork BIRD is not blocked by child execution, so it will not be a performance impact.
When a lot of updates are happening, you'll have to do a lot of fork/exec which will put pressure on the system, slowing it down. If you are worried about using stdin instead of arguments or environment variables, that's not really more complex. Instead of having a script which does: echo $1 $2 >> /var/log/something You do: while read a b; do echo $a $b >> /var/log/something done Moreover, this allows bidirectional communication. Your script can send routes to be advertised. At least, it should make your life easier by handling one route at a time without locking. In the first example, parallel execution of such a script would lead to a mangled log file. -- Make sure comments and code agree. - The Elements of Programming Style (Kernighan & Plauger)