[systemd-devel] logging in RAM and journald configuration issue

Dave Howorth systemd at howorth.org.uk
Tue Apr 2 19:49:45 UTC 2019

On Tue, 2 Apr 2019 18:47:00 +0200
Lennart Poettering <lennart at poettering.net> wrote:
> On Di, 02.04.19 17:42, Dave Howorth (systemd at howorth.org.uk) wrote:
> > On 2019-03-20 Lennart Poettering wrote:
> >  
> > > On Mi, 20.03.19 18:08, Dave Howorth (systemd at howorth.org.uk)
> > > wrote: 
> > > >
> > > > At present AFAICT the log2ram.service runs
> > > > Before=systemd-journald.service and various other services, so I
> > > > think that aspect is covered.  
> > >
> > > I am not sure what this service does, but if all you want to do is
> > > make changes to /var/log/journal before journald writes there it
> > > should be sufficient to order it before
> > > systemd-journal-flush.service which is nowadays the clear
> > > boundary when journald starts writing to /var.  
> >
> > Sorry for the late reply, but I'm just trying to understand this
> > better. Is systemd-journal-flush.service documented anywhere?  
> It just invokes "journalctl --flush" which is documented here:
> https://www.freedesktop.org/software/systemd/man/journalctl.html#--flush

Thanks. I'm trying to decide the best way to insert this log2ram service
into the system startup order. My handicap is that I'm starting from
zero knowledge of systemd :(

This service needs access to the local filesystem; /var/log in
particular. Ideally it also will startup before any service starts
logging to /var/log, because it needs to rearrange (some may say
pervert!) things so that /var/log is mapped to a ram filesystem and
populated from a persistent record before any arbitrary service starts
reading or writing log files in /var/log. As a special case, it maps
journald's directory back to persistent store, since journald has an
intelligent write strategy. So it needs to start after the /var
filesystem but before any services that use it.

So I'm looking for the appropriate things to put in Before and After
lines for this service.

More information about the systemd-devel mailing list