improve daemons init system (#2960)

* repeatable command launch fn

* allow js fn for daemon exec

* improve daemon init system

* fixes from testing
This commit is contained in:
Aiden McClelland
2025-06-06 14:35:03 -06:00
committed by GitHub
parent 586d950b8c
commit 2464d255d5
13 changed files with 187 additions and 162 deletions

View File

@@ -67,20 +67,14 @@ export class MainLoop {
this.system.manifest.volumes,
`Main - ${currentCommand.join(" ")}`,
)
const daemon = await Daemon.of()(
this.effects,
subcontainer,
currentCommand,
{
runAsInit: true,
env: {
TINI_SUBREAPER: "true",
},
sigtermTimeout: utils.inMs(
this.system.manifest.main["sigterm-timeout"],
),
const daemon = await Daemon.of()(this.effects, subcontainer, {
command: currentCommand,
runAsInit: true,
env: {
TINI_SUBREAPER: "true",
},
)
sigtermTimeout: utils.inMs(this.system.manifest.main["sigterm-timeout"]),
})
daemon.start()
return {

View File

@@ -135,12 +135,9 @@ export const polyfillEffects = (
[input.command, ...(input.args || [])].join(" "),
)
const daemon = promiseSubcontainer.then((subcontainer) =>
daemons.runCommand()(
effects,
subcontainer,
[input.command, ...(input.args || [])],
{},
),
daemons.runCommand()(effects, subcontainer, {
command: [input.command, ...(input.args || [])],
}),
)
return {
wait: () =>