[cdc_stream] Automatically start service (#28)

Starts the streaming service if it's not up and running. This required
adding the ability to run a detached process. By default, all child
processes are killed when the parent process exits. Since detached
child processes don't run with a console, they need to create sub-
processes with CREATE_NO_WINDOW since otherwise a new console pops up,
e.g. for every ssh command.

Polls for 20 seconds while the service starts up. For this purpose,
a BackgroundServiceClient is added. This will be reused in a future CL
by a new stop-service command to exit the service.

Also adds --service-port as additional argument to start-service.
This commit is contained in:
Lutz Justen
2022-12-02 14:34:36 +01:00
committed by GitHub
parent 6d63aa72d7
commit 1120dcbee0
21 changed files with 372 additions and 76 deletions

View File

@@ -45,6 +45,7 @@ cc_library(
srcs = ["start_command.cc"],
hdrs = ["start_command.h"],
deps = [
":background_service_client",
":base_command",
":local_assets_stream_manager_client",
":session_management_server",
@@ -78,6 +79,18 @@ cc_library(
],
)
cc_library(
name = "background_service_client",
srcs = ["background_service_client.cc"],
hdrs = ["background_service_client.h"],
deps = [
"//common:grpc_status",
"//common:status_macros",
"//proto:background_service_grpc_proto",
"@com_google_absl//absl/status",
],
)
cc_library(
name = "asset_stream_server",
srcs = [
@@ -112,6 +125,8 @@ cc_library(
deps = [
":base_command",
":multi_session",
":session_management_server",
"//absl_helper:jedec_size_flag",
"//common:log",
"//common:path",
"//common:status_macros",