Streaming journalctl -afu rauc piles up messages #1353
Replies: 1 comment 5 replies
-
@SurrealW0rld I am not fully sure if I understood your use case. If you intend to show actual progress information, then you should preferably use the D-Bus API designed for this: https://rauc.readthedocs.io/en/latest/using.html#processing-progress-data
Since you spawn a 'journalctcl' subprocess, there should be nothing RAUC-specific in the question. For a normal journalctl -u -rauc -f, you should see the log messages live (at least I do). If you don't need the journal, you could also start the RAUC service directly and then redirect stdout/stderr, but I would not encourage you to do so. Also note that for remote-monitoring of the log or journal, there are existing mechanisms like https://www.freedesktop.org/software/systemd/man/latest/systemd-journal-remote.service.html or rsyslog |
Beta Was this translation helpful? Give feedback.
-
Context:
I‘m trying to stream the progress of a rauc installation, i.e. its journalctl output, to an external viewer via a socket. For this, another service on the device with the rauc installation spawns a child process with journalctl and it listens to the ‘data’ emissions to process the data and then streams it to the external viewer.
Problem:
These ‘data’ emissions are send in bulk when the installation is finished which both is not suited for live monitoring and is happening while the socket is closing, so no messages reach the external viewer. Using journalctl in console with the same command on that device works as usual and updates live and using my service to live monitor other services from that device to an external viewer is also working as expected, only the combination of
journalctl -u rauc
and streaming it does not work.Code:
The service managing this is written with NestJS and here is the condensed code where the data jam is happening:
data => this.onData(data)
is the bottleneck, visible if changing the callback toDo I need to configure the childprocess spawning in a specific way for rauc or is there another problem?
Beta Was this translation helpful? Give feedback.
All reactions