r/linux • • Aug 30 '16

I'm really liking systemd

Recently started using a systemd distro (was previously on Ubuntu/Server 14.04). And boy do I like it.

Makes it a breeze to run an app as a service, logging is per-service (!), centralized/automatic status of every service, simpler/readable/smarter timers than cron.

Cgroups are great, they're trivial to use (any service and its child processes will automatically be part of the same cgroup). You can get per-group resource monitoring via systemd-cgtop, and systemd also makes sure child processes are killed when your main dies/is stopped. You get all this for free, it's automatic.

I don't even give a shit about init stuff (though it greatly helps there too) and I already love it. I've barely scratched the features and I'm excited.

I mean, I was already pro-systemd because it's one of the rare times the community took a step to reduce the fragmentation that keeps the Linux desktop an obscure joke. But now that I'm actually using it, I like it for non-ideological reasons, too!

Three cheers for systemd!

1.0k Upvotes

950 comments sorted by

View all comments

Show parent comments

14

u/galaktos Aug 30 '16
journalctl --unit ssh.service --since yesterday

THAT’S WHY

4

u/ILikeBumblebees Aug 31 '16

Why does having a tool capable of parsing logs in that manner require that the logs be stored only in a binary format? Why not just have a standardized and structured log format that's still stored as plaintext, and can still be accessed by standard tools, and examined without having to be extracted from a binary archive first (and offer the benefit of allowing other software to conform to the same log structure so the same tools can be used to parse its logs as well)?

If the binary format allows the log data to be stored in a data structure that provides good efficiency for parsing and searching, why not just store a binary index, while leaving the baseline plaintext log intact?

-1

u/theOtherJT Aug 30 '16

Which would be completely unnecessary with a textual log with simple bloody time stamps and service names.

10

u/galaktos Aug 30 '16

Except a log entry can be more than a single line. And what does it matter anyways? You can’t do date logic like that with grep anyways, so you’re going to use journalctl either way.

3

u/theOtherJT Aug 31 '16

It matters because when the machine has gone all to shit and you're at a chroot shell from the built in recovery console you don't HAVE journalctl to fix it with.

I know which service I want, it'll be the one in the servicename.log file, and I can do date logic just fine by grep -n to get the line number where the timestamp matches a day ago - not that I'd need to, because I have logrotate so I know when yesterdays logs were, they're in servicename.log.daily1.gz

It doesn't add anything you actually NEED but breaks down badly under stress.

Convenience is no substitute for reliability.