I have a rootfs of broken container with ubuntu-xenial. How to view logs of specific service without running journald?
Asked
Active
Viewed 1,094 times
-1
-
Have you had a look in `/var/log/` ? – Daniel W. Mar 21 '19 at 09:55
-
What I have to see there? There are no plaintext logs for my systemd-driven services. – dimcha Mar 21 '19 at 09:56
-
Each service writes its own log and the default log folder is `/var/log/`. If a service doesnt do that, the `STDERR` / `STDOUT` is captured into the syslog: `/var/log/syslog` example: `Mar 21 09:55:42 flowl41 systemd[23313]: Reached target Basic System.` – Daniel W. Mar 21 '19 at 09:59
-
No, there are no logs for service. Systemd is capturing stdout of my service. It's a common behaviour. – dimcha Mar 21 '19 at 10:02
-
@DanFromGermany, I have no syslog on my system at all. – dimcha Mar 21 '19 at 10:04
-
Do you have rsyslogd running? `ps aux | grep rsyslog` Or, why you have no journald? If you have nothing that does logging, you might need to install either. – Daniel W. Mar 21 '19 at 10:09
-
As I mentioned above, I use systemd's service jounald for logging. But problem is journald writes logs as binary and you can view logs only on running systems. There are no plaintext logs. It's my origin question - how to see these binary logs on stopped system without running systemd-journald – dimcha Mar 21 '19 at 10:16
-
Your question is very unclear. Maybe provide more than two sentences. – Daniel W. Mar 21 '19 at 10:22
-
@DanFromGermany, I mentioned I have "rootfs of broken container" and want to get the logs "without running journald". What addintional info can clarify my question? – dimcha Mar 21 '19 at 12:39
1 Answers
1
You can read any journald directory or file using journalctl
.
journalctl --file /var/log/journal/system.journal

Daniel W.
- 31,164
- 13
- 93
- 151
-
1It seems the right answer for my question, thank you very much. Just one remark - by default, systemd haven't persistent logs and "store" all logs to /run/... So, I haven't any logs in my container due to imbecile default values. – dimcha Mar 21 '19 at 12:37
-
@dimcha oh I just checked and my system does the same. What a stupid decision of the developers ... now I learned something from your issue too! – Daniel W. Mar 21 '19 at 13:21