cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
22
Views
0
Helpful
3
Replies
Highlighted
Cisco Employee

autoifdown.sh of tailf-hcc

 

Hello expert,

 

 

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.

 

 

Kind regards,

Keisuke.

 

Everyone's tags (4)
3 REPLIES 3
Cisco Employee

Re: autoifdown.sh of tailf-hcc

 

 

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.

 

 

/klacke

 

Cisco Employee

Re: autoifdown.sh of tailf-hcc

 

Hi klacke,

 

 

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?

 

 

Thanks,

 

Tomo

 

Cisco Employee

Re: autoifdown.sh of tailf-hcc

 

 

Yupp, that is correct. For example, if you're not master, do not bring up the VIP... etc

 

 

/klacke

 

Content for Community-Ad
August's Community Spotlight Awards
This widget could not be displayed.