MCPcopy Create free account
hub / github.com/ClassicOldSong/Apollo / start_service

Function start_service

src/entry_handler.cpp:211–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209 }
210
211 bool start_service() {
212 service_controller sc {SERVICE_QUERY_STATUS | SERVICE_START};
213
214 std::cout << "Starting Sunshine..."sv;
215
216 // This operation is asynchronous, so we must wait for it to complete
217 if (!sc.start_service()) {
218 return false;
219 }
220
221 SERVICE_STATUS status;
222 do {
223 Sleep(1000);
224 std::cout << '.';
225 } while (sc.query_service_status(status) && status.dwCurrentState == SERVICE_START_PENDING);
226
227 if (status.dwCurrentState != SERVICE_RUNNING) {
228 BOOST_LOG(error) << SERVICE_NAME " failed to start: "sv << status.dwWin32ExitCode;
229 return false;
230 }
231
232 std::cout << std::endl;
233 return true;
234 }
235
236 bool wait_for_ui_ready() {
237 std::cout << "Waiting for Web UI to be ready...";

Callers 1

config.cppFile · 0.85

Calls 2

start_serviceMethod · 0.80
query_service_statusMethod · 0.80

Tested by

no test coverage detected