Update documentation and explicitly unpipe journald stream

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-08-21 12:19:47 +01:00
parent 5121767766
commit 2d924b83fc
2 changed files with 2 additions and 1 deletions

View File

@ -1207,7 +1207,7 @@ Fields should be provided via POST body in JSON format.
From an application container (with systemd installed):
```
$ curl -X POST --data '{"follow":true,"all":true}' "$BALENA_SUPERVISOR_ADDRESS/v2/journal-logs?apikey=$BALENA_SUPERVISOR_API_KEY" | systemd-journal-remote - -o log.journal
$ curl -X POST -H "Content-Type: application/json" --data '{"follow":true,"all":true}' "$BALENA_SUPERVISOR_ADDRESS/v2/journal-logs?apikey=$BALENA_SUPERVISOR_API_KEY" | systemd-journal-remote - -o log.journal
```
The `log.journal` file can then be viewed with

View File

@ -547,6 +547,7 @@ export function createV2Api(router: Router, applications: ApplicationManager) {
journald.kill('SIGKILL');
});
journald.on('exit', () => {
journald.stdout.unpipe();
res.end();
});
} catch (e) {