Github user ahgittin commented on a diff in the pull request: https://github.com/apache/incubator-brooklyn/pull/1164#discussion_r50296480 --- Diff: brooklyn-server/server-cli/src/main/java/org/apache/brooklyn/cli/Main.java --- @@ -474,17 +472,22 @@ public Void apply(CatalogInitialization catInit) { } BrooklynServerDetails server = launcher.getServerDetails(); - ManagementContext ctx = server.getManagementContext(); + ManagementContext mgmt = server.getManagementContext(); if (verbose) { Entities.dumpInfo(launcher.getApplications()); } if (!exitAndLeaveAppsRunningAfterStarting) { - waitAfterLaunch(ctx, shutdownHandler); + waitAfterLaunch(mgmt, shutdownHandler); } - // will call mgmt.terminate() in BrooklynShutdownHookJob + // BrooklynShutdownHookJob will invoke terminate() to do mgmt.terminate() and BrooklynWebServer.stop(); + // and System.exit is invoked immediately after ... + // but seems better to do it explicitly here. + // ('launcher' is local to us so the caller *cannot* do it, and no harm in doing it twice.) + launcher.terminate(); --- End diff -- thanks! yes there is stuff in `BrooklynShutdownHookJob` we need to tab into. i still think we should trigger it manually here, because we can rather than rely on the shutdown hook, but what i've done is definitely NOT good enough.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---