[systemd-devel] making journald logs persistent on raspberry pi

Dave Howorth systemd at howorth.org.uk
Tue Mar 31 16:53:14 UTC 2020


On Tue, 31 Mar 2020 14:48:48 +0200
Lennart Poettering <lennart at poettering.net> wrote:
> On Fr, 24.01.20 15:32, Dave Howorth (systemd at howorth.org.uk) wrote:
> 
> > It's quite common on the Raspberry Pi to make /var/log a tmpfs, in
> > order to reduce the number of writes to the SD card that is the pi's
> > main storage. That's quite acceptable for most logs but I'd like to
> > make journald's logs persistent so I'll be able to investigate any
> > problems that occur whilst booting or shutting down more easily.  
> 
> Hmm, if you want volatile logging, use /run/log/...

I suppose you have some time now to revisit this old thread :)
But thanks for answering.
 
> It sounds strange to me, first making /var/log/... volatile, which is
> kinda where the stuff goes that is supposed to be persistent and then
> tryng to exclude stuff there again...

The problem is that almost all existing systems, services, whatever
send their logs by default to /var/log and each may or may not have a
different mechanism to redirect their logs to /run/log/. Plus each
individual user's machines may have a variety of different software
installed.

So if one wants a general means to guarantee reducing writes to the SD
card, it's easier to change how /var/log is stored than to provide a
facility that changes the log locations of every application on every
person's machine, where one doesn't even know what all those
applications are.

> i.e. journald's Storage= setting most just allows you to choose
> between /var/log/… and /run/log/… as data store.

Indeed, but that doesn't help in this scenario. Fortunately Mantas
provided a nice answer back in January :)

Cheers, Dave

> Lennart
> 
> --
> Lennart Poettering, Berlin


More information about the systemd-devel mailing list