This commit is contained in:
Raven Scott
2026-04-03 23:42:47 -04:00
parent d8e580d1af
commit 2ef56ac314
43 changed files with 1941 additions and 553 deletions
@@ -16,6 +16,7 @@ import {
readInitdDisabledSet,
writeInitdDisabledSet
} from './bare-initd-user.js'
import { getBareInitdJournalNdjson } from './bare-initd-journal.js'
/** @param {Uint8Array | null} buf @param {number} maxLines */
function tailUtf8Lines(buf, maxLines) {
@@ -112,6 +113,13 @@ export async function runSystemctlCli(ctx, argv) {
return
}
await printLogTail(ctx, def.logPath, lines, 'journalctl')
const jtext = getBareInitdJournalNdjson(unit)
if (jtext.trim()) {
const jl = jtext.trimEnd().split(/\r?\n/)
const tailJ = jl.slice(-lines).join('\n')
ctx.console.log('--- unit journal (NDJSON tail) ---')
ctx.console.log(tailJ)
}
ctx.exitCode = ctx.exitCode ?? 0
return
}