News for hackers. Stuff that matters.
Re:Debian reconsiders init-system diversity by newnewpdro on Tuesday November 12, 2019 @01:45AM (#21512042)
You can't replace journald with rsyslog.

You can use rsyslog in addition to journald, but there's no way to get journald out of the picture - it's intertwined with the service manager.

Re:Debian reconsiders init-system diversity by freedomben on Tuesday November 12, 2019 @01:51AM (#21512062)
Yes, sorry if what I wrote was misleading. You can't replace journald with rsyslog, but the only complaints I hear about journald are that it's binary so you have to use journalctl to read them. By installing rsyslog you basically get the classic log behavior back. So technically under the hood you're still using journald, but you never have to know it.
Re:Debian reconsiders init-system diversity by pferde on Tuesday November 12, 2019 @01:59AM (#21512093)
My main complaint is that journald is unreliable and is losing log entries (or lines, if you will).

I had an automation recipe that would start a bunch of cloud instances, configure them and start certain job via a systemd service unit, and collect logs from this job 24 hours later. Initially, we were pulling these logs via journald as logs for that service unit. But then we noticed that random lines (1-5 lines out of maybe 40 for a single job) would be missing in about half the instances.

We ended up pulling those logs from files in /var/log instead, made courtesy of rsyslog. Not a single missed line.

Again journald is unreliable and as a whole should be nuked from the orbit.

Re:Debian reconsiders init-system diversity by Yizahi on Tuesday November 12, 2019 @07:37AM (#21513557)
I concur. We also saw an issue with journald missing whole hours of logs, randomly, on our embedded platform. Couldn't replace all of them with log files due to SSD degradation (we actually calculated it we were missing target device lifespan, this is not a consumer problem of course). Basically we added log files where we could, plus remote logs and left journald as-is, it can't be replaced and can't be fixed.
Re:Debian reconsiders init-system diversity by newnewpdro on Tuesday November 12, 2019 @02:22AM (#21512183)
Filtering journal contents by metadata is known to be unreliable.

It's not that the logs are missing, it's that they're not getting included by your query.

The way journald associates log lines with process metadata is inherently racy.

This situation has improved some with the metadata caching changes, but IIRC there are still some holes where processes can log without journald associating accurate/up-to-date metadata with the logged info.

Re:Debian reconsiders init-system diversity by pferde on Tuesday November 12, 2019 @03:12AM (#21512424)
That makes sense, I guess, in a rather warped and bizarre way. The point still stands - journald is unreliable, and after getting burnt like this it will be years before I start trusting it again.
Re:Debian reconsiders init-system diversity by newnewpdro on Tuesday November 12, 2019 @12:30PM (#21515988)
FYI, in case you wanted to document your pain, it might help prioritize fixing it fully:

https://github.com/systemd/systemd/issues/2913

Re:Debian reconsiders init-system diversity by dannyw on Tuesday November 12, 2019 @05:27AM (#21513029)
Great, so why don't we just keep text logs as text files?
Re:Debian reconsiders init-system diversity by mateuszf on Tuesday November 12, 2019 @06:08AM (#21513209)
Filtering text files in a structured way is even harder.
Re:Debian reconsiders init-system diversity by pmoriarty on Tuesday November 12, 2019 @10:18AM (#21514726)
Having unstructured text reliably be in log files is far better than having a broken log daemon forced upon you.
Re:Debian reconsiders init-system diversity by eecc on Wednesday November 20, 2019 @03:10AM (#21582017)
Dedicated tools exist for that...
Re:Debian reconsiders init-system diversity by freedomben on Tuesday November 12, 2019 @02:02AM (#21512104)
Interesting, this is the first time I've ever heard this. How long ago did this happen?
Re:Debian reconsiders init-system diversity by pferde on Tuesday November 12, 2019 @02:11AM (#21512131)
Sometimes between August and September, and it was on Suse Linux Enterprise Server 12.

The lines would go missing mostly if the logs were collected two or three days later instead of immediately after the job finished (it was a job running for 24 hours), which leads me to think it had to do with journald expiring entries to save on disk space. A consistent log manager would expire them chronologically, but here the lines were missing from the middle or the end of the output, so not the oldest ones logged.

Re:Debian reconsiders init-system diversity by newnewpdro on Tuesday November 12, 2019 @02:14AM (#21512144)
There are a whole lot more complaints than that for journald.

The most common one (and one I share) is how slow it can be. `systemctl status foo.service` takes a significant amount of time on any of my machines thanks to the journal, and that's just the reader side.

It used to be quite crashy with lots of CPU overhead, but that has improved over time, the metadata caching helped a bunch with the overhead.

There was also a pretty embarrassing CVE not long ago:

https://nvd.nist.gov/vuln/detail/CVE-2018-16865

Re:Debian reconsiders init-system diversity by ibotty on Tuesday November 12, 2019 @01:52AM (#21512066)
You do still _use_ rsyslogd if you enable it. journald is fundamental to some core systemd functionality. Of course you can't get rid of it.
Re:Debian reconsiders init-system diversity by newnewpdro on Tuesday November 12, 2019 @02:42AM (#21512262)
Right, which just turns rsyslogd into another consumer of the journal data analogous to `journalctl --follow --all`. You still have all the overhead (and surface area) of journald being in the loop of everything logged.

Many people when they encounter problems with journald want to continue using systemd for their service management, but revert to the old world of low-overhead metadata-free unstructured syslog O_APPEND text files for everything logged.

If systemd (the project) were truly a collection of modular components you could pick and choose, you wouldn't need journald and you'd be able to run syslog like it's the 90s.

It's not an impossibility, the systemd developers just seem to have zero interest in implementing stuff that enables escaping their overall architecture. I imagine all that's needed is some minimal IPC glue to forward all the stdout/stderr output from services to syslog when journald isn't in use. Systemd's role is to wire that stuff up to journald currently, and it's unnecessarily opinionated about journald being the only supported target in that role.

Re:Debian reconsiders init-system diversity by bonzini on Tuesday November 12, 2019 @03:05AM (#21512382)
> If systemd (the project) were truly a collection of modular components you could pick and choose, you wouldn't need journald and you'd be able to run syslog like it's the 90s.

Journald and udevd are exactly the only piece of systemd that systemd's pid 1 requires, and udevd can be used independent of systemd's pid 1.

I just think of journald as a piece of the init system that is split to a separate process, and provides log data to other programs.

Re:Debian reconsiders init-system diversity by ibotty on Tuesday November 12, 2019 @04:21AM (#21512753)
It also gets back logs from journald! How do you envision `systemctl status $unit` to show the last logs if they are in some random log file?
Re:Debian reconsiders init-system diversity by newnewpdro on Tuesday November 12, 2019 @04:38AM (#21512808)
First of all, no, systemd as in PID1 does not get logs back from journald. The systemctl command is using the sd-journal API to do that directly from the journal files.

Secondly, I don't, I expect the recent logs portion of `systemctl status $unit` to be suppressed when journald isn't present.

Note that journal-caused slowness of that very command is a common complaint aimed at journald contributing to people wanting to remove it!

Re:Debian reconsiders init-system diversity by kungtotte on Tuesday November 12, 2019 @12:15PM (#21515823)
With runit, for example, logs are put in a canonical per-service directory.

E.g. `service_directory/service/logs`

Seems like a trivial way to solve it...

Re:Debian reconsiders init-system diversity by ibotty on Wednesday November 13, 2019 @02:46AM (#21521875)
Yes, of course that's possible. But that's no generic syslog daemon either.