Mailinglist Archive: opensuse-factory (435 mails)

< Previous Next >
Re: [opensuse-factory] Proposal: /tmp as tmpfs
Am 10.07.20 um 14:08 schrieb H.Merijn Brand:
On Fri, 10 Jul 2020 13:51:10 +0200, Michal Kubecek <mkubecek@xxxxxxx>
wrote:

On Fri, Jul 10, 2020 at 11:49:45AM +0200, Richard Brown wrote:

Chiming in late, sorry

We recently moved MicroOS and Kubic to use tmpfs for /tmp instead of
writing files there to disk.
[...]
All of these reasons also apply for regular openSUSE, so I would
like to propose that Tumbleweed moves to tmpfs for /tmp soon also.

I would vehemently oppose, as we have 3rd-party applications that
write to (NOT configurable) /tmp and expect it to last there for a
certain time (even after a reboot).

To workaround of that, I have created several symbolic links on /tmp
to /data/tmp (or /opt/app/tmp or whatever) and I would be very
unpleased to see all those symlinks disappear on a reboot. That would
mean I have to write service files that fire up immediately after /tmp
comes up and recreates those symlinks before the application wants to
start.


#> cat /usr/share/systemd/tmp.mount
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

[Unit]
Description=Temporary Directory (/tmp)
Documentation=man:hier(7)
Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
ConditionPathIsSymbolicLink=!/tmp
DefaultDependencies=no
Conflicts=umount.target
Before=local-fs.target umount.target
After=swap.target

[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,nosuid,nodev



Notice the "ConditionPathIsSymbolicLink=!/tmp", which, I guess, will prevent
damage in your case.



I really like to keep my /tmp's as clean as possible, but sometimes it
is not under our control :(

FWIW I never had to do anything like that on /usr/tmp

Does anyone have any objections, concerns, thoughts?

No objection to the general change but I would suggest two exceptions:

1. Systems where user created a specific mount point for /tmp (whether
tmpfs or normal filesystem). According to the previous discussion,
this should be taken care of already.

2. Systems with less memory than a certain threshold. I'm not sure
what the threshold should be but I would be afraid to configure
/tmp on tmpfs by default on systems with 4GB of RAM. 8GB might be
OK, I have such configuration on my laptop with 8GB myself and
didn't encounter any problems (but it took me quite some time to
summon the courage).

:)

Michal Kubecek


--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >
This Thread