[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Journald's qualities (was: Selective rotation of journald logs)



Dnia 2024-02-23, o godz. 12:34:34
Dan Ritter <dsr@randomstring.org> napisał(a):

> Stefan Monnier wrote: 
> > Makes one wonder why they don't use naive append-only "plain text"
> > logs (tho with appropriate delimiters (maybe some kind of CSV) to
> > make searches more reliable than with old-style plain text logs)?
> > 
> > What are the advantages of journald's representation?
> > I mean, to justify the slow search and large disk space usage,
> > there is presumably some upside for some use cases.  I can see some
> > weak argument against Sqlite based on the size of Sqlite, but what
> > are the advantages of journald's representation compared to a naive
> > one?  
> 
> 
> systemd's design philosophy, observed from the outside, goes
> like this:
> 
> - assume that the machine is a laptop or mobile device that is
> always changing: moves from network to network, plugs and
> unplugs devices, goes to sleep and is woken up

I had thought similar thoughts many times when using it. But some of
the stuff that derived from that is pretty useful; for example we had a
service tht downloaded encryption keys from central server to unlock
the hard drive and sysV version was a bit of a mess (if service didn't
ran on boot there was no unlocked volume to mount), while in systemd
the dependencies allow it to automatically bring it up when mount is
requested, and the mount will also be automatically done if service
using it is started (if it has correct RequiresMountsFor entries). So
some actually useful stuff for more "constant config" machines had
flown from that

> - disk space is limited, but cpu time is free

In which way ? It doesn't care about wasting space, but it does assume
you have blazing fast storage or else journal related ops are sluggish
(and waste disk cache as it just reads hundreds of MBs to find last few
lines of logfile)

> - the network knows better than local config

Offtopic but since Debian switched to systemd for DNS management on
VPNs and suc I need to restart it sometimes multiple times to just get
"right" DNS servers, because there appears to be no notion of priority:

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

so now any time I connect to work (just openvpn tunnel, nothing fancy)
I need to spam

systemclt restart systemd-resolved ; sleep 1 ; cat /etc/resolv.conf

few times till the dice rolls the right order of DNS servers...

XANi



-- 
Mariusz Gronczewski (XANi) <xani666@gmail.com>
GnuPG: 0xEA8ACE64
https://devrandom.eu


Reply to: