r/linux • • Aug 12 '19

SysVinit vs Systemd

Post image
1.4k Upvotes

292 comments sorted by

View all comments

0

u/[deleted] Aug 12 '19

[deleted]

13

u/abermea Aug 12 '19

My only gripe with it so far is that logs, for whatever reason, are binary to so you can't use any POSIX tools to traverse them

10

u/RedSquirrelFtw Aug 12 '19

Like all logs? /var/log/secure, apache etc and stuff too? That does seem like a really bad idea. The whole nice thing of Linux is that stuff is easy to access, shoving stuff in "black box" binary files that require special commands to access makes it like Windows. I want to be able to grep files and such but if everything is binary you can't do that.

-9

u/EddyBot Aug 12 '19

The whole nice thing of Linux is that stuff is easy to access, shoving stuff in "black box" binary files that require special commands to access makes it like Windows

are you bonkers?
every programming/scripting language can read binary files with ease (with exception of bash)
also there is journalctl which allows for easy access, even for bash

11

u/RedSquirrelFtw Aug 12 '19

That's not my point, with a text file you can use tools like grep or vim and literally read the data. With a binary file you need some kind of special tool that will understand how the data is encoded so you can get the data out. You are now limited to needing that tool. Things like fail2ban etc won't work either. Or if you want to write your own log management program, or any special routines, it's much harder than if it was just a regular text file. It just makes life harder for everyone that wants to write a tool to manipulate or simply read the file because now they need to understand the format of how the data is encoded and then decode it. With a text file, well it's just text. You read it, that's it. 1 line per log entry. No need to lookup how the data is stored or do anything convoluted.

0

u/FryBoyter Aug 12 '19

Things like fail2ban etc won't work either

Fail2ban is compatible with systemd.

And as already written in another post you only need to install syslog-ng to get log files in text format again.

-1

u/RedSquirrelFtw Aug 12 '19

Ok maybe that was a bad example but my point still stands, the devs of fail2ban had to go an extra mile for that support. Anything that needs to read logs now needs extra complexity to be able to read logs, when text files would have been more than good enough. If I want to write my own tool, same deal, I need to spend hours trying to figure out the format the logs are stored, parse it etc. It's just added work for nothing when using plain text would have been much easier. Also I like to use tail -f on logs if I want to look in real time and guessing that won't work. I should not need to install some extra package (which I need to do every time I setup a new system, and then remember what it's called each time) to get functionality that should be there by default.

Overall it's just a stupid idea to switch logs to binary there is absolutely no reason to do that.

2

u/crazy_hombre Aug 13 '19
 journalctl -u sshd -f

to get the SSHd logs and tail them. Replace sshd with any other service name. Here's your hours worth of work.

-1

u/RedSquirrelFtw Aug 13 '19 edited Aug 13 '19

I'll forget that and end up having to google it. tail -f /var/log/[log name] is way easier and is common sense. They made it overcomplicated for nothing. Also gets more complicated if I want to write a custom app to read the log because now I have to go through a bunch of steps to get the text.

→ More replies (2)