[systemd-devel] [PATCH] Fix permissions on new journal files

Greg KH gregkh at linuxfoundation.org
Thu Mar 13 20:59:49 PDT 2014


On Fri, Mar 14, 2014 at 03:28:27AM +0100, Zbigniew Jędrzejewski-Szmek wrote:
> On Fri, Mar 14, 2014 at 12:07:35AM +0000, Greg KH wrote:
> > When starting up journald on a new system, set the proper permissions on
> > the system.journal file, not only on the journal directory.
> > 
> > diff --git a/tmpfiles.d/systemd.conf b/tmpfiles.d/systemd.conf
> > index 7c6d6b9099b9..1aeb5e40f1ee 100644
> > --- a/tmpfiles.d/systemd.conf
> > +++ b/tmpfiles.d/systemd.conf
> > @@ -24,5 +24,7 @@ d /run/systemd/shutdown 0755 root root -
> >  
> >  m /var/log/journal 2755 root systemd-journal - -
> >  m /var/log/journal/%m 2755 root systemd-journal - -
> > +m /var/log/journal/%m/system.journal 2755 root systemd-journal - -
> >  m /run/log/journal 2755 root systemd-journal - -
> >  m /run/log/journal/%m 2755 root systemd-journal - -
> > +m /run/log/journal/%m/system.journal 2755 root systemd-journal - -
> This is just a kludge... Why is system.journal to be treated differently?
> It seems that the proper fix is to set the mode on the directory properly
> during installation.

And how does one "install" /run/log/journal/ on your system?  :)

system.journal isn't to be treated "differently", what happens if you
boot a box with no /run/log/journal/?  journald will startup and create
systemd.journal, and the directory tree along the way.  Then tmpfiles
will come along and set the permissions properly.

So, do you know of a different way to solve this issue without this
systemd.conf file?

thanks,

greg k-h


More information about the systemd-devel mailing list