Implement stop and restart of controller/hosts (#554)

Implement remotely initiated stopping and restarting of the controller
and hosts.  Restarting is implemented by exiting with a non-zero exit
code and relying on a process manager to start the procress again.  To
prevent accidentally trying to restart on a system that doesn't have a
process manager present the --can-restart command line option needs to
be passed to enable the restart operation.
This commit is contained in:
Hornwitser authored and GitHub committed 2024-01-18 16:10:42 +01:00
1 parent 885c18c0d4
commit 8884116ee9
15 files changed
+297 -25

No files matched your search

+5
View File
@@ -244,6 +244,10 @@ async function initialize(): Promise<InitializeParameters> {
.demandCommand(1, "You need to specify a command to run");
})
.command("run", "Run controller", yargs => {
yargs.option("can-restart", {
type: "boolean", nargs: 0, default: false,
describe: "Indicate that a process monitor will restart the controller on failure",
});
yargs.option("dev", { hidden: true, type: "boolean", nargs: 0 });
yargs.option("dev-plugin", { hidden: true, type: "array" });
})
@@ -386,6 +390,7 @@ async function startup() {
pluginInfos,
controllerConfigPath,
controllerConfig,
Boolean(args.canRestart),
...await Controller.bootstrap(controllerConfig)
);