[systemd-devel] [PATCH] tmpfiles: only execute chmod()/chown() when needed

Michael Olbrich m.olbrich at pengutronix.de
Wed Jul 16 05:48:19 PDT 2014


On Fri, Jul 11, 2014 at 03:52:21PM -0700, Colin Walters wrote:
> On Fri, Jul 11, 2014, at 03:04 PM, Dave Reisner wrote:
> > No way. This precludes tmpfiles from creating directories in /run.
> 
> Yeah that suggestion would break other stuff too, ignore it.
> 
> This does get into the ostree commit I linked to though; we could just
> have systemd mount /var as a tmpfs if the filesystem is readonly.  
> 
> I'm guessing Michael is doing something like generating a disk image
> that's composed using traditional rpm/dpkg type tooling which lays out
> skeleton directories in /var, and then booting it as readonly.  That
> sort of situation is why we changed OSTree to auto-mount a /var tmpfs,
> and it's worth thinking about at least if systemd should do the same.

Yes, I'm generating the directories as part of an rootfs image. I don't
really need everything that tmp-files checks for, but I'd rather avoid
patching systemd, and a few extra directories are not a problem.

> The main concern I had is that if you're booting the system readonly to
> try to say recover the journald logs, it'd be kind of annoying to have
> them vanish...
> 
> Another option is to have systemd-tmpfiles silently ignore EROFS.

No, it should warn if _real_ changes fail, but right now chown/chmod are
executed and fail, even if directories/files already exist with the correct
permissions.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


More information about the systemd-devel mailing list