On Fri, 24 Jan 2020 18:36:49 +0200
Mantas Mikulėnas <graw...@gmail.com> wrote:
> On Fri, Jan 24, 2020 at 5:32 PM Dave Howorth <syst...@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.
> >
> > My first thought was to configure journald to write the log
> > somewhere else, but it seems there's no possibility to do that?
> > (why not?)
> >
> > So I think I will need to create /var/log/journal as a symlink to a
> > directory in a permanent filesystem. The symlink needs to be created
> > after the tmpfs is created but before journald starts (or else
> > journald will need to be told to notice the change).
> >
> > My systemd foo isn't up to that and a web search hasn't found an
> > answer. What's the best way to do it please?
> >  
> 
> Mount --bind a persistent directory on top of /var/log/journal, using
> the same method that you currently use for mounting the tmpfs.

Many thanks for that. Obvious with the benefit of hindsight, but wasn't
to me at the time:)

I've come to realize that an equally interesting question is where to
put the logs? Somewhere under /var/lib seems closest but FHS 3
specifically says; "This hierarchy holds state information pertaining
to an application or the system. ... should not be logging output ...".
Does anybody here have any thoughts? I'll ask on the fhs list as well.

Thanks, Dave

> -- 
> Mantas Mikulėnas
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to