Closed maringuu closed 1 year ago
The containers are stopped in src/start_fact_frontend.py
:
run_cmd_with_logging(f'docker-compose -f {COMPOSE_YAML} down')
The problem is probably that this line is only executed when the frontend is shut down "gracefully". If it is simply killed by docker it will not work. I don't see how this could be solved in FACT because if the process is just killed we can't handle it. I'm not sure how exactly docker-compose down
is handled inside the containers, though (i.e. what kind of signal gets sent, etc.). So maybe there could be a way to fix this.
If docker-compose
is being used to launch FACT, then what is the correct method of shutting down the frontend gracefully?
When running FACT outside of docker you would simply use Ctrl+C (so SIGINT) to stop FACT. That signal gets handled internally and a graceful shutdown is performed (including the shutdown of docker-compose for the radare web GUI). It seems when using docker-compose, the shutdown is performed differently (could be SIGTERM, SIGKILL or something entirely different). I will have to investigate this and maybe make some adjustments to the signal handling in FACT.
This also means that, sadly, there currently doesn't seem to be a way to shut down FACT_docker gracefully (except maybe starting the containers interactively but I don't think that's a long-term solution)
I tested it and it seems the signal submitted to the container when pressing Ctrl+C or executing docker-compose stop
is SIGTERM
. This means if we handle this signal in the FACT start scripts everything should work.
From #27
Probably this has to be fixed in FACT_core