mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
Fix/health check error (#2731)
* fix: No error's with an error code * fix dns query * await resolv.conf copy * use tty in subcontainer exec if parent is tty * Fix: Home=root for inject services * fix: Add the action inject too --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -173,10 +173,16 @@ export class MainLoop {
|
||||
subcontainer,
|
||||
}
|
||||
)
|
||||
const env: Record<string, string> = actionProcedure.inject
|
||||
? {
|
||||
HOME: "/root",
|
||||
}
|
||||
: {}
|
||||
const executed = await container.exec(
|
||||
[actionProcedure.entrypoint, ...actionProcedure.args],
|
||||
{ input: JSON.stringify(timeChanged) },
|
||||
{ input: JSON.stringify(timeChanged), env },
|
||||
)
|
||||
|
||||
if (executed.exitCode === 0) {
|
||||
await effects.setHealth({
|
||||
id: healthId,
|
||||
@@ -227,6 +233,18 @@ export class MainLoop {
|
||||
})
|
||||
return
|
||||
}
|
||||
if (executed.exitCode && executed.exitCode > 0) {
|
||||
await effects.setHealth({
|
||||
id: healthId,
|
||||
name: value.name,
|
||||
result: "failure",
|
||||
message:
|
||||
executed.stderr.toString() ||
|
||||
executed.stdout.toString() ||
|
||||
`Program exited with code ${executed.exitCode}:`,
|
||||
})
|
||||
return
|
||||
}
|
||||
await effects.setHealth({
|
||||
id: healthId,
|
||||
name: value.name,
|
||||
|
||||
@@ -750,6 +750,12 @@ export class SystemForEmbassy implements System {
|
||||
const subcontainer = actionProcedure.inject
|
||||
? this.currentRunning?.mainSubContainerHandle
|
||||
: undefined
|
||||
|
||||
const env: Record<string, string> = actionProcedure.inject
|
||||
? {
|
||||
HOME: "/root",
|
||||
}
|
||||
: {}
|
||||
const container = await DockerProcedureContainer.of(
|
||||
effects,
|
||||
this.manifest.id,
|
||||
@@ -769,6 +775,7 @@ export class SystemForEmbassy implements System {
|
||||
JSON.stringify(formData),
|
||||
],
|
||||
timeoutMs,
|
||||
{ env },
|
||||
)
|
||||
).stdout.toString(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user