I am testing tailf-hcc version 4.0.6.
I would like to know the trigger to break “read” in autoifdown.sh.
I tried to understand “tailf_viperl_server.erl” but I couldn’t.
I would appreciate it if you would give some good suggestion.
The script is started by the erlang code using a construct called open_port(.... args) in Erlang.
That built-in function forks and execs a program, and sets up a pipe pair to the stdin/stdout of that program.
Thus, when the erlang process that owns the Port, or the NSO daemon itself terminates, the script will receive EOF on its stdin, thus releasing the 'read' and subsequently executing the ifdown code.
Just curious, since close_port(Port) is called in handle_cast for is_not_master and cdb_update events, the autoifdown.sh gets called when these events are triggered in addition to NSO/process terminates?
Yupp, that is correct. For example, if you're not master, do not bring up the VIP... etc