hostapd_cli not handling termination with action file

Sam James drsamjames at
Fri Jul 30 03:12:15 PDT 2021

Hi All

I've been having a problem using hostapd_cli when I use it with an 
action file. When I terminate my command I start receiving error 

daemon.notice hostapd: CTRL_IFACE monitor[0]: 146 - Connection refused

I thought it might be something to do with hostapd_cli not shutting down 
correctly. After reading the source code I'm fairly sure this is 
correct. I can only find the termination handler:

eloop_register_signal_terminate(hostapd_cli_eloop_terminate, NULL);

in hostapd_cli_interactive(void). Given this isn't called when running 
with an action file set I don't see any way of the main loop in 

while (!hostapd_cli_quit){

ever terminating. As far as I can see the simple fix is to move  
eloop_register_signal_terminate(hostapd_cli_eloop_terminate, NULL);  
into main.



More information about the Hostap mailing list