csirtgadgets / massive-octo-spice

DEPRECATED - USE v3 (bearded-avenger)
https://github.com/csirtgadgets/bearded-avenger-deploymentkit/wiki
GNU Lesser General Public License v3.0
227 stars 60 forks source link

worker never stops trying to connect to router #373

Closed giovino closed 8 years ago

giovino commented 8 years ago

in this loop cif-worker will try to connect to the router indefinitely, if the router is not available, starting / restarting cif-worker hangs:

$ sudo service cif-services restart
 * Stopping cif-router                                                                                                                                                             [ OK ] 
 * Starting cif-router                                                                                                                                                             [ OK ] 
 * Stopping cif-worker                                                                                                                                                             [ OK ] 
 * Starting cif-worker               

potential fix: add a counter and after 8 tries (15s x 8 = 120s) fail with message "cif-router is unavailable"

wesyoung commented 8 years ago

ironically i ran into this one this am.. i think it should start and loop, just not hang...? or quit after a few attempts... i'm kinda in-different, but given the way monit is configured... the loop doesn't hurt does it?

giovino commented 8 years ago

I think the "hurt" is.. service cif-worker start/restart.. hangs forever when it can't complete. The user is forced to ctrl-c to stop the init process. seems wonky.

wesyoung commented 8 years ago

given what i exp this am, i think that's fair. probably as easy as adding a similar first-check loop to cif-router as we did with cif-worker, then adding a limit and some output error info too.