Comment # 22 on bug 1071224 from
Ok so how about doing this:

--- %< ---

$ cat /etc/systemd/system/systemd-disable-tmpfs-for-tmp.service 
# By default, /tmp doesn't use tmpfs on SUSE distros.
#
# This script is either run automatically during the firstboot (i.e.
# only once) of the system.
#
# Or the service can also be (manually) started during systemd update
# (%post) only and only if tmp.mount wasn't installed in /usr/lib
# during %pre. In this case tmp.mount should also masked.

[Unit]
Description=Mask tmp.mount by default on SUSE systems
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=tmp.mount
ConditionPathIsReadWrite=/etc
ConditionPathExists=!/usr/lib/systemd/scripts/.disable-tmp-mount-by-default.sh~done

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c '                        \
    case "$(systemctl show -pFragmentPath tmp.mount)" in    \
    FragmentPath=/usr/lib/systemd/system/tmp.mount)        \
        systemctl mask --now tmp.mount ;;        \
    esac'

ExecStartPost=/usr/bin/touch
/usr/lib/systemd/scripts/.disable-tmp-mount-by-default.sh~done

--- %< ---

this service should be statically pulled in by sysinit.target.

And in systemd.spec:

%pre
if test -e /usr/lib/systemd/system/tmp.mount; then
    # If tmp.mount is there it means that admin restored it and
    # wants to use tmpfs. In that case do nothing and prevent
    # the service to be executed during %post.
    touch /usr/lib/systemd/scripts/.disable-tmp-mount-by-default.sh~done
fi

%post
# Let's the service figure out what needs to be done, note
# that it's going to be executed only once.
systemctl start systemd-disable-tmpfs-for-tmp.service

That way we should support the various ways a SUSE system can be created
(heck!) and it should be fairly simple to switch back to tmpfs for /tmp the day
SUSE will decide to do it.

Ludwig, would that fill the gap ?


You are receiving this mail because: