From 642fe32ebf69cd92d86b87a9b8f96f8c0068d94e3ed0cd4154d73c48599cb561 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 22 Dec 2015 10:31:01 +0000 Subject: [PATCH] Accepting request 350220 from home:fbui:branches:Base:System:disable-tmpfs-on-tmp OBS-URL: https://build.opensuse.org/request/show/350220 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=922 --- systemd-mini.changes | 5 +++++ systemd-mini.spec | 15 ++++++++++++++- systemd.changes | 5 +++++ systemd.spec | 15 ++++++++++++++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/systemd-mini.changes b/systemd-mini.changes index 36949b52..c8c21bf6 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 21 16:25:44 UTC 2015 - fbui@suse.com + +- Make sure we don't use tmpfs on /tmp by default (bsc#940522) + ------------------------------------------------------------------- Mon Nov 30 13:59:52 UTC 2015 - thomas.blume@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 581173e5..723c88fe 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -756,8 +756,11 @@ ln -s ../usr/bin/systemctl %{buildroot}/sbin/runlevel rm -rf %{buildroot}/etc/systemd/system/*.target.wants rm -f %{buildroot}/etc/systemd/system/default.target -# don't mount /tmp as tmpfs for now +# We keep a copy of tmp.mount because it may be removed if not used +# (see %post): we want to be sure tmpfs won't be used for /tmp by +# default on Suse distros. rm %{buildroot}/%{_prefix}/lib/systemd/system/local-fs.target.wants/tmp.mount +cp %{buildroot}/%{_prefix}/lib/systemd/system/tmp.mount %{buildroot}/%{_datadir}/systemd/ # don't enable wall ask password service, it spams every console (bnc#747783) rm %{buildroot}%{_prefix}/lib/systemd/system/multi-user.target.wants/systemd-ask-password-wall.path @@ -965,6 +968,16 @@ for f in $(find /etc/systemd/system -type l -xtype l); do [ -f "$new_target" ] && ln -s -f $new_target $f || : done +# Keep tmp.mount if it's been enabled explicitly by the user otherwise +# make sure it wont be activated since it's the default for Suse +# distros. This unit can be pulled (implicitely) in various ways +# (private /tmp, etc..) and it's required by the basic.target +# explicitly since v220. +case $(/usr/bin/systemctl is-enabled tmp.mount 2>/dev/null) in +enabled) ;; +*) rm -f %{_prefix}/lib/systemd/system/tmp.mount +esac + %postun /sbin/ldconfig if [ $1 -ge 1 ]; then diff --git a/systemd.changes b/systemd.changes index 36949b52..c8c21bf6 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Dec 21 16:25:44 UTC 2015 - fbui@suse.com + +- Make sure we don't use tmpfs on /tmp by default (bsc#940522) + ------------------------------------------------------------------- Mon Nov 30 13:59:52 UTC 2015 - thomas.blume@suse.com diff --git a/systemd.spec b/systemd.spec index 97f7e0e9..45a74271 100644 --- a/systemd.spec +++ b/systemd.spec @@ -751,8 +751,11 @@ ln -s ../usr/bin/systemctl %{buildroot}/sbin/runlevel rm -rf %{buildroot}/etc/systemd/system/*.target.wants rm -f %{buildroot}/etc/systemd/system/default.target -# don't mount /tmp as tmpfs for now +# We keep a copy of tmp.mount because it may be removed if not used +# (see %post): we want to be sure tmpfs won't be used for /tmp by +# default on Suse distros. rm %{buildroot}/%{_prefix}/lib/systemd/system/local-fs.target.wants/tmp.mount +cp %{buildroot}/%{_prefix}/lib/systemd/system/tmp.mount %{buildroot}/%{_datadir}/systemd/ # don't enable wall ask password service, it spams every console (bnc#747783) rm %{buildroot}%{_prefix}/lib/systemd/system/multi-user.target.wants/systemd-ask-password-wall.path @@ -960,6 +963,16 @@ for f in $(find /etc/systemd/system -type l -xtype l); do [ -f "$new_target" ] && ln -s -f $new_target $f || : done +# Keep tmp.mount if it's been enabled explicitly by the user otherwise +# make sure it wont be activated since it's the default for Suse +# distros. This unit can be pulled (implicitely) in various ways +# (private /tmp, etc..) and it's required by the basic.target +# explicitly since v220. +case $(/usr/bin/systemctl is-enabled tmp.mount 2>/dev/null) in +enabled) ;; +*) rm -f %{_prefix}/lib/systemd/system/tmp.mount +esac + %postun /sbin/ldconfig if [ $1 -ge 1 ]; then