Refactor our initialization sequence into a logical order
There are several things I'd like out of a logical initialization sequence.
-
I'd like nt_service_parse_options() to happen at immediately before our first call to config_parse_commandline().
-
I'd like us to divide our initialization stages into separate function calls, divided based on how much of the commandline or config we have parsed up until then. The main "inflection points" in this process are calls to nt_service_parse_options(), config_parse_commandline(), and options_init_from_torrc().
-
I'd like us to turn as much of our initialization into subsystems as possible.
Unfortunately, we do not have good unit tests for our NT services code, which makes reordering that troublesome.